proteus  1.8.1
C/C++/Fortran libraries
MeshAdapt.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__MeshAdaptPUMI__MeshAdapt
708 #define __PYX_HAVE_API__MeshAdaptPUMI__MeshAdapt
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 "mesh.h"
721 #include <string>
722 #include "ios"
723 #include "new"
724 #include "stdexcept"
725 #include "typeinfo"
726 #include <vector>
728 #ifdef _OPENMP
729 #include <omp.h>
730 #endif /* _OPENMP */
731 
732 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
733 #define CYTHON_WITHOUT_ASSERTIONS
734 #endif
735 
736 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
737  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
738 
739 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
740 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
741 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
742 #define __PYX_DEFAULT_STRING_ENCODING ""
743 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
744 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
745 #define __Pyx_uchar_cast(c) ((unsigned char)c)
746 #define __Pyx_long_cast(x) ((long)x)
747 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
748  (sizeof(type) < sizeof(Py_ssize_t)) ||\
749  (sizeof(type) > sizeof(Py_ssize_t) &&\
750  likely(v < (type)PY_SSIZE_T_MAX ||\
751  v == (type)PY_SSIZE_T_MAX) &&\
752  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
753  v == (type)PY_SSIZE_T_MIN))) ||\
754  (sizeof(type) == sizeof(Py_ssize_t) &&\
755  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
756  v == (type)PY_SSIZE_T_MAX))) )
757 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
758  return (size_t) i < (size_t) limit;
759 }
760 #if defined (__cplusplus) && __cplusplus >= 201103L
761  #include <cstdlib>
762  #define __Pyx_sst_abs(value) std::abs(value)
763 #elif SIZEOF_INT >= SIZEOF_SIZE_T
764  #define __Pyx_sst_abs(value) abs(value)
765 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
766  #define __Pyx_sst_abs(value) labs(value)
767 #elif defined (_MSC_VER)
768  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
769 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
770  #define __Pyx_sst_abs(value) llabs(value)
771 #elif defined (__GNUC__)
772  #define __Pyx_sst_abs(value) __builtin_llabs(value)
773 #else
774  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
775 #endif
776 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
777 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
778 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
779 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
780 #define __Pyx_PyBytes_FromString PyBytes_FromString
781 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
782 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
783 #if PY_MAJOR_VERSION < 3
784  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
785  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
786 #else
787  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
788  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
789 #endif
790 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
792 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
793 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
794 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
795 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
796 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
797 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
798 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
799 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
800 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
801 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
802 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
803 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
804 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
805 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
806 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
807  const Py_UNICODE *u_end = u;
808  while (*u_end++) ;
809  return (size_t)(u_end - u - 1);
810 }
811 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
812 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
813 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
814 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
815 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
816 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
817 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
818 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
819 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
820 #define __Pyx_PySequence_Tuple(obj)\
821  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
822 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
823 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
824 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
825 #if CYTHON_ASSUME_SAFE_MACROS
826 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
827 #else
828 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
829 #endif
830 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
831 #if PY_MAJOR_VERSION >= 3
832 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
833 #else
834 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
835 #endif
836 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
837 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
838 static int __Pyx_sys_getdefaultencoding_not_ascii;
839 static int __Pyx_init_sys_getdefaultencoding_params(void) {
840  PyObject* sys;
841  PyObject* default_encoding = NULL;
842  PyObject* ascii_chars_u = NULL;
843  PyObject* ascii_chars_b = NULL;
844  const char* default_encoding_c;
845  sys = PyImport_ImportModule("sys");
846  if (!sys) goto bad;
847  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
848  Py_DECREF(sys);
849  if (!default_encoding) goto bad;
850  default_encoding_c = PyBytes_AsString(default_encoding);
851  if (!default_encoding_c) goto bad;
852  if (strcmp(default_encoding_c, "ascii") == 0) {
853  __Pyx_sys_getdefaultencoding_not_ascii = 0;
854  } else {
855  char ascii_chars[128];
856  int c;
857  for (c = 0; c < 128; c++) {
858  ascii_chars[c] = c;
859  }
860  __Pyx_sys_getdefaultencoding_not_ascii = 1;
861  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
862  if (!ascii_chars_u) goto bad;
863  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
864  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
865  PyErr_Format(
866  PyExc_ValueError,
867  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
868  default_encoding_c);
869  goto bad;
870  }
871  Py_DECREF(ascii_chars_u);
872  Py_DECREF(ascii_chars_b);
873  }
874  Py_DECREF(default_encoding);
875  return 0;
876 bad:
877  Py_XDECREF(default_encoding);
878  Py_XDECREF(ascii_chars_u);
879  Py_XDECREF(ascii_chars_b);
880  return -1;
881 }
882 #endif
883 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
884 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
885 #else
886 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
887 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
888 static char* __PYX_DEFAULT_STRING_ENCODING;
889 static int __Pyx_init_sys_getdefaultencoding_params(void) {
890  PyObject* sys;
891  PyObject* default_encoding = NULL;
892  char* default_encoding_c;
893  sys = PyImport_ImportModule("sys");
894  if (!sys) goto bad;
895  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
896  Py_DECREF(sys);
897  if (!default_encoding) goto bad;
898  default_encoding_c = PyBytes_AsString(default_encoding);
899  if (!default_encoding_c) goto bad;
900  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
901  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
902  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
903  Py_DECREF(default_encoding);
904  return 0;
905 bad:
906  Py_XDECREF(default_encoding);
907  return -1;
908 }
909 #endif
910 #endif
911 
912 
913 /* Test for GCC > 2.95 */
914 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
915  #define likely(x) __builtin_expect(!!(x), 1)
916  #define unlikely(x) __builtin_expect(!!(x), 0)
917 #else /* !__GNUC__ or GCC < 2.95 */
918  #define likely(x) (x)
919  #define unlikely(x) (x)
920 #endif /* __GNUC__ */
921 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
922 
923 static PyObject *__pyx_m = NULL;
924 static PyObject *__pyx_d;
925 static PyObject *__pyx_b;
926 static PyObject *__pyx_cython_runtime = NULL;
927 static PyObject *__pyx_empty_tuple;
928 static PyObject *__pyx_empty_bytes;
929 static PyObject *__pyx_empty_unicode;
930 static int __pyx_lineno;
931 static int __pyx_clineno = 0;
932 static const char * __pyx_cfilenm= __FILE__;
933 static const char *__pyx_filename;
934 
935 /* Header.proto */
936 #if !defined(CYTHON_CCOMPLEX)
937  #if defined(__cplusplus)
938  #define CYTHON_CCOMPLEX 1
939  #elif defined(_Complex_I)
940  #define CYTHON_CCOMPLEX 1
941  #else
942  #define CYTHON_CCOMPLEX 0
943  #endif
944 #endif
945 #if CYTHON_CCOMPLEX
946  #ifdef __cplusplus
947  #include <complex>
948  #else
949  #include <complex.h>
950  #endif
951 #endif
952 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
953  #undef _Complex_I
954  #define _Complex_I 1.0fj
955 #endif
956 
957 
958 static const char *__pyx_f[] = {
959  "stringsource",
960  "proteus/MeshAdaptPUMI/MeshAdapt.pyx",
961  "__init__.pxd",
962  "type.pxd",
963  "proteus/cmeshTools.pxd",
964 };
965 /* BufferFormatStructs.proto */
966 #define IS_UNSIGNED(type) (((type) -1) > 0)
967 struct __Pyx_StructField_;
968 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
969 typedef struct {
970  const char* name;
971  struct __Pyx_StructField_* fields;
972  size_t size;
973  size_t arraysize[8];
974  int ndim;
975  char typegroup;
976  char is_unsigned;
977  int flags;
978 } __Pyx_TypeInfo;
979 typedef struct __Pyx_StructField_ {
980  __Pyx_TypeInfo* type;
981  const char* name;
982  size_t offset;
983 } __Pyx_StructField;
984 typedef struct {
985  __Pyx_StructField* field;
986  size_t parent_offset;
987 } __Pyx_BufFmt_StackElem;
988 typedef struct {
989  __Pyx_StructField root;
990  __Pyx_BufFmt_StackElem* head;
991  size_t fmt_offset;
992  size_t new_count, enc_count;
993  size_t struct_alignment;
994  int is_complex;
995  char enc_type;
996  char new_packmode;
997  char enc_packmode;
998  char is_valid_array;
999 } __Pyx_BufFmt_Context;
1000 
1001 
1002 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
1003  * # in Cython to enable them only on the right systems.
1004  *
1005  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1006  * ctypedef npy_int16 int16_t
1007  * ctypedef npy_int32 int32_t
1008  */
1009 typedef npy_int8 __pyx_t_5numpy_int8_t;
1010 
1011 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
1012  *
1013  * ctypedef npy_int8 int8_t
1014  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1015  * ctypedef npy_int32 int32_t
1016  * ctypedef npy_int64 int64_t
1017  */
1018 typedef npy_int16 __pyx_t_5numpy_int16_t;
1019 
1020 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
1021  * ctypedef npy_int8 int8_t
1022  * ctypedef npy_int16 int16_t
1023  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1024  * ctypedef npy_int64 int64_t
1025  * #ctypedef npy_int96 int96_t
1026  */
1027 typedef npy_int32 __pyx_t_5numpy_int32_t;
1028 
1029 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
1030  * ctypedef npy_int16 int16_t
1031  * ctypedef npy_int32 int32_t
1032  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1033  * #ctypedef npy_int96 int96_t
1034  * #ctypedef npy_int128 int128_t
1035  */
1036 typedef npy_int64 __pyx_t_5numpy_int64_t;
1037 
1038 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
1039  * #ctypedef npy_int128 int128_t
1040  *
1041  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1042  * ctypedef npy_uint16 uint16_t
1043  * ctypedef npy_uint32 uint32_t
1044  */
1045 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1046 
1047 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1048  *
1049  * ctypedef npy_uint8 uint8_t
1050  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1051  * ctypedef npy_uint32 uint32_t
1052  * ctypedef npy_uint64 uint64_t
1053  */
1054 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1055 
1056 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1057  * ctypedef npy_uint8 uint8_t
1058  * ctypedef npy_uint16 uint16_t
1059  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1060  * ctypedef npy_uint64 uint64_t
1061  * #ctypedef npy_uint96 uint96_t
1062  */
1063 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1064 
1065 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1066  * ctypedef npy_uint16 uint16_t
1067  * ctypedef npy_uint32 uint32_t
1068  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1069  * #ctypedef npy_uint96 uint96_t
1070  * #ctypedef npy_uint128 uint128_t
1071  */
1072 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1073 
1074 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1075  * #ctypedef npy_uint128 uint128_t
1076  *
1077  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1078  * ctypedef npy_float64 float64_t
1079  * #ctypedef npy_float80 float80_t
1080  */
1081 typedef npy_float32 __pyx_t_5numpy_float32_t;
1082 
1083 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1084  *
1085  * ctypedef npy_float32 float32_t
1086  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1087  * #ctypedef npy_float80 float80_t
1088  * #ctypedef npy_float128 float128_t
1089  */
1090 typedef npy_float64 __pyx_t_5numpy_float64_t;
1091 
1092 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1093  * # The int types are mapped a bit surprising --
1094  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1095  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1096  * ctypedef npy_longlong long_t
1097  * ctypedef npy_longlong longlong_t
1098  */
1099 typedef npy_long __pyx_t_5numpy_int_t;
1100 
1101 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1102  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1103  * ctypedef npy_long int_t
1104  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1105  * ctypedef npy_longlong longlong_t
1106  *
1107  */
1108 typedef npy_longlong __pyx_t_5numpy_long_t;
1109 
1110 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1111  * ctypedef npy_long int_t
1112  * ctypedef npy_longlong long_t
1113  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1114  *
1115  * ctypedef npy_ulong uint_t
1116  */
1117 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1118 
1119 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1120  * ctypedef npy_longlong longlong_t
1121  *
1122  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1123  * ctypedef npy_ulonglong ulong_t
1124  * ctypedef npy_ulonglong ulonglong_t
1125  */
1126 typedef npy_ulong __pyx_t_5numpy_uint_t;
1127 
1128 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1129  *
1130  * ctypedef npy_ulong uint_t
1131  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1132  * ctypedef npy_ulonglong ulonglong_t
1133  *
1134  */
1135 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1136 
1137 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1138  * ctypedef npy_ulong uint_t
1139  * ctypedef npy_ulonglong ulong_t
1140  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1141  *
1142  * ctypedef npy_intp intp_t
1143  */
1144 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1145 
1146 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1147  * ctypedef npy_ulonglong ulonglong_t
1148  *
1149  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1150  * ctypedef npy_uintp uintp_t
1151  *
1152  */
1153 typedef npy_intp __pyx_t_5numpy_intp_t;
1154 
1155 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1156  *
1157  * ctypedef npy_intp intp_t
1158  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1159  *
1160  * ctypedef npy_double float_t
1161  */
1162 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1163 
1164 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1165  * ctypedef npy_uintp uintp_t
1166  *
1167  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1168  * ctypedef npy_double double_t
1169  * ctypedef npy_longdouble longdouble_t
1170  */
1171 typedef npy_double __pyx_t_5numpy_float_t;
1172 
1173 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1174  *
1175  * ctypedef npy_double float_t
1176  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1177  * ctypedef npy_longdouble longdouble_t
1178  *
1179  */
1180 typedef npy_double __pyx_t_5numpy_double_t;
1181 
1182 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1183  * ctypedef npy_double float_t
1184  * ctypedef npy_double double_t
1185  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1186  *
1187  * ctypedef npy_cfloat cfloat_t
1188  */
1189 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1190 /* Declarations.proto */
1191 #if CYTHON_CCOMPLEX
1192  #ifdef __cplusplus
1193  typedef ::std::complex< float > __pyx_t_float_complex;
1194  #else
1195  typedef float _Complex __pyx_t_float_complex;
1196  #endif
1197 #else
1198  typedef struct { float real, imag; } __pyx_t_float_complex;
1199 #endif
1200 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1201 
1202 /* Declarations.proto */
1203 #if CYTHON_CCOMPLEX
1204  #ifdef __cplusplus
1205  typedef ::std::complex< double > __pyx_t_double_complex;
1206  #else
1207  typedef double _Complex __pyx_t_double_complex;
1208  #endif
1209 #else
1210  typedef struct { double real, imag; } __pyx_t_double_complex;
1211 #endif
1212 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1213 
1214 
1215 /*--- Type declarations ---*/
1216 struct __pyx_obj_7proteus_10cmeshTools_CMesh;
1217 struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt;
1218 
1219 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1220  * ctypedef npy_longdouble longdouble_t
1221  *
1222  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1223  * ctypedef npy_cdouble cdouble_t
1224  * ctypedef npy_clongdouble clongdouble_t
1225  */
1226 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1227 
1228 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1229  *
1230  * ctypedef npy_cfloat cfloat_t
1231  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1232  * ctypedef npy_clongdouble clongdouble_t
1233  *
1234  */
1235 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1236 
1237 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1238  * ctypedef npy_cfloat cfloat_t
1239  * ctypedef npy_cdouble cdouble_t
1240  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1241  *
1242  * ctypedef npy_cdouble complex_t
1243  */
1244 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1245 
1246 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1247  * ctypedef npy_clongdouble clongdouble_t
1248  *
1249  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1250  *
1251  * cdef inline object PyArray_MultiIterNew1(a):
1252  */
1253 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1254 struct __pyx_defaults;
1255 typedef struct __pyx_defaults __pyx_defaults;
1256 struct __pyx_defaults {
1257  PyObject *__pyx_arg_adapter;
1258 };
1259 
1260 /* "cmeshTools.pxd":5
1261  * cimport mesh as cppm
1262  *
1263  * cdef class CMesh: # <<<<<<<<<<<<<<
1264  * cdef cppm.Mesh mesh
1265  * cdef public:
1266  */
1267 struct __pyx_obj_7proteus_10cmeshTools_CMesh {
1268  PyObject_HEAD
1269  struct Mesh mesh;
1270  int nElements_global;
1271  int nNodes_global;
1272  int nNodes_element;
1278  int max_nElements_node;
1279  int nEdges_global;
1281  PyArrayObject *elementNodesArray;
1282  PyArrayObject *nodeElementsArray;
1283  PyArrayObject *nodeElementOffsets;
1284  PyArrayObject *elementNeighborsArray;
1285  PyArrayObject *elementBoundariesArray;
1286  PyArrayObject *elementBoundaryNodesArray;
1287  PyArrayObject *elementBoundaryElementsArray;
1289  PyArrayObject *interiorElementBoundariesArray;
1290  PyArrayObject *exteriorElementBoundariesArray;
1291  PyArrayObject *edgeNodesArray;
1292  PyArrayObject *nodeStarArray;
1293  PyArrayObject *nodeStarOffsets;
1294  PyArrayObject *elementMaterialTypes;
1295  PyArrayObject *elementBoundaryMaterialTypes;
1296  PyArrayObject *nodeMaterialTypes;
1297  PyArrayObject *nodeArray;
1298  int nx;
1299  int ny;
1300  int nz;
1301  int px;
1302  int py;
1303  int pz;
1304  PyArrayObject *elementIJK;
1305  PyArrayObject *weights;
1306  PyArrayObject *U_KNOT;
1307  PyArrayObject *V_KNOT;
1308  PyArrayObject *W_KNOT;
1309  PyArrayObject *elementDiametersArray;
1310  PyArrayObject *elementInnerDiametersArray;
1311  PyArrayObject *elementBoundaryDiametersArray;
1312  PyArrayObject *elementBarycentersArray;
1313  PyArrayObject *elementBoundaryBarycentersArray;
1314  PyArrayObject *nodeDiametersArray;
1315  PyArrayObject *nodeSupportArray;
1316  double h;
1317  double hMin;
1318  double sigmaMax;
1319  double volume;
1320 };
1321 
1322 
1323 /* "MeshAdaptPUMI/MeshAdapt.pyx":56
1324  * void set_nAdapt(int)
1325  *
1326  * cdef class MeshAdapt: # <<<<<<<<<<<<<<
1327  * cdef MeshAdaptPUMIDrvr *thisptr
1328  * cdef double hmax, hmin, hPhi
1329  */
1330 struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt {
1331  PyObject_HEAD
1332  MeshAdaptPUMIDrvr *thisptr;
1333  double hmax;
1334  double hmin;
1335  double hPhi;
1336  int numIter;
1337  int numAdaptSteps;
1338  int isReconstructed;
1339  int adaptMesh;
1340 };
1341 
1342 
1343 /* --- Runtime support code (head) --- */
1344 /* Refnanny.proto */
1345 #ifndef CYTHON_REFNANNY
1346  #define CYTHON_REFNANNY 0
1347 #endif
1348 #if CYTHON_REFNANNY
1349  typedef struct {
1350  void (*INCREF)(void*, PyObject*, int);
1351  void (*DECREF)(void*, PyObject*, int);
1352  void (*GOTREF)(void*, PyObject*, int);
1353  void (*GIVEREF)(void*, PyObject*, int);
1354  void* (*SetupContext)(const char*, int, const char*);
1355  void (*FinishContext)(void**);
1356  } __Pyx_RefNannyAPIStruct;
1357  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1358  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1359  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1360 #ifdef WITH_THREAD
1361  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1362  if (acquire_gil) {\
1363  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1364  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1365  PyGILState_Release(__pyx_gilstate_save);\
1366  } else {\
1367  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1368  }
1369 #else
1370  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1371  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1372 #endif
1373  #define __Pyx_RefNannyFinishContext()\
1374  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1375  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1376  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1377  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1378  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1379  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1380  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1381  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1382  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1383 #else
1384  #define __Pyx_RefNannyDeclarations
1385  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1386  #define __Pyx_RefNannyFinishContext()
1387  #define __Pyx_INCREF(r) Py_INCREF(r)
1388  #define __Pyx_DECREF(r) Py_DECREF(r)
1389  #define __Pyx_GOTREF(r)
1390  #define __Pyx_GIVEREF(r)
1391  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1392  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1393  #define __Pyx_XGOTREF(r)
1394  #define __Pyx_XGIVEREF(r)
1395 #endif
1396 #define __Pyx_XDECREF_SET(r, v) do {\
1397  PyObject *tmp = (PyObject *) r;\
1398  r = v; __Pyx_XDECREF(tmp);\
1399  } while (0)
1400 #define __Pyx_DECREF_SET(r, v) do {\
1401  PyObject *tmp = (PyObject *) r;\
1402  r = v; __Pyx_DECREF(tmp);\
1403  } while (0)
1404 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1405 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1406 
1407 /* PyObjectGetAttrStr.proto */
1408 #if CYTHON_USE_TYPE_SLOTS
1409 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1410 #else
1411 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1412 #endif
1413 
1414 /* GetBuiltinName.proto */
1415 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1416 
1417 /* RaiseArgTupleInvalid.proto */
1418 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1419  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1420 
1421 /* KeywordStringCheck.proto */
1422 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1423 
1424 /* RaiseDoubleKeywords.proto */
1425 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1426 
1427 /* ParseKeywords.proto */
1428 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1429  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1430  const char* function_name);
1431 
1432 /* ArgTypeTest.proto */
1433 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1434  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1435  __Pyx__ArgTypeTest(obj, type, name, exact))
1436 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1437 
1438 /* IsLittleEndian.proto */
1439 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
1440 
1441 /* BufferFormatCheck.proto */
1442 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
1443 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1444  __Pyx_BufFmt_StackElem* stack,
1445  __Pyx_TypeInfo* type);
1446 
1447 /* BufferGetAndValidate.proto */
1448 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
1449  ((obj == Py_None || obj == NULL) ?\
1450  (__Pyx_ZeroBuffer(buf), 0) :\
1451  __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
1452 static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1453  __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
1454 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1455 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1456 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1457 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1458 
1459 /* PyDictVersioning.proto */
1460 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1461 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1462 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1463 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1464  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1465  (cache_var) = (value);
1466 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1467  static PY_UINT64_T __pyx_dict_version = 0;\
1468  static PyObject *__pyx_dict_cached_value = NULL;\
1469  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1470  (VAR) = __pyx_dict_cached_value;\
1471  } else {\
1472  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1473  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1474  }\
1475 }
1476 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1477 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1478 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1479 #else
1480 #define __PYX_GET_DICT_VERSION(dict) (0)
1481 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1482 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1483 #endif
1484 
1485 /* GetModuleGlobalName.proto */
1486 #if CYTHON_USE_DICT_VERSIONS
1487 #define __Pyx_GetModuleGlobalName(var, name) {\
1488  static PY_UINT64_T __pyx_dict_version = 0;\
1489  static PyObject *__pyx_dict_cached_value = NULL;\
1490  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1491  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1492  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1493 }
1494 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1495  PY_UINT64_T __pyx_dict_version;\
1496  PyObject *__pyx_dict_cached_value;\
1497  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1498 }
1499 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1500 #else
1501 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1502 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1503 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1504 #endif
1505 
1506 /* PyCFunctionFastCall.proto */
1507 #if CYTHON_FAST_PYCCALL
1508 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1509 #else
1510 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1511 #endif
1512 
1513 /* PyFunctionFastCall.proto */
1514 #if CYTHON_FAST_PYCALL
1515 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1516  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1517 #if 1 || PY_VERSION_HEX < 0x030600B1
1518 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1519 #else
1520 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1521 #endif
1522 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1523  (sizeof(char [1 - 2*!(cond)]) - 1)
1524 #ifndef Py_MEMBER_SIZE
1525 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1526 #endif
1527 #if CYTHON_FAST_PYCALL
1528  static size_t __pyx_pyframe_localsplus_offset = 0;
1529  #include "frameobject.h"
1530 #if PY_VERSION_HEX >= 0x030b00a6
1531  #ifndef Py_BUILD_CORE
1532  #define Py_BUILD_CORE 1
1533  #endif
1534  #include "internal/pycore_frame.h"
1535 #endif
1536  #define __Pxy_PyFrame_Initialize_Offsets()\
1537  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1538  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1539  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1540  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1541 #endif // CYTHON_FAST_PYCALL
1542 #endif
1543 
1544 /* PyObjectCall.proto */
1545 #if CYTHON_COMPILING_IN_CPYTHON
1546 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1547 #else
1548 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1549 #endif
1550 
1551 /* PyObjectCall2Args.proto */
1552 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1553 
1554 /* PyObjectCallMethO.proto */
1555 #if CYTHON_COMPILING_IN_CPYTHON
1556 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1557 #endif
1558 
1559 /* PyObjectCallOneArg.proto */
1560 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1561 
1562 /* ExtTypeTest.proto */
1563 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1564 
1565 /* BufferFallbackError.proto */
1566 static void __Pyx_RaiseBufferFallbackError(void);
1567 
1568 /* BufferIndexError.proto */
1569 static void __Pyx_RaiseBufferIndexError(int axis);
1570 
1571 #define __Pyx_BufPtrCContig1d(type, buf, i0, s0) ((type)buf + i0)
1572 /* PyThreadStateGet.proto */
1573 #if CYTHON_FAST_THREAD_STATE
1574 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1575 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1576 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1577 #else
1578 #define __Pyx_PyThreadState_declare
1579 #define __Pyx_PyThreadState_assign
1580 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1581 #endif
1582 
1583 /* PyErrFetchRestore.proto */
1584 #if CYTHON_FAST_THREAD_STATE
1585 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1586 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1587 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1588 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1589 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1590 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1591 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1592 #if CYTHON_COMPILING_IN_CPYTHON
1593 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1594 #else
1595 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1596 #endif
1597 #else
1598 #define __Pyx_PyErr_Clear() PyErr_Clear()
1599 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1600 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1601 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1602 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1603 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1604 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1605 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1606 #endif
1607 
1608 #define __Pyx_BufPtrCContig2d(type, buf, i0, s0, i1, s1) ((type)((char*)buf + i0 * s0) + i1)
1609 /* RaiseException.proto */
1610 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1611 
1612 /* PyObjectSetAttrStr.proto */
1613 #if CYTHON_USE_TYPE_SLOTS
1614 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1615 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1616 #else
1617 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1618 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1619 #endif
1620 
1621 /* GetTopmostException.proto */
1622 #if CYTHON_USE_EXC_INFO_STACK
1623 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1624 #endif
1625 
1626 /* SaveResetException.proto */
1627 #if CYTHON_FAST_THREAD_STATE
1628 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1629 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1630 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1631 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1632 #else
1633 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1634 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1635 #endif
1636 
1637 /* PyErrExceptionMatches.proto */
1638 #if CYTHON_FAST_THREAD_STATE
1639 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1640 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1641 #else
1642 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1643 #endif
1644 
1645 /* GetException.proto */
1646 #if CYTHON_FAST_THREAD_STATE
1647 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1648 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1649 #else
1650 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1651 #endif
1652 
1653 /* PyObject_GenericGetAttrNoDict.proto */
1654 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1655 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1656 #else
1657 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1658 #endif
1659 
1660 /* PyObject_GenericGetAttr.proto */
1661 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1662 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1663 #else
1664 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1665 #endif
1666 
1667 /* PyObjectGetAttrStrNoError.proto */
1668 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1669 
1670 /* SetupReduce.proto */
1671 static int __Pyx_setup_reduce(PyObject* type_obj);
1672 
1673 /* TypeImport.proto */
1674 #ifndef __PYX_HAVE_RT_ImportType_proto
1675 #define __PYX_HAVE_RT_ImportType_proto
1676 enum __Pyx_ImportType_CheckSize {
1677  __Pyx_ImportType_CheckSize_Error = 0,
1678  __Pyx_ImportType_CheckSize_Warn = 1,
1679  __Pyx_ImportType_CheckSize_Ignore = 2
1680 };
1681 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1682 #endif
1683 
1684 /* Import.proto */
1685 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1686 
1687 /* ImportFrom.proto */
1688 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1689 
1690 /* FetchCommonType.proto */
1691 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1692 
1693 /* CythonFunctionShared.proto */
1694 #define __Pyx_CyFunction_USED 1
1695 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1696 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1697 #define __Pyx_CYFUNCTION_CCLASS 0x04
1698 #define __Pyx_CyFunction_GetClosure(f)\
1699  (((__pyx_CyFunctionObject *) (f))->func_closure)
1700 #define __Pyx_CyFunction_GetClassObj(f)\
1701  (((__pyx_CyFunctionObject *) (f))->func_classobj)
1702 #define __Pyx_CyFunction_Defaults(type, f)\
1703  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1704 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1705  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1706 typedef struct {
1707  PyCFunctionObject func;
1708 #if PY_VERSION_HEX < 0x030500A0
1709  PyObject *func_weakreflist;
1710 #endif
1711  PyObject *func_dict;
1712  PyObject *func_name;
1713  PyObject *func_qualname;
1714  PyObject *func_doc;
1715  PyObject *func_globals;
1716  PyObject *func_code;
1717  PyObject *func_closure;
1718  PyObject *func_classobj;
1719  void *defaults;
1720  int defaults_pyobjects;
1721  size_t defaults_size; // used by FusedFunction for copying defaults
1722  int flags;
1723  PyObject *defaults_tuple;
1724  PyObject *defaults_kwdict;
1725  PyObject *(*defaults_getter)(PyObject *);
1726  PyObject *func_annotations;
1727 } __pyx_CyFunctionObject;
1728 static PyTypeObject *__pyx_CyFunctionType = 0;
1729 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
1730 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
1731  int flags, PyObject* qualname,
1732  PyObject *self,
1733  PyObject *module, PyObject *globals,
1734  PyObject* code);
1735 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1736  size_t size,
1737  int pyobjects);
1738 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1739  PyObject *tuple);
1740 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1741  PyObject *dict);
1742 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1743  PyObject *dict);
1744 static int __pyx_CyFunction_init(void);
1745 
1746 /* CythonFunction.proto */
1747 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
1748  int flags, PyObject* qualname,
1749  PyObject *closure,
1750  PyObject *module, PyObject *globals,
1751  PyObject* code);
1752 
1753 /* PyObjectCallNoArg.proto */
1754 #if CYTHON_COMPILING_IN_CPYTHON
1755 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1756 #else
1757 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1758 #endif
1759 
1760 /* SetNameInClass.proto */
1761 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1762 #define __Pyx_SetNameInClass(ns, name, value)\
1763  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1764 #elif CYTHON_COMPILING_IN_CPYTHON
1765 #define __Pyx_SetNameInClass(ns, name, value)\
1766  (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1767 #else
1768 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1769 #endif
1770 
1771 /* CalculateMetaclass.proto */
1772 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1773 
1774 /* Py3ClassCreate.proto */
1775 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
1776  PyObject *mkw, PyObject *modname, PyObject *doc);
1777 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
1778  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
1779 
1780 /* CLineInTraceback.proto */
1781 #ifdef CYTHON_CLINE_IN_TRACEBACK
1782 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1783 #else
1784 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1785 #endif
1786 
1787 /* CodeObjectCache.proto */
1788 typedef struct {
1789  PyCodeObject* code_object;
1790  int code_line;
1791 } __Pyx_CodeObjectCacheEntry;
1792 struct __Pyx_CodeObjectCache {
1793  int count;
1794  int max_count;
1795  __Pyx_CodeObjectCacheEntry* entries;
1796 };
1797 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1798 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1799 static PyCodeObject *__pyx_find_code_object(int code_line);
1800 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1801 
1802 /* AddTraceback.proto */
1803 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1804  int py_line, const char *filename);
1805 
1806 /* BufferStructDeclare.proto */
1807 typedef struct {
1808  Py_ssize_t shape, strides, suboffsets;
1809 } __Pyx_Buf_DimInfo;
1810 typedef struct {
1811  size_t refcount;
1812  Py_buffer pybuffer;
1813 } __Pyx_Buffer;
1814 typedef struct {
1815  __Pyx_Buffer *rcbuffer;
1816  char *data;
1817  __Pyx_Buf_DimInfo diminfo[8];
1818 } __Pyx_LocalBuf_ND;
1819 
1820 #if PY_MAJOR_VERSION < 3
1821  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
1822  static void __Pyx_ReleaseBuffer(Py_buffer *view);
1823 #else
1824  #define __Pyx_GetBuffer PyObject_GetBuffer
1825  #define __Pyx_ReleaseBuffer PyBuffer_Release
1826 #endif
1827 
1828 
1829 /* GCCDiagnostics.proto */
1830 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1831 #define __Pyx_HAS_GCC_DIAGNOSTIC
1832 #endif
1833 
1834 /* CppExceptionConversion.proto */
1835 #ifndef __Pyx_CppExn2PyErr
1836 #include <new>
1837 #include <typeinfo>
1838 #include <stdexcept>
1839 #include <ios>
1840 static void __Pyx_CppExn2PyErr() {
1841  try {
1842  if (PyErr_Occurred())
1843  ; // let the latest Python exn pass through and ignore the current one
1844  else
1845  throw;
1846  } catch (const std::bad_alloc& exn) {
1847  PyErr_SetString(PyExc_MemoryError, exn.what());
1848  } catch (const std::bad_cast& exn) {
1849  PyErr_SetString(PyExc_TypeError, exn.what());
1850  } catch (const std::bad_typeid& exn) {
1851  PyErr_SetString(PyExc_TypeError, exn.what());
1852  } catch (const std::domain_error& exn) {
1853  PyErr_SetString(PyExc_ValueError, exn.what());
1854  } catch (const std::invalid_argument& exn) {
1855  PyErr_SetString(PyExc_ValueError, exn.what());
1856  } catch (const std::ios_base::failure& exn) {
1857  PyErr_SetString(PyExc_IOError, exn.what());
1858  } catch (const std::out_of_range& exn) {
1859  PyErr_SetString(PyExc_IndexError, exn.what());
1860  } catch (const std::overflow_error& exn) {
1861  PyErr_SetString(PyExc_OverflowError, exn.what());
1862  } catch (const std::range_error& exn) {
1863  PyErr_SetString(PyExc_ArithmeticError, exn.what());
1864  } catch (const std::underflow_error& exn) {
1865  PyErr_SetString(PyExc_ArithmeticError, exn.what());
1866  } catch (const std::exception& exn) {
1867  PyErr_SetString(PyExc_RuntimeError, exn.what());
1868  }
1869  catch (...)
1870  {
1871  PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
1872  }
1873 }
1874 #endif
1875 
1876 /* RealImag.proto */
1877 #if CYTHON_CCOMPLEX
1878  #ifdef __cplusplus
1879  #define __Pyx_CREAL(z) ((z).real())
1880  #define __Pyx_CIMAG(z) ((z).imag())
1881  #else
1882  #define __Pyx_CREAL(z) (__real__(z))
1883  #define __Pyx_CIMAG(z) (__imag__(z))
1884  #endif
1885 #else
1886  #define __Pyx_CREAL(z) ((z).real)
1887  #define __Pyx_CIMAG(z) ((z).imag)
1888 #endif
1889 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1890  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1891  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1892  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1893 #else
1894  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1895  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1896 #endif
1897 
1898 /* Arithmetic.proto */
1899 #if CYTHON_CCOMPLEX
1900  #define __Pyx_c_eq_float(a, b) ((a)==(b))
1901  #define __Pyx_c_sum_float(a, b) ((a)+(b))
1902  #define __Pyx_c_diff_float(a, b) ((a)-(b))
1903  #define __Pyx_c_prod_float(a, b) ((a)*(b))
1904  #define __Pyx_c_quot_float(a, b) ((a)/(b))
1905  #define __Pyx_c_neg_float(a) (-(a))
1906  #ifdef __cplusplus
1907  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1908  #define __Pyx_c_conj_float(z) (::std::conj(z))
1909  #if 1
1910  #define __Pyx_c_abs_float(z) (::std::abs(z))
1911  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1912  #endif
1913  #else
1914  #define __Pyx_c_is_zero_float(z) ((z)==0)
1915  #define __Pyx_c_conj_float(z) (conjf(z))
1916  #if 1
1917  #define __Pyx_c_abs_float(z) (cabsf(z))
1918  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1919  #endif
1920  #endif
1921 #else
1922  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1923  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1924  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1925  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1926  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1927  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1928  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1929  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1930  #if 1
1931  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1932  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1933  #endif
1934 #endif
1935 
1936 /* Arithmetic.proto */
1937 #if CYTHON_CCOMPLEX
1938  #define __Pyx_c_eq_double(a, b) ((a)==(b))
1939  #define __Pyx_c_sum_double(a, b) ((a)+(b))
1940  #define __Pyx_c_diff_double(a, b) ((a)-(b))
1941  #define __Pyx_c_prod_double(a, b) ((a)*(b))
1942  #define __Pyx_c_quot_double(a, b) ((a)/(b))
1943  #define __Pyx_c_neg_double(a) (-(a))
1944  #ifdef __cplusplus
1945  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1946  #define __Pyx_c_conj_double(z) (::std::conj(z))
1947  #if 1
1948  #define __Pyx_c_abs_double(z) (::std::abs(z))
1949  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1950  #endif
1951  #else
1952  #define __Pyx_c_is_zero_double(z) ((z)==0)
1953  #define __Pyx_c_conj_double(z) (conj(z))
1954  #if 1
1955  #define __Pyx_c_abs_double(z) (cabs(z))
1956  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1957  #endif
1958  #endif
1959 #else
1960  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1961  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1962  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1963  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1964  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1965  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1966  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1967  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1968  #if 1
1969  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
1970  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1971  #endif
1972 #endif
1973 
1974 /* CIntToPy.proto */
1975 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1976 
1977 /* CIntFromPy.proto */
1978 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1979 
1980 /* CIntToPy.proto */
1981 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1982 
1983 /* CIntFromPy.proto */
1984 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1985 
1986 /* FastTypeChecks.proto */
1987 #if CYTHON_COMPILING_IN_CPYTHON
1988 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1989 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1990 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1991 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1992 #else
1993 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1994 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1995 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1996 #endif
1997 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1998 
1999 /* CheckBinaryVersion.proto */
2000 static int __Pyx_check_binary_version(void);
2001 
2002 /* InitStrings.proto */
2003 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2004 
2005 
2006 /* Module declarations from 'libc.string' */
2007 
2008 /* Module declarations from 'libc.stdio' */
2009 
2010 /* Module declarations from '__builtin__' */
2011 
2012 /* Module declarations from 'cpython.type' */
2013 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2014 
2015 /* Module declarations from 'cpython.buffer' */
2016 
2017 /* Module declarations from 'cpython' */
2018 
2019 /* Module declarations from 'cpython.object' */
2020 
2021 /* Module declarations from 'cpython.ref' */
2022 
2023 /* Module declarations from 'cpython.mem' */
2024 
2025 /* Module declarations from 'numpy' */
2026 
2027 /* Module declarations from 'numpy' */
2028 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2029 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2030 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2031 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2032 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2033 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2034 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2035 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2036 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2037 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2038 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2039 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2040 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2041 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2042 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2043 
2044 /* Module declarations from 'proteus' */
2045 
2046 /* Module declarations from 'libcpp' */
2047 
2048 /* Module declarations from 'proteus.mesh' */
2049 
2050 /* Module declarations from 'proteus.cmeshTools' */
2051 static PyTypeObject *__pyx_ptype_7proteus_10cmeshTools_CMesh = 0;
2052 
2053 /* Module declarations from 'libcpp.string' */
2054 
2055 /* Module declarations from 'libcpp.vector' */
2056 
2057 /* Module declarations from 'MeshAdaptPUMI.MeshAdapt' */
2058 static PyTypeObject *__pyx_ptype_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt = 0;
2059 static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
2060 static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
2061 static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/
2062 static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
2063 static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
2064 static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
2065 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "double_t", NULL, sizeof(__pyx_t_5numpy_double_t), { 0 }, 0, 'R', 0, 0 };
2066 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2067 #define __Pyx_MODULE_NAME "MeshAdaptPUMI.MeshAdapt"
2068 extern int __pyx_module_is_main_MeshAdaptPUMI__MeshAdapt;
2069 int __pyx_module_is_main_MeshAdaptPUMI__MeshAdapt = 0;
2070 
2071 /* Implementation of 'MeshAdaptPUMI.MeshAdapt' */
2072 static PyObject *__pyx_builtin_TypeError;
2073 static PyObject *__pyx_builtin_ImportError;
2074 static const char __pyx_k_[] = "";
2075 static const char __pyx_k_g[] = "g";
2076 static const char __pyx_k_np[] = "np";
2077 static const char __pyx_k_nu[] = "nu";
2078 static const char __pyx_k_dim[] = "dim";
2079 static const char __pyx_k_doc[] = "__doc__";
2080 static const char __pyx_k_rho[] = "rho";
2081 static const char __pyx_k_hmax[] = "hmax";
2082 static const char __pyx_k_hmin[] = "hmin";
2083 static const char __pyx_k_hphi[] = "hphi";
2084 static const char __pyx_k_init[] = "__init__";
2085 static const char __pyx_k_main[] = "__main__";
2086 static const char __pyx_k_name[] = "name";
2087 static const char __pyx_k_self[] = "self";
2088 static const char __pyx_k_test[] = "__test__";
2089 static const char __pyx_k_adapt[] = "adapt";
2090 static const char __pyx_k_cmesh[] = "cmesh";
2091 static const char __pyx_k_edges[] = "edges";
2092 static const char __pyx_k_faces[] = "faces";
2093 static const char __pyx_k_numpy[] = "numpy";
2094 static const char __pyx_k_val_0[] = "val_0";
2095 static const char __pyx_k_val_1[] = "val_1";
2096 static const char __pyx_k_bFaces[] = "bFaces";
2097 static const char __pyx_k_bdryId[] = "bdryId";
2098 static const char __pyx_k_boxDim[] = "boxDim";
2099 static const char __pyx_k_deltaT[] = "deltaT";
2100 static const char __pyx_k_import[] = "__import__";
2101 static const char __pyx_k_maType[] = "maType";
2102 static const char __pyx_k_module[] = "__module__";
2103 static const char __pyx_k_name_2[] = "__name__";
2104 static const char __pyx_k_reduce[] = "__reduce__";
2105 static const char __pyx_k_adapter[] = "adapter";
2106 static const char __pyx_k_geomTag[] = "geomTag";
2107 static const char __pyx_k_inArray[] = "inArray";
2108 static const char __pyx_k_logging[] = "logging";
2109 static const char __pyx_k_prepare[] = "__prepare__";
2110 static const char __pyx_k_geomName[] = "geomName";
2111 static const char __pyx_k_getstate[] = "__getstate__";
2112 static const char __pyx_k_hasModel[] = "hasModel";
2113 static const char __pyx_k_logEvent[] = "logEvent";
2114 static const char __pyx_k_meshName[] = "meshName";
2115 static const char __pyx_k_outArray[] = "outArray";
2116 static const char __pyx_k_qualname[] = "__qualname__";
2117 static const char __pyx_k_setstate[] = "__setstate__";
2118 static const char __pyx_k_MeshAdapt[] = "MeshAdapt";
2119 static const char __pyx_k_Profiling[] = "Profiling";
2120 static const char __pyx_k_TypeError[] = "TypeError";
2121 static const char __pyx_k_field_val[] = "field_val";
2122 static const char __pyx_k_metaclass[] = "__metaclass__";
2123 static const char __pyx_k_modelDict[] = "modelDict";
2124 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2125 static const char __pyx_k_sizeInputs[] = "sizeInputs";
2126 static const char __pyx_k_ImportError[] = "ImportError";
2127 static const char __pyx_k_PUMIAdapter[] = "PUMIAdapter";
2128 static const char __pyx_k_deltaT_next[] = "deltaT_next";
2129 static const char __pyx_k_inputString[] = "inputString";
2130 static const char __pyx_k_isModelVert[] = "isModelVert";
2131 static const char __pyx_k_targetError[] = "targetError";
2132 static const char __pyx_k_AdaptManager[] = "AdaptManager";
2133 static const char __pyx_k_T_simulation[] = "T_simulation";
2134 static const char __pyx_k_global_cmesh[] = "global_cmesh";
2135 static const char __pyx_k_sphereCenter[] = "sphereCenter";
2136 static const char __pyx_k_sphereRadius[] = "sphereRadius";
2137 static const char __pyx_k_gradingFactor[] = "gradingFactor";
2138 static const char __pyx_k_numAdaptSteps[] = "numAdaptSteps";
2139 static const char __pyx_k_numIterations[] = "numIterations";
2140 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2141 static const char __pyx_k_maxAspectRatio[] = "maxAspectRatio";
2142 static const char __pyx_k_meshEdge2Model[] = "meshEdge2Model";
2143 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2144 static const char __pyx_k_subdomain_cmesh[] = "subdomain_cmesh";
2145 static const char __pyx_k_meshVertex2Model[] = "meshVertex2Model";
2146 static const char __pyx_k_numModelEntities[] = "numModelEntities";
2147 static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
2148 static const char __pyx_k_interfaceBandSize[] = "interfaceBandSize";
2149 static const char __pyx_k_reconstructedFlag[] = "reconstructedFlag";
2150 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2151 static const char __pyx_k_meshBoundary2Model[] = "meshBoundary2Model";
2152 static const char __pyx_k_AdaptManager___init[] = "AdaptManager.__init__";
2153 static const char __pyx_k_MeshAdaptPUMI_MeshAdapt[] = "MeshAdaptPUMI.MeshAdapt";
2154 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2155 static const char __pyx_k_proteus_MeshAdaptPUMI_MeshAdapt[] = "proteus/MeshAdaptPUMI/MeshAdapt.pyx";
2156 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2157 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2158 static PyObject *__pyx_kp_s_;
2159 static PyObject *__pyx_n_s_AdaptManager;
2160 static PyObject *__pyx_n_s_AdaptManager___init;
2161 static PyObject *__pyx_n_s_ImportError;
2162 static PyObject *__pyx_n_s_MeshAdapt;
2163 static PyObject *__pyx_n_s_MeshAdaptPUMI_MeshAdapt;
2164 static PyObject *__pyx_n_s_PUMIAdapter;
2165 static PyObject *__pyx_n_s_Profiling;
2166 static PyObject *__pyx_n_s_T_simulation;
2167 static PyObject *__pyx_n_s_TypeError;
2168 static PyObject *__pyx_n_s_adapt;
2169 static PyObject *__pyx_n_s_adapter;
2170 static PyObject *__pyx_n_s_ascontiguousarray;
2171 static PyObject *__pyx_n_s_bFaces;
2172 static PyObject *__pyx_n_s_bdryId;
2173 static PyObject *__pyx_n_s_boxDim;
2174 static PyObject *__pyx_n_s_cline_in_traceback;
2175 static PyObject *__pyx_n_s_cmesh;
2176 static PyObject *__pyx_n_s_deltaT;
2177 static PyObject *__pyx_n_s_deltaT_next;
2178 static PyObject *__pyx_n_s_dim;
2179 static PyObject *__pyx_n_s_doc;
2180 static PyObject *__pyx_n_s_edges;
2181 static PyObject *__pyx_n_s_faces;
2182 static PyObject *__pyx_n_s_field_val;
2183 static PyObject *__pyx_n_s_g;
2184 static PyObject *__pyx_n_s_geomName;
2185 static PyObject *__pyx_n_s_geomTag;
2186 static PyObject *__pyx_n_s_getstate;
2187 static PyObject *__pyx_n_s_global_cmesh;
2188 static PyObject *__pyx_n_s_gradingFactor;
2189 static PyObject *__pyx_n_s_hasModel;
2190 static PyObject *__pyx_n_s_hmax;
2191 static PyObject *__pyx_n_s_hmin;
2192 static PyObject *__pyx_n_s_hphi;
2193 static PyObject *__pyx_n_s_import;
2194 static PyObject *__pyx_n_s_inArray;
2195 static PyObject *__pyx_n_s_init;
2196 static PyObject *__pyx_n_s_inputString;
2197 static PyObject *__pyx_n_s_interfaceBandSize;
2198 static PyObject *__pyx_n_s_isModelVert;
2199 static PyObject *__pyx_n_s_logEvent;
2200 static PyObject *__pyx_n_s_logging;
2201 static PyObject *__pyx_n_s_maType;
2202 static PyObject *__pyx_n_s_main;
2203 static PyObject *__pyx_n_s_maxAspectRatio;
2204 static PyObject *__pyx_n_s_meshBoundary2Model;
2205 static PyObject *__pyx_n_s_meshEdge2Model;
2206 static PyObject *__pyx_n_s_meshName;
2207 static PyObject *__pyx_n_s_meshVertex2Model;
2208 static PyObject *__pyx_n_s_metaclass;
2209 static PyObject *__pyx_n_s_modelDict;
2210 static PyObject *__pyx_n_s_module;
2211 static PyObject *__pyx_n_s_name;
2212 static PyObject *__pyx_n_s_name_2;
2213 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2214 static PyObject *__pyx_n_s_np;
2215 static PyObject *__pyx_n_s_nu;
2216 static PyObject *__pyx_n_s_numAdaptSteps;
2217 static PyObject *__pyx_n_s_numIterations;
2218 static PyObject *__pyx_n_s_numModelEntities;
2219 static PyObject *__pyx_n_s_numpy;
2220 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2221 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2222 static PyObject *__pyx_n_s_outArray;
2223 static PyObject *__pyx_n_s_prepare;
2224 static PyObject *__pyx_kp_s_proteus_MeshAdaptPUMI_MeshAdapt;
2225 static PyObject *__pyx_n_s_qualname;
2226 static PyObject *__pyx_n_s_reconstructedFlag;
2227 static PyObject *__pyx_n_s_reduce;
2228 static PyObject *__pyx_n_s_reduce_cython;
2229 static PyObject *__pyx_n_s_reduce_ex;
2230 static PyObject *__pyx_n_s_rho;
2231 static PyObject *__pyx_n_s_self;
2232 static PyObject *__pyx_n_s_setstate;
2233 static PyObject *__pyx_n_s_setstate_cython;
2234 static PyObject *__pyx_n_s_sizeInputs;
2235 static PyObject *__pyx_n_s_sphereCenter;
2236 static PyObject *__pyx_n_s_sphereRadius;
2237 static PyObject *__pyx_n_s_subdomain_cmesh;
2238 static PyObject *__pyx_n_s_targetError;
2239 static PyObject *__pyx_n_s_test;
2240 static PyObject *__pyx_n_s_val_0;
2241 static PyObject *__pyx_n_s_val_1;
2242 static int __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt___cinit__(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2243 static void __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_2__dealloc__(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2244 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_4size_field_config(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2245 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_6adapt_type_config(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2246 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_8numIter(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2247 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_10adaptMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2248 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_12numAdaptSteps(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2249 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_14nAdapt(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2250 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_16set_nAdapt(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_numberAdapt); /* proto */
2251 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_18isReconstructed(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2252 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_20loadModelAndMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_geomName, PyObject *__pyx_v_meshName); /* proto */
2253 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_22loadMeshForAnalytic(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_meshName, PyArrayObject *__pyx_v_boxDim, PyArrayObject *__pyx_v_sphereCenter, double __pyx_v_sphereRadius); /* proto */
2254 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_24updateSphereCoordinates(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyArrayObject *__pyx_v_sphereCenter); /* proto */
2255 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_26reconstructFromProteus(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_global_cmesh, PyObject *__pyx_v_hasModel); /* proto */
2256 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_28reconstructFromProteus2(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, PyArrayObject *__pyx_v_isModelVert, PyArrayObject *__pyx_v_bFaces); /* proto */
2257 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_30constructFromSerialPUMIMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh); /* proto */
2258 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_32constructFromParallelPUMIMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
2259 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_34updateMaterialArrays(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, PyObject *__pyx_v_dim, PyObject *__pyx_v_bdryId, PyObject *__pyx_v_geomTag); /* proto */
2260 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_36updateMaterialArrays2(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh); /* proto */
2261 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_38transferFieldToPUMI(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_name, PyArrayObject *__pyx_v_inArray); /* proto */
2262 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_40transferFieldToProteus(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_name, PyArrayObject *__pyx_v_outArray); /* proto */
2263 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_42transferElementFieldToProteus(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_name, PyArrayObject *__pyx_v_outArray); /* proto */
2264 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_44transferPropertiesToPUMI(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyArrayObject *__pyx_v_rho, PyArrayObject *__pyx_v_nu, PyArrayObject *__pyx_v_g, double __pyx_v_deltaT, double __pyx_v_deltaT_next, double __pyx_v_T_simulation, double __pyx_v_interfaceBandSize); /* proto */
2265 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_46setAdaptProperties(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_manager); /* proto */
2266 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_48transferModelInfo(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyArrayObject *__pyx_v_numModelEntities, PyArrayObject *__pyx_v_edges, PyArrayObject *__pyx_v_faces, PyArrayObject *__pyx_v_meshVertex2Model, PyArrayObject *__pyx_v_meshEdge2Model, PyArrayObject *__pyx_v_meshBoundary2Model); /* proto */
2267 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_50adaptPUMIMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_inputString); /* proto */
2268 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_52dumpMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh); /* proto */
2269 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_54getERMSizeField(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_err_total); /* proto */
2270 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_56getMPvalue(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_field_val, PyObject *__pyx_v_val_0, PyObject *__pyx_v_val_1); /* proto */
2271 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_58willAdapt(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2272 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_60willInterfaceAdapt(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2273 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_62get_local_error(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2274 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_64get_VMS_error(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2275 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_66getMinimumQuality(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2276 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_68writeMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_meshName); /* proto */
2277 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_70cleanMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2278 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_72__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self); /* proto */
2279 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_74__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2280 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt___defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
2281 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_12AdaptManager___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_adapter); /* proto */
2282 static PyObject *__pyx_tp_new_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2283 static PyObject *__pyx_float_1_5;
2284 static PyObject *__pyx_float_1eneg_2;
2285 static PyObject *__pyx_float_1eneg_8;
2286 static PyObject *__pyx_float_100_0;
2287 static PyObject *__pyx_int_0;
2288 static PyObject *__pyx_int_2;
2289 static PyObject *__pyx_int_5;
2290 static PyObject *__pyx_int_10;
2291 static PyObject *__pyx_tuple__2;
2292 static PyObject *__pyx_tuple__3;
2293 static PyObject *__pyx_tuple__4;
2294 static PyObject *__pyx_tuple__5;
2295 static PyObject *__pyx_tuple__6;
2296 static PyObject *__pyx_codeobj__7;
2297 /* Late includes */
2298 
2299 /* "MeshAdaptPUMI/MeshAdapt.pyx":62
2300  * cdef int isReconstructed
2301  * cdef int adaptMesh
2302  * def __cinit__(self): # <<<<<<<<<<<<<<
2303  * self.thisptr = new MeshAdaptPUMIDrvr()
2304  * def __dealloc__(self):
2305  */
2306 
2307 /* Python wrapper */
2308 static int __pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2309 static int __pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2310  int __pyx_r;
2311  __Pyx_RefNannyDeclarations
2312  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2313  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
2314  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
2315  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
2316  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt___cinit__(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
2317 
2318  /* function exit code */
2319  __Pyx_RefNannyFinishContext();
2320  return __pyx_r;
2321 }
2322 
2323 static int __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt___cinit__(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
2324  int __pyx_r;
2325  __Pyx_RefNannyDeclarations
2326  __Pyx_RefNannySetupContext("__cinit__", 0);
2327 
2328  /* "MeshAdaptPUMI/MeshAdapt.pyx":63
2329  * cdef int adaptMesh
2330  * def __cinit__(self):
2331  * self.thisptr = new MeshAdaptPUMIDrvr() # <<<<<<<<<<<<<<
2332  * def __dealloc__(self):
2333  * del self.thisptr
2334  */
2335  __pyx_v_self->thisptr = new MeshAdaptPUMIDrvr();
2336 
2337  /* "MeshAdaptPUMI/MeshAdapt.pyx":62
2338  * cdef int isReconstructed
2339  * cdef int adaptMesh
2340  * def __cinit__(self): # <<<<<<<<<<<<<<
2341  * self.thisptr = new MeshAdaptPUMIDrvr()
2342  * def __dealloc__(self):
2343  */
2344 
2345  /* function exit code */
2346  __pyx_r = 0;
2347  __Pyx_RefNannyFinishContext();
2348  return __pyx_r;
2349 }
2350 
2351 /* "MeshAdaptPUMI/MeshAdapt.pyx":64
2352  * def __cinit__(self):
2353  * self.thisptr = new MeshAdaptPUMIDrvr()
2354  * def __dealloc__(self): # <<<<<<<<<<<<<<
2355  * del self.thisptr
2356  * def size_field_config(self):
2357  */
2358 
2359 /* Python wrapper */
2360 static void __pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
2361 static void __pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_3__dealloc__(PyObject *__pyx_v_self) {
2362  __Pyx_RefNannyDeclarations
2363  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
2364  __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_2__dealloc__(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
2365 
2366  /* function exit code */
2367  __Pyx_RefNannyFinishContext();
2368 }
2369 
2370 static void __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_2__dealloc__(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
2371  __Pyx_RefNannyDeclarations
2372  __Pyx_RefNannySetupContext("__dealloc__", 0);
2373 
2374  /* "MeshAdaptPUMI/MeshAdapt.pyx":65
2375  * self.thisptr = new MeshAdaptPUMIDrvr()
2376  * def __dealloc__(self):
2377  * del self.thisptr # <<<<<<<<<<<<<<
2378  * def size_field_config(self):
2379  * return self.thisptr.size_field_config
2380  */
2381  delete __pyx_v_self->thisptr;
2382 
2383  /* "MeshAdaptPUMI/MeshAdapt.pyx":64
2384  * def __cinit__(self):
2385  * self.thisptr = new MeshAdaptPUMIDrvr()
2386  * def __dealloc__(self): # <<<<<<<<<<<<<<
2387  * del self.thisptr
2388  * def size_field_config(self):
2389  */
2390 
2391  /* function exit code */
2392  __Pyx_RefNannyFinishContext();
2393 }
2394 
2395 /* "MeshAdaptPUMI/MeshAdapt.pyx":66
2396  * def __dealloc__(self):
2397  * del self.thisptr
2398  * def size_field_config(self): # <<<<<<<<<<<<<<
2399  * return self.thisptr.size_field_config
2400  * def adapt_type_config(self):
2401  */
2402 
2403 /* Python wrapper */
2404 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_5size_field_config(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2405 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_5size_field_config(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2406  PyObject *__pyx_r = 0;
2407  __Pyx_RefNannyDeclarations
2408  __Pyx_RefNannySetupContext("size_field_config (wrapper)", 0);
2409  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_4size_field_config(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
2410 
2411  /* function exit code */
2412  __Pyx_RefNannyFinishContext();
2413  return __pyx_r;
2414 }
2415 
2416 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_4size_field_config(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
2417  PyObject *__pyx_r = NULL;
2418  __Pyx_RefNannyDeclarations
2419  PyObject *__pyx_t_1 = NULL;
2420  int __pyx_lineno = 0;
2421  const char *__pyx_filename = NULL;
2422  int __pyx_clineno = 0;
2423  __Pyx_RefNannySetupContext("size_field_config", 0);
2424 
2425  /* "MeshAdaptPUMI/MeshAdapt.pyx":67
2426  * del self.thisptr
2427  * def size_field_config(self):
2428  * return self.thisptr.size_field_config # <<<<<<<<<<<<<<
2429  * def adapt_type_config(self):
2430  * return self.thisptr.adapt_type_config
2431  */
2432  __Pyx_XDECREF(__pyx_r);
2433  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->thisptr->size_field_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error)
2434  __Pyx_GOTREF(__pyx_t_1);
2435  __pyx_r = __pyx_t_1;
2436  __pyx_t_1 = 0;
2437  goto __pyx_L0;
2438 
2439  /* "MeshAdaptPUMI/MeshAdapt.pyx":66
2440  * def __dealloc__(self):
2441  * del self.thisptr
2442  * def size_field_config(self): # <<<<<<<<<<<<<<
2443  * return self.thisptr.size_field_config
2444  * def adapt_type_config(self):
2445  */
2446 
2447  /* function exit code */
2448  __pyx_L1_error:;
2449  __Pyx_XDECREF(__pyx_t_1);
2450  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.size_field_config", __pyx_clineno, __pyx_lineno, __pyx_filename);
2451  __pyx_r = NULL;
2452  __pyx_L0:;
2453  __Pyx_XGIVEREF(__pyx_r);
2454  __Pyx_RefNannyFinishContext();
2455  return __pyx_r;
2456 }
2457 
2458 /* "MeshAdaptPUMI/MeshAdapt.pyx":68
2459  * def size_field_config(self):
2460  * return self.thisptr.size_field_config
2461  * def adapt_type_config(self): # <<<<<<<<<<<<<<
2462  * return self.thisptr.adapt_type_config
2463  * def numIter(self):
2464  */
2465 
2466 /* Python wrapper */
2467 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_7adapt_type_config(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2468 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_7adapt_type_config(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2469  PyObject *__pyx_r = 0;
2470  __Pyx_RefNannyDeclarations
2471  __Pyx_RefNannySetupContext("adapt_type_config (wrapper)", 0);
2472  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_6adapt_type_config(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
2473 
2474  /* function exit code */
2475  __Pyx_RefNannyFinishContext();
2476  return __pyx_r;
2477 }
2478 
2479 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_6adapt_type_config(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
2480  PyObject *__pyx_r = NULL;
2481  __Pyx_RefNannyDeclarations
2482  PyObject *__pyx_t_1 = NULL;
2483  int __pyx_lineno = 0;
2484  const char *__pyx_filename = NULL;
2485  int __pyx_clineno = 0;
2486  __Pyx_RefNannySetupContext("adapt_type_config", 0);
2487 
2488  /* "MeshAdaptPUMI/MeshAdapt.pyx":69
2489  * return self.thisptr.size_field_config
2490  * def adapt_type_config(self):
2491  * return self.thisptr.adapt_type_config # <<<<<<<<<<<<<<
2492  * def numIter(self):
2493  * return self.thisptr.numIter
2494  */
2495  __Pyx_XDECREF(__pyx_r);
2496  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->thisptr->adapt_type_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error)
2497  __Pyx_GOTREF(__pyx_t_1);
2498  __pyx_r = __pyx_t_1;
2499  __pyx_t_1 = 0;
2500  goto __pyx_L0;
2501 
2502  /* "MeshAdaptPUMI/MeshAdapt.pyx":68
2503  * def size_field_config(self):
2504  * return self.thisptr.size_field_config
2505  * def adapt_type_config(self): # <<<<<<<<<<<<<<
2506  * return self.thisptr.adapt_type_config
2507  * def numIter(self):
2508  */
2509 
2510  /* function exit code */
2511  __pyx_L1_error:;
2512  __Pyx_XDECREF(__pyx_t_1);
2513  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.adapt_type_config", __pyx_clineno, __pyx_lineno, __pyx_filename);
2514  __pyx_r = NULL;
2515  __pyx_L0:;
2516  __Pyx_XGIVEREF(__pyx_r);
2517  __Pyx_RefNannyFinishContext();
2518  return __pyx_r;
2519 }
2520 
2521 /* "MeshAdaptPUMI/MeshAdapt.pyx":70
2522  * def adapt_type_config(self):
2523  * return self.thisptr.adapt_type_config
2524  * def numIter(self): # <<<<<<<<<<<<<<
2525  * return self.thisptr.numIter
2526  * def adaptMesh(self):
2527  */
2528 
2529 /* Python wrapper */
2530 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_9numIter(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2531 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_9numIter(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2532  PyObject *__pyx_r = 0;
2533  __Pyx_RefNannyDeclarations
2534  __Pyx_RefNannySetupContext("numIter (wrapper)", 0);
2535  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_8numIter(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
2536 
2537  /* function exit code */
2538  __Pyx_RefNannyFinishContext();
2539  return __pyx_r;
2540 }
2541 
2542 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_8numIter(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
2543  PyObject *__pyx_r = NULL;
2544  __Pyx_RefNannyDeclarations
2545  PyObject *__pyx_t_1 = NULL;
2546  int __pyx_lineno = 0;
2547  const char *__pyx_filename = NULL;
2548  int __pyx_clineno = 0;
2549  __Pyx_RefNannySetupContext("numIter", 0);
2550 
2551  /* "MeshAdaptPUMI/MeshAdapt.pyx":71
2552  * return self.thisptr.adapt_type_config
2553  * def numIter(self):
2554  * return self.thisptr.numIter # <<<<<<<<<<<<<<
2555  * def adaptMesh(self):
2556  * return self.thisptr.adaptMesh
2557  */
2558  __Pyx_XDECREF(__pyx_r);
2559  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->numIter); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error)
2560  __Pyx_GOTREF(__pyx_t_1);
2561  __pyx_r = __pyx_t_1;
2562  __pyx_t_1 = 0;
2563  goto __pyx_L0;
2564 
2565  /* "MeshAdaptPUMI/MeshAdapt.pyx":70
2566  * def adapt_type_config(self):
2567  * return self.thisptr.adapt_type_config
2568  * def numIter(self): # <<<<<<<<<<<<<<
2569  * return self.thisptr.numIter
2570  * def adaptMesh(self):
2571  */
2572 
2573  /* function exit code */
2574  __pyx_L1_error:;
2575  __Pyx_XDECREF(__pyx_t_1);
2576  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.numIter", __pyx_clineno, __pyx_lineno, __pyx_filename);
2577  __pyx_r = NULL;
2578  __pyx_L0:;
2579  __Pyx_XGIVEREF(__pyx_r);
2580  __Pyx_RefNannyFinishContext();
2581  return __pyx_r;
2582 }
2583 
2584 /* "MeshAdaptPUMI/MeshAdapt.pyx":72
2585  * def numIter(self):
2586  * return self.thisptr.numIter
2587  * def adaptMesh(self): # <<<<<<<<<<<<<<
2588  * return self.thisptr.adaptMesh
2589  * def numAdaptSteps(self):
2590  */
2591 
2592 /* Python wrapper */
2593 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_11adaptMesh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2594 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_11adaptMesh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2595  PyObject *__pyx_r = 0;
2596  __Pyx_RefNannyDeclarations
2597  __Pyx_RefNannySetupContext("adaptMesh (wrapper)", 0);
2598  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_10adaptMesh(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
2599 
2600  /* function exit code */
2601  __Pyx_RefNannyFinishContext();
2602  return __pyx_r;
2603 }
2604 
2605 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_10adaptMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
2606  PyObject *__pyx_r = NULL;
2607  __Pyx_RefNannyDeclarations
2608  PyObject *__pyx_t_1 = NULL;
2609  int __pyx_lineno = 0;
2610  const char *__pyx_filename = NULL;
2611  int __pyx_clineno = 0;
2612  __Pyx_RefNannySetupContext("adaptMesh", 0);
2613 
2614  /* "MeshAdaptPUMI/MeshAdapt.pyx":73
2615  * return self.thisptr.numIter
2616  * def adaptMesh(self):
2617  * return self.thisptr.adaptMesh # <<<<<<<<<<<<<<
2618  * def numAdaptSteps(self):
2619  * return self.thisptr.numAdaptSteps
2620  */
2621  __Pyx_XDECREF(__pyx_r);
2622  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->adaptMesh); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
2623  __Pyx_GOTREF(__pyx_t_1);
2624  __pyx_r = __pyx_t_1;
2625  __pyx_t_1 = 0;
2626  goto __pyx_L0;
2627 
2628  /* "MeshAdaptPUMI/MeshAdapt.pyx":72
2629  * def numIter(self):
2630  * return self.thisptr.numIter
2631  * def adaptMesh(self): # <<<<<<<<<<<<<<
2632  * return self.thisptr.adaptMesh
2633  * def numAdaptSteps(self):
2634  */
2635 
2636  /* function exit code */
2637  __pyx_L1_error:;
2638  __Pyx_XDECREF(__pyx_t_1);
2639  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.adaptMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
2640  __pyx_r = NULL;
2641  __pyx_L0:;
2642  __Pyx_XGIVEREF(__pyx_r);
2643  __Pyx_RefNannyFinishContext();
2644  return __pyx_r;
2645 }
2646 
2647 /* "MeshAdaptPUMI/MeshAdapt.pyx":74
2648  * def adaptMesh(self):
2649  * return self.thisptr.adaptMesh
2650  * def numAdaptSteps(self): # <<<<<<<<<<<<<<
2651  * return self.thisptr.numAdaptSteps
2652  * def nAdapt(self):
2653  */
2654 
2655 /* Python wrapper */
2656 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_13numAdaptSteps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2657 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_13numAdaptSteps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2658  PyObject *__pyx_r = 0;
2659  __Pyx_RefNannyDeclarations
2660  __Pyx_RefNannySetupContext("numAdaptSteps (wrapper)", 0);
2661  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_12numAdaptSteps(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
2662 
2663  /* function exit code */
2664  __Pyx_RefNannyFinishContext();
2665  return __pyx_r;
2666 }
2667 
2668 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_12numAdaptSteps(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
2669  PyObject *__pyx_r = NULL;
2670  __Pyx_RefNannyDeclarations
2671  PyObject *__pyx_t_1 = NULL;
2672  int __pyx_lineno = 0;
2673  const char *__pyx_filename = NULL;
2674  int __pyx_clineno = 0;
2675  __Pyx_RefNannySetupContext("numAdaptSteps", 0);
2676 
2677  /* "MeshAdaptPUMI/MeshAdapt.pyx":75
2678  * return self.thisptr.adaptMesh
2679  * def numAdaptSteps(self):
2680  * return self.thisptr.numAdaptSteps # <<<<<<<<<<<<<<
2681  * def nAdapt(self):
2682  * return self.thisptr.nAdapt
2683  */
2684  __Pyx_XDECREF(__pyx_r);
2685  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->numAdaptSteps); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 75, __pyx_L1_error)
2686  __Pyx_GOTREF(__pyx_t_1);
2687  __pyx_r = __pyx_t_1;
2688  __pyx_t_1 = 0;
2689  goto __pyx_L0;
2690 
2691  /* "MeshAdaptPUMI/MeshAdapt.pyx":74
2692  * def adaptMesh(self):
2693  * return self.thisptr.adaptMesh
2694  * def numAdaptSteps(self): # <<<<<<<<<<<<<<
2695  * return self.thisptr.numAdaptSteps
2696  * def nAdapt(self):
2697  */
2698 
2699  /* function exit code */
2700  __pyx_L1_error:;
2701  __Pyx_XDECREF(__pyx_t_1);
2702  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.numAdaptSteps", __pyx_clineno, __pyx_lineno, __pyx_filename);
2703  __pyx_r = NULL;
2704  __pyx_L0:;
2705  __Pyx_XGIVEREF(__pyx_r);
2706  __Pyx_RefNannyFinishContext();
2707  return __pyx_r;
2708 }
2709 
2710 /* "MeshAdaptPUMI/MeshAdapt.pyx":76
2711  * def numAdaptSteps(self):
2712  * return self.thisptr.numAdaptSteps
2713  * def nAdapt(self): # <<<<<<<<<<<<<<
2714  * return self.thisptr.nAdapt
2715  * def set_nAdapt(self,numberAdapt):
2716  */
2717 
2718 /* Python wrapper */
2719 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_15nAdapt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2720 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_15nAdapt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2721  PyObject *__pyx_r = 0;
2722  __Pyx_RefNannyDeclarations
2723  __Pyx_RefNannySetupContext("nAdapt (wrapper)", 0);
2724  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_14nAdapt(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
2725 
2726  /* function exit code */
2727  __Pyx_RefNannyFinishContext();
2728  return __pyx_r;
2729 }
2730 
2731 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_14nAdapt(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
2732  PyObject *__pyx_r = NULL;
2733  __Pyx_RefNannyDeclarations
2734  PyObject *__pyx_t_1 = NULL;
2735  int __pyx_lineno = 0;
2736  const char *__pyx_filename = NULL;
2737  int __pyx_clineno = 0;
2738  __Pyx_RefNannySetupContext("nAdapt", 0);
2739 
2740  /* "MeshAdaptPUMI/MeshAdapt.pyx":77
2741  * return self.thisptr.numAdaptSteps
2742  * def nAdapt(self):
2743  * return self.thisptr.nAdapt # <<<<<<<<<<<<<<
2744  * def set_nAdapt(self,numberAdapt):
2745  * return self.thisptr.set_nAdapt(numberAdapt)
2746  */
2747  __Pyx_XDECREF(__pyx_r);
2748  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->nAdapt); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 77, __pyx_L1_error)
2749  __Pyx_GOTREF(__pyx_t_1);
2750  __pyx_r = __pyx_t_1;
2751  __pyx_t_1 = 0;
2752  goto __pyx_L0;
2753 
2754  /* "MeshAdaptPUMI/MeshAdapt.pyx":76
2755  * def numAdaptSteps(self):
2756  * return self.thisptr.numAdaptSteps
2757  * def nAdapt(self): # <<<<<<<<<<<<<<
2758  * return self.thisptr.nAdapt
2759  * def set_nAdapt(self,numberAdapt):
2760  */
2761 
2762  /* function exit code */
2763  __pyx_L1_error:;
2764  __Pyx_XDECREF(__pyx_t_1);
2765  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.nAdapt", __pyx_clineno, __pyx_lineno, __pyx_filename);
2766  __pyx_r = NULL;
2767  __pyx_L0:;
2768  __Pyx_XGIVEREF(__pyx_r);
2769  __Pyx_RefNannyFinishContext();
2770  return __pyx_r;
2771 }
2772 
2773 /* "MeshAdaptPUMI/MeshAdapt.pyx":78
2774  * def nAdapt(self):
2775  * return self.thisptr.nAdapt
2776  * def set_nAdapt(self,numberAdapt): # <<<<<<<<<<<<<<
2777  * return self.thisptr.set_nAdapt(numberAdapt)
2778  * def isReconstructed(self):
2779  */
2780 
2781 /* Python wrapper */
2782 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_17set_nAdapt(PyObject *__pyx_v_self, PyObject *__pyx_v_numberAdapt); /*proto*/
2783 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_17set_nAdapt(PyObject *__pyx_v_self, PyObject *__pyx_v_numberAdapt) {
2784  PyObject *__pyx_r = 0;
2785  __Pyx_RefNannyDeclarations
2786  __Pyx_RefNannySetupContext("set_nAdapt (wrapper)", 0);
2787  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_16set_nAdapt(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), ((PyObject *)__pyx_v_numberAdapt));
2788 
2789  /* function exit code */
2790  __Pyx_RefNannyFinishContext();
2791  return __pyx_r;
2792 }
2793 
2794 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_16set_nAdapt(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_numberAdapt) {
2795  PyObject *__pyx_r = NULL;
2796  __Pyx_RefNannyDeclarations
2797  int __pyx_t_1;
2798  PyObject *__pyx_t_2 = NULL;
2799  int __pyx_lineno = 0;
2800  const char *__pyx_filename = NULL;
2801  int __pyx_clineno = 0;
2802  __Pyx_RefNannySetupContext("set_nAdapt", 0);
2803 
2804  /* "MeshAdaptPUMI/MeshAdapt.pyx":79
2805  * return self.thisptr.nAdapt
2806  * def set_nAdapt(self,numberAdapt):
2807  * return self.thisptr.set_nAdapt(numberAdapt) # <<<<<<<<<<<<<<
2808  * def isReconstructed(self):
2809  * return self.thisptr.isReconstructed
2810  */
2811  __Pyx_XDECREF(__pyx_r);
2812  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_numberAdapt); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L1_error)
2813  __pyx_t_2 = __Pyx_void_to_None(__pyx_v_self->thisptr->set_nAdapt(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __pyx_L1_error)
2814  __Pyx_GOTREF(__pyx_t_2);
2815  __pyx_r = __pyx_t_2;
2816  __pyx_t_2 = 0;
2817  goto __pyx_L0;
2818 
2819  /* "MeshAdaptPUMI/MeshAdapt.pyx":78
2820  * def nAdapt(self):
2821  * return self.thisptr.nAdapt
2822  * def set_nAdapt(self,numberAdapt): # <<<<<<<<<<<<<<
2823  * return self.thisptr.set_nAdapt(numberAdapt)
2824  * def isReconstructed(self):
2825  */
2826 
2827  /* function exit code */
2828  __pyx_L1_error:;
2829  __Pyx_XDECREF(__pyx_t_2);
2830  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.set_nAdapt", __pyx_clineno, __pyx_lineno, __pyx_filename);
2831  __pyx_r = NULL;
2832  __pyx_L0:;
2833  __Pyx_XGIVEREF(__pyx_r);
2834  __Pyx_RefNannyFinishContext();
2835  return __pyx_r;
2836 }
2837 
2838 /* "MeshAdaptPUMI/MeshAdapt.pyx":80
2839  * def set_nAdapt(self,numberAdapt):
2840  * return self.thisptr.set_nAdapt(numberAdapt)
2841  * def isReconstructed(self): # <<<<<<<<<<<<<<
2842  * return self.thisptr.isReconstructed
2843  * def loadModelAndMesh(self, geomName, meshName):
2844  */
2845 
2846 /* Python wrapper */
2847 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_19isReconstructed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2848 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_19isReconstructed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2849  PyObject *__pyx_r = 0;
2850  __Pyx_RefNannyDeclarations
2851  __Pyx_RefNannySetupContext("isReconstructed (wrapper)", 0);
2852  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_18isReconstructed(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
2853 
2854  /* function exit code */
2855  __Pyx_RefNannyFinishContext();
2856  return __pyx_r;
2857 }
2858 
2859 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_18isReconstructed(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
2860  PyObject *__pyx_r = NULL;
2861  __Pyx_RefNannyDeclarations
2862  PyObject *__pyx_t_1 = NULL;
2863  int __pyx_lineno = 0;
2864  const char *__pyx_filename = NULL;
2865  int __pyx_clineno = 0;
2866  __Pyx_RefNannySetupContext("isReconstructed", 0);
2867 
2868  /* "MeshAdaptPUMI/MeshAdapt.pyx":81
2869  * return self.thisptr.set_nAdapt(numberAdapt)
2870  * def isReconstructed(self):
2871  * return self.thisptr.isReconstructed # <<<<<<<<<<<<<<
2872  * def loadModelAndMesh(self, geomName, meshName):
2873  * return self.thisptr.loadModelAndMesh(geomName, meshName)
2874  */
2875  __Pyx_XDECREF(__pyx_r);
2876  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->isReconstructed); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 81, __pyx_L1_error)
2877  __Pyx_GOTREF(__pyx_t_1);
2878  __pyx_r = __pyx_t_1;
2879  __pyx_t_1 = 0;
2880  goto __pyx_L0;
2881 
2882  /* "MeshAdaptPUMI/MeshAdapt.pyx":80
2883  * def set_nAdapt(self,numberAdapt):
2884  * return self.thisptr.set_nAdapt(numberAdapt)
2885  * def isReconstructed(self): # <<<<<<<<<<<<<<
2886  * return self.thisptr.isReconstructed
2887  * def loadModelAndMesh(self, geomName, meshName):
2888  */
2889 
2890  /* function exit code */
2891  __pyx_L1_error:;
2892  __Pyx_XDECREF(__pyx_t_1);
2893  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.isReconstructed", __pyx_clineno, __pyx_lineno, __pyx_filename);
2894  __pyx_r = NULL;
2895  __pyx_L0:;
2896  __Pyx_XGIVEREF(__pyx_r);
2897  __Pyx_RefNannyFinishContext();
2898  return __pyx_r;
2899 }
2900 
2901 /* "MeshAdaptPUMI/MeshAdapt.pyx":82
2902  * def isReconstructed(self):
2903  * return self.thisptr.isReconstructed
2904  * def loadModelAndMesh(self, geomName, meshName): # <<<<<<<<<<<<<<
2905  * return self.thisptr.loadModelAndMesh(geomName, meshName)
2906  * def loadMeshForAnalytic(self, meshName, np.ndarray[np.double_t,ndim=1,mode="c"] boxDim, np.ndarray[np.double_t,ndim=1,mode="c"] sphereCenter, double sphereRadius):
2907  */
2908 
2909 /* Python wrapper */
2910 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_21loadModelAndMesh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2911 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_21loadModelAndMesh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2912  PyObject *__pyx_v_geomName = 0;
2913  PyObject *__pyx_v_meshName = 0;
2914  int __pyx_lineno = 0;
2915  const char *__pyx_filename = NULL;
2916  int __pyx_clineno = 0;
2917  PyObject *__pyx_r = 0;
2918  __Pyx_RefNannyDeclarations
2919  __Pyx_RefNannySetupContext("loadModelAndMesh (wrapper)", 0);
2920  {
2921  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_geomName,&__pyx_n_s_meshName,0};
2922  PyObject* values[2] = {0,0};
2923  if (unlikely(__pyx_kwds)) {
2924  Py_ssize_t kw_args;
2925  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2926  switch (pos_args) {
2927  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2928  CYTHON_FALLTHROUGH;
2929  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2930  CYTHON_FALLTHROUGH;
2931  case 0: break;
2932  default: goto __pyx_L5_argtuple_error;
2933  }
2934  kw_args = PyDict_Size(__pyx_kwds);
2935  switch (pos_args) {
2936  case 0:
2937  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_geomName)) != 0)) kw_args--;
2938  else goto __pyx_L5_argtuple_error;
2939  CYTHON_FALLTHROUGH;
2940  case 1:
2941  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meshName)) != 0)) kw_args--;
2942  else {
2943  __Pyx_RaiseArgtupleInvalid("loadModelAndMesh", 1, 2, 2, 1); __PYX_ERR(1, 82, __pyx_L3_error)
2944  }
2945  }
2946  if (unlikely(kw_args > 0)) {
2947  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "loadModelAndMesh") < 0)) __PYX_ERR(1, 82, __pyx_L3_error)
2948  }
2949  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2950  goto __pyx_L5_argtuple_error;
2951  } else {
2952  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2953  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2954  }
2955  __pyx_v_geomName = values[0];
2956  __pyx_v_meshName = values[1];
2957  }
2958  goto __pyx_L4_argument_unpacking_done;
2959  __pyx_L5_argtuple_error:;
2960  __Pyx_RaiseArgtupleInvalid("loadModelAndMesh", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 82, __pyx_L3_error)
2961  __pyx_L3_error:;
2962  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.loadModelAndMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
2963  __Pyx_RefNannyFinishContext();
2964  return NULL;
2965  __pyx_L4_argument_unpacking_done:;
2966  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_20loadModelAndMesh(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), __pyx_v_geomName, __pyx_v_meshName);
2967 
2968  /* function exit code */
2969  __Pyx_RefNannyFinishContext();
2970  return __pyx_r;
2971 }
2972 
2973 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_20loadModelAndMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_geomName, PyObject *__pyx_v_meshName) {
2974  PyObject *__pyx_r = NULL;
2975  __Pyx_RefNannyDeclarations
2976  char *__pyx_t_1;
2977  char *__pyx_t_2;
2978  PyObject *__pyx_t_3 = NULL;
2979  int __pyx_lineno = 0;
2980  const char *__pyx_filename = NULL;
2981  int __pyx_clineno = 0;
2982  __Pyx_RefNannySetupContext("loadModelAndMesh", 0);
2983 
2984  /* "MeshAdaptPUMI/MeshAdapt.pyx":83
2985  * return self.thisptr.isReconstructed
2986  * def loadModelAndMesh(self, geomName, meshName):
2987  * return self.thisptr.loadModelAndMesh(geomName, meshName) # <<<<<<<<<<<<<<
2988  * def loadMeshForAnalytic(self, meshName, np.ndarray[np.double_t,ndim=1,mode="c"] boxDim, np.ndarray[np.double_t,ndim=1,mode="c"] sphereCenter, double sphereRadius):
2989  * boxDim = np.ascontiguousarray(boxDim)
2990  */
2991  __Pyx_XDECREF(__pyx_r);
2992  __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_geomName); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(1, 83, __pyx_L1_error)
2993  __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_meshName); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 83, __pyx_L1_error)
2994  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->loadModelAndMesh(__pyx_t_1, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 83, __pyx_L1_error)
2995  __Pyx_GOTREF(__pyx_t_3);
2996  __pyx_r = __pyx_t_3;
2997  __pyx_t_3 = 0;
2998  goto __pyx_L0;
2999 
3000  /* "MeshAdaptPUMI/MeshAdapt.pyx":82
3001  * def isReconstructed(self):
3002  * return self.thisptr.isReconstructed
3003  * def loadModelAndMesh(self, geomName, meshName): # <<<<<<<<<<<<<<
3004  * return self.thisptr.loadModelAndMesh(geomName, meshName)
3005  * def loadMeshForAnalytic(self, meshName, np.ndarray[np.double_t,ndim=1,mode="c"] boxDim, np.ndarray[np.double_t,ndim=1,mode="c"] sphereCenter, double sphereRadius):
3006  */
3007 
3008  /* function exit code */
3009  __pyx_L1_error:;
3010  __Pyx_XDECREF(__pyx_t_3);
3011  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.loadModelAndMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
3012  __pyx_r = NULL;
3013  __pyx_L0:;
3014  __Pyx_XGIVEREF(__pyx_r);
3015  __Pyx_RefNannyFinishContext();
3016  return __pyx_r;
3017 }
3018 
3019 /* "MeshAdaptPUMI/MeshAdapt.pyx":84
3020  * def loadModelAndMesh(self, geomName, meshName):
3021  * return self.thisptr.loadModelAndMesh(geomName, meshName)
3022  * def loadMeshForAnalytic(self, meshName, np.ndarray[np.double_t,ndim=1,mode="c"] boxDim, np.ndarray[np.double_t,ndim=1,mode="c"] sphereCenter, double sphereRadius): # <<<<<<<<<<<<<<
3023  * boxDim = np.ascontiguousarray(boxDim)
3024  * sphereCenter = np.ascontiguousarray(sphereCenter)
3025  */
3026 
3027 /* Python wrapper */
3028 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_23loadMeshForAnalytic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3029 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_23loadMeshForAnalytic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3030  PyObject *__pyx_v_meshName = 0;
3031  PyArrayObject *__pyx_v_boxDim = 0;
3032  PyArrayObject *__pyx_v_sphereCenter = 0;
3033  double __pyx_v_sphereRadius;
3034  int __pyx_lineno = 0;
3035  const char *__pyx_filename = NULL;
3036  int __pyx_clineno = 0;
3037  PyObject *__pyx_r = 0;
3038  __Pyx_RefNannyDeclarations
3039  __Pyx_RefNannySetupContext("loadMeshForAnalytic (wrapper)", 0);
3040  {
3041  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_meshName,&__pyx_n_s_boxDim,&__pyx_n_s_sphereCenter,&__pyx_n_s_sphereRadius,0};
3042  PyObject* values[4] = {0,0,0,0};
3043  if (unlikely(__pyx_kwds)) {
3044  Py_ssize_t kw_args;
3045  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3046  switch (pos_args) {
3047  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3048  CYTHON_FALLTHROUGH;
3049  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3050  CYTHON_FALLTHROUGH;
3051  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3052  CYTHON_FALLTHROUGH;
3053  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3054  CYTHON_FALLTHROUGH;
3055  case 0: break;
3056  default: goto __pyx_L5_argtuple_error;
3057  }
3058  kw_args = PyDict_Size(__pyx_kwds);
3059  switch (pos_args) {
3060  case 0:
3061  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meshName)) != 0)) kw_args--;
3062  else goto __pyx_L5_argtuple_error;
3063  CYTHON_FALLTHROUGH;
3064  case 1:
3065  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boxDim)) != 0)) kw_args--;
3066  else {
3067  __Pyx_RaiseArgtupleInvalid("loadMeshForAnalytic", 1, 4, 4, 1); __PYX_ERR(1, 84, __pyx_L3_error)
3068  }
3069  CYTHON_FALLTHROUGH;
3070  case 2:
3071  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sphereCenter)) != 0)) kw_args--;
3072  else {
3073  __Pyx_RaiseArgtupleInvalid("loadMeshForAnalytic", 1, 4, 4, 2); __PYX_ERR(1, 84, __pyx_L3_error)
3074  }
3075  CYTHON_FALLTHROUGH;
3076  case 3:
3077  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sphereRadius)) != 0)) kw_args--;
3078  else {
3079  __Pyx_RaiseArgtupleInvalid("loadMeshForAnalytic", 1, 4, 4, 3); __PYX_ERR(1, 84, __pyx_L3_error)
3080  }
3081  }
3082  if (unlikely(kw_args > 0)) {
3083  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "loadMeshForAnalytic") < 0)) __PYX_ERR(1, 84, __pyx_L3_error)
3084  }
3085  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3086  goto __pyx_L5_argtuple_error;
3087  } else {
3088  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3089  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3090  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3091  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3092  }
3093  __pyx_v_meshName = values[0];
3094  __pyx_v_boxDim = ((PyArrayObject *)values[1]);
3095  __pyx_v_sphereCenter = ((PyArrayObject *)values[2]);
3096  __pyx_v_sphereRadius = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_sphereRadius == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 84, __pyx_L3_error)
3097  }
3098  goto __pyx_L4_argument_unpacking_done;
3099  __pyx_L5_argtuple_error:;
3100  __Pyx_RaiseArgtupleInvalid("loadMeshForAnalytic", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 84, __pyx_L3_error)
3101  __pyx_L3_error:;
3102  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.loadMeshForAnalytic", __pyx_clineno, __pyx_lineno, __pyx_filename);
3103  __Pyx_RefNannyFinishContext();
3104  return NULL;
3105  __pyx_L4_argument_unpacking_done:;
3106  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_boxDim), __pyx_ptype_5numpy_ndarray, 1, "boxDim", 0))) __PYX_ERR(1, 84, __pyx_L1_error)
3107  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sphereCenter), __pyx_ptype_5numpy_ndarray, 1, "sphereCenter", 0))) __PYX_ERR(1, 84, __pyx_L1_error)
3108  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_22loadMeshForAnalytic(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), __pyx_v_meshName, __pyx_v_boxDim, __pyx_v_sphereCenter, __pyx_v_sphereRadius);
3109 
3110  /* function exit code */
3111  goto __pyx_L0;
3112  __pyx_L1_error:;
3113  __pyx_r = NULL;
3114  __pyx_L0:;
3115  __Pyx_RefNannyFinishContext();
3116  return __pyx_r;
3117 }
3118 
3119 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_22loadMeshForAnalytic(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_meshName, PyArrayObject *__pyx_v_boxDim, PyArrayObject *__pyx_v_sphereCenter, double __pyx_v_sphereRadius) {
3120  __Pyx_LocalBuf_ND __pyx_pybuffernd_boxDim;
3121  __Pyx_Buffer __pyx_pybuffer_boxDim;
3122  __Pyx_LocalBuf_ND __pyx_pybuffernd_sphereCenter;
3123  __Pyx_Buffer __pyx_pybuffer_sphereCenter;
3124  PyObject *__pyx_r = NULL;
3125  __Pyx_RefNannyDeclarations
3126  PyObject *__pyx_t_1 = NULL;
3127  PyObject *__pyx_t_2 = NULL;
3128  PyObject *__pyx_t_3 = NULL;
3129  PyArrayObject *__pyx_t_4 = NULL;
3130  int __pyx_t_5;
3131  PyObject *__pyx_t_6 = NULL;
3132  PyObject *__pyx_t_7 = NULL;
3133  PyObject *__pyx_t_8 = NULL;
3134  PyArrayObject *__pyx_t_9 = NULL;
3135  PyObject *__pyx_t_10 = NULL;
3136  double __pyx_t_11;
3137  char *__pyx_t_12;
3138  Py_ssize_t __pyx_t_13;
3139  Py_ssize_t __pyx_t_14;
3140  int __pyx_lineno = 0;
3141  const char *__pyx_filename = NULL;
3142  int __pyx_clineno = 0;
3143  __Pyx_RefNannySetupContext("loadMeshForAnalytic", 0);
3144  __Pyx_INCREF((PyObject *)__pyx_v_boxDim);
3145  __Pyx_INCREF((PyObject *)__pyx_v_sphereCenter);
3146  __pyx_pybuffer_boxDim.pybuffer.buf = NULL;
3147  __pyx_pybuffer_boxDim.refcount = 0;
3148  __pyx_pybuffernd_boxDim.data = NULL;
3149  __pyx_pybuffernd_boxDim.rcbuffer = &__pyx_pybuffer_boxDim;
3150  __pyx_pybuffer_sphereCenter.pybuffer.buf = NULL;
3151  __pyx_pybuffer_sphereCenter.refcount = 0;
3152  __pyx_pybuffernd_sphereCenter.data = NULL;
3153  __pyx_pybuffernd_sphereCenter.rcbuffer = &__pyx_pybuffer_sphereCenter;
3154  {
3155  __Pyx_BufFmt_StackElem __pyx_stack[1];
3156  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_boxDim.rcbuffer->pybuffer, (PyObject*)__pyx_v_boxDim, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 84, __pyx_L1_error)
3157  }
3158  __pyx_pybuffernd_boxDim.diminfo[0].strides = __pyx_pybuffernd_boxDim.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_boxDim.diminfo[0].shape = __pyx_pybuffernd_boxDim.rcbuffer->pybuffer.shape[0];
3159  {
3160  __Pyx_BufFmt_StackElem __pyx_stack[1];
3161  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer, (PyObject*)__pyx_v_sphereCenter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 84, __pyx_L1_error)
3162  }
3163  __pyx_pybuffernd_sphereCenter.diminfo[0].strides = __pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sphereCenter.diminfo[0].shape = __pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer.shape[0];
3164 
3165  /* "MeshAdaptPUMI/MeshAdapt.pyx":85
3166  * return self.thisptr.loadModelAndMesh(geomName, meshName)
3167  * def loadMeshForAnalytic(self, meshName, np.ndarray[np.double_t,ndim=1,mode="c"] boxDim, np.ndarray[np.double_t,ndim=1,mode="c"] sphereCenter, double sphereRadius):
3168  * boxDim = np.ascontiguousarray(boxDim) # <<<<<<<<<<<<<<
3169  * sphereCenter = np.ascontiguousarray(sphereCenter)
3170  * sphereRadius = np.ascontiguousarray(sphereRadius)
3171  */
3172  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 85, __pyx_L1_error)
3173  __Pyx_GOTREF(__pyx_t_2);
3174  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 85, __pyx_L1_error)
3175  __Pyx_GOTREF(__pyx_t_3);
3176  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3177  __pyx_t_2 = NULL;
3178  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3179  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3180  if (likely(__pyx_t_2)) {
3181  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3182  __Pyx_INCREF(__pyx_t_2);
3183  __Pyx_INCREF(function);
3184  __Pyx_DECREF_SET(__pyx_t_3, function);
3185  }
3186  }
3187  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_boxDim)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_boxDim));
3188  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3189  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 85, __pyx_L1_error)
3190  __Pyx_GOTREF(__pyx_t_1);
3191  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3192  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 85, __pyx_L1_error)
3193  __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
3194  {
3195  __Pyx_BufFmt_StackElem __pyx_stack[1];
3196  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_boxDim.rcbuffer->pybuffer);
3197  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_boxDim.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
3198  if (unlikely(__pyx_t_5 < 0)) {
3199  PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
3200  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_boxDim.rcbuffer->pybuffer, (PyObject*)__pyx_v_boxDim, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
3201  Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
3202  __Pyx_RaiseBufferFallbackError();
3203  } else {
3204  PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3205  }
3206  __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
3207  }
3208  __pyx_pybuffernd_boxDim.diminfo[0].strides = __pyx_pybuffernd_boxDim.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_boxDim.diminfo[0].shape = __pyx_pybuffernd_boxDim.rcbuffer->pybuffer.shape[0];
3209  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 85, __pyx_L1_error)
3210  }
3211  __pyx_t_4 = 0;
3212  __Pyx_DECREF_SET(__pyx_v_boxDim, ((PyArrayObject *)__pyx_t_1));
3213  __pyx_t_1 = 0;
3214 
3215  /* "MeshAdaptPUMI/MeshAdapt.pyx":86
3216  * def loadMeshForAnalytic(self, meshName, np.ndarray[np.double_t,ndim=1,mode="c"] boxDim, np.ndarray[np.double_t,ndim=1,mode="c"] sphereCenter, double sphereRadius):
3217  * boxDim = np.ascontiguousarray(boxDim)
3218  * sphereCenter = np.ascontiguousarray(sphereCenter) # <<<<<<<<<<<<<<
3219  * sphereRadius = np.ascontiguousarray(sphereRadius)
3220  * return self.thisptr.loadMeshForAnalytic(meshName,&boxDim[0],&sphereCenter[0],sphereRadius)
3221  */
3222  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 86, __pyx_L1_error)
3223  __Pyx_GOTREF(__pyx_t_3);
3224  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error)
3225  __Pyx_GOTREF(__pyx_t_2);
3226  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3227  __pyx_t_3 = NULL;
3228  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3229  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3230  if (likely(__pyx_t_3)) {
3231  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3232  __Pyx_INCREF(__pyx_t_3);
3233  __Pyx_INCREF(function);
3234  __Pyx_DECREF_SET(__pyx_t_2, function);
3235  }
3236  }
3237  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_sphereCenter)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_sphereCenter));
3238  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3239  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 86, __pyx_L1_error)
3240  __Pyx_GOTREF(__pyx_t_1);
3241  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3242  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 86, __pyx_L1_error)
3243  __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
3244  {
3245  __Pyx_BufFmt_StackElem __pyx_stack[1];
3246  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer);
3247  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
3248  if (unlikely(__pyx_t_5 < 0)) {
3249  PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
3250  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer, (PyObject*)__pyx_v_sphereCenter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
3251  Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
3252  __Pyx_RaiseBufferFallbackError();
3253  } else {
3254  PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
3255  }
3256  __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
3257  }
3258  __pyx_pybuffernd_sphereCenter.diminfo[0].strides = __pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sphereCenter.diminfo[0].shape = __pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer.shape[0];
3259  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 86, __pyx_L1_error)
3260  }
3261  __pyx_t_9 = 0;
3262  __Pyx_DECREF_SET(__pyx_v_sphereCenter, ((PyArrayObject *)__pyx_t_1));
3263  __pyx_t_1 = 0;
3264 
3265  /* "MeshAdaptPUMI/MeshAdapt.pyx":87
3266  * boxDim = np.ascontiguousarray(boxDim)
3267  * sphereCenter = np.ascontiguousarray(sphereCenter)
3268  * sphereRadius = np.ascontiguousarray(sphereRadius) # <<<<<<<<<<<<<<
3269  * return self.thisptr.loadMeshForAnalytic(meshName,&boxDim[0],&sphereCenter[0],sphereRadius)
3270  * def updateSphereCoordinates(self,np.ndarray[np.double_t,ndim=1,mode="c"] sphereCenter):
3271  */
3272  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L1_error)
3273  __Pyx_GOTREF(__pyx_t_2);
3274  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 87, __pyx_L1_error)
3275  __Pyx_GOTREF(__pyx_t_3);
3276  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3277  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_sphereRadius); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L1_error)
3278  __Pyx_GOTREF(__pyx_t_2);
3279  __pyx_t_10 = NULL;
3280  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3281  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
3282  if (likely(__pyx_t_10)) {
3283  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3284  __Pyx_INCREF(__pyx_t_10);
3285  __Pyx_INCREF(function);
3286  __Pyx_DECREF_SET(__pyx_t_3, function);
3287  }
3288  }
3289  __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
3290  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3291  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3292  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error)
3293  __Pyx_GOTREF(__pyx_t_1);
3294  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3295  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 87, __pyx_L1_error)
3296  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3297  __pyx_v_sphereRadius = __pyx_t_11;
3298 
3299  /* "MeshAdaptPUMI/MeshAdapt.pyx":88
3300  * sphereCenter = np.ascontiguousarray(sphereCenter)
3301  * sphereRadius = np.ascontiguousarray(sphereRadius)
3302  * return self.thisptr.loadMeshForAnalytic(meshName,&boxDim[0],&sphereCenter[0],sphereRadius) # <<<<<<<<<<<<<<
3303  * def updateSphereCoordinates(self,np.ndarray[np.double_t,ndim=1,mode="c"] sphereCenter):
3304  * sphereCenter = np.ascontiguousarray(sphereCenter)
3305  */
3306  __Pyx_XDECREF(__pyx_r);
3307  __pyx_t_12 = __Pyx_PyObject_AsWritableString(__pyx_v_meshName); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(1, 88, __pyx_L1_error)
3308  __pyx_t_13 = 0;
3309  __pyx_t_5 = -1;
3310  if (__pyx_t_13 < 0) {
3311  __pyx_t_13 += __pyx_pybuffernd_boxDim.diminfo[0].shape;
3312  if (unlikely(__pyx_t_13 < 0)) __pyx_t_5 = 0;
3313  } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_boxDim.diminfo[0].shape)) __pyx_t_5 = 0;
3314  if (unlikely(__pyx_t_5 != -1)) {
3315  __Pyx_RaiseBufferIndexError(__pyx_t_5);
3316  __PYX_ERR(1, 88, __pyx_L1_error)
3317  }
3318  __pyx_t_14 = 0;
3319  __pyx_t_5 = -1;
3320  if (__pyx_t_14 < 0) {
3321  __pyx_t_14 += __pyx_pybuffernd_sphereCenter.diminfo[0].shape;
3322  if (unlikely(__pyx_t_14 < 0)) __pyx_t_5 = 0;
3323  } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_sphereCenter.diminfo[0].shape)) __pyx_t_5 = 0;
3324  if (unlikely(__pyx_t_5 != -1)) {
3325  __Pyx_RaiseBufferIndexError(__pyx_t_5);
3326  __PYX_ERR(1, 88, __pyx_L1_error)
3327  }
3328  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->loadMeshForAnalytic(__pyx_t_12, (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_boxDim.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_boxDim.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_sphereCenter.diminfo[0].strides))), __pyx_v_sphereRadius)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error)
3329  __Pyx_GOTREF(__pyx_t_1);
3330  __pyx_r = __pyx_t_1;
3331  __pyx_t_1 = 0;
3332  goto __pyx_L0;
3333 
3334  /* "MeshAdaptPUMI/MeshAdapt.pyx":84
3335  * def loadModelAndMesh(self, geomName, meshName):
3336  * return self.thisptr.loadModelAndMesh(geomName, meshName)
3337  * def loadMeshForAnalytic(self, meshName, np.ndarray[np.double_t,ndim=1,mode="c"] boxDim, np.ndarray[np.double_t,ndim=1,mode="c"] sphereCenter, double sphereRadius): # <<<<<<<<<<<<<<
3338  * boxDim = np.ascontiguousarray(boxDim)
3339  * sphereCenter = np.ascontiguousarray(sphereCenter)
3340  */
3341 
3342  /* function exit code */
3343  __pyx_L1_error:;
3344  __Pyx_XDECREF(__pyx_t_1);
3345  __Pyx_XDECREF(__pyx_t_2);
3346  __Pyx_XDECREF(__pyx_t_3);
3347  __Pyx_XDECREF(__pyx_t_10);
3348  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3349  __Pyx_PyThreadState_declare
3350  __Pyx_PyThreadState_assign
3351  __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3352  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_boxDim.rcbuffer->pybuffer);
3353  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer);
3354  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3355  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.loadMeshForAnalytic", __pyx_clineno, __pyx_lineno, __pyx_filename);
3356  __pyx_r = NULL;
3357  goto __pyx_L2;
3358  __pyx_L0:;
3359  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_boxDim.rcbuffer->pybuffer);
3360  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer);
3361  __pyx_L2:;
3362  __Pyx_XDECREF((PyObject *)__pyx_v_boxDim);
3363  __Pyx_XDECREF((PyObject *)__pyx_v_sphereCenter);
3364  __Pyx_XGIVEREF(__pyx_r);
3365  __Pyx_RefNannyFinishContext();
3366  return __pyx_r;
3367 }
3368 
3369 /* "MeshAdaptPUMI/MeshAdapt.pyx":89
3370  * sphereRadius = np.ascontiguousarray(sphereRadius)
3371  * return self.thisptr.loadMeshForAnalytic(meshName,&boxDim[0],&sphereCenter[0],sphereRadius)
3372  * def updateSphereCoordinates(self,np.ndarray[np.double_t,ndim=1,mode="c"] sphereCenter): # <<<<<<<<<<<<<<
3373  * sphereCenter = np.ascontiguousarray(sphereCenter)
3374  * return self.thisptr.updateSphereCoordinates(&sphereCenter[0])
3375  */
3376 
3377 /* Python wrapper */
3378 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_25updateSphereCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_v_sphereCenter); /*proto*/
3379 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_25updateSphereCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_v_sphereCenter) {
3380  int __pyx_lineno = 0;
3381  const char *__pyx_filename = NULL;
3382  int __pyx_clineno = 0;
3383  PyObject *__pyx_r = 0;
3384  __Pyx_RefNannyDeclarations
3385  __Pyx_RefNannySetupContext("updateSphereCoordinates (wrapper)", 0);
3386  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sphereCenter), __pyx_ptype_5numpy_ndarray, 1, "sphereCenter", 0))) __PYX_ERR(1, 89, __pyx_L1_error)
3387  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_24updateSphereCoordinates(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), ((PyArrayObject *)__pyx_v_sphereCenter));
3388 
3389  /* function exit code */
3390  goto __pyx_L0;
3391  __pyx_L1_error:;
3392  __pyx_r = NULL;
3393  __pyx_L0:;
3394  __Pyx_RefNannyFinishContext();
3395  return __pyx_r;
3396 }
3397 
3398 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_24updateSphereCoordinates(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyArrayObject *__pyx_v_sphereCenter) {
3399  __Pyx_LocalBuf_ND __pyx_pybuffernd_sphereCenter;
3400  __Pyx_Buffer __pyx_pybuffer_sphereCenter;
3401  PyObject *__pyx_r = NULL;
3402  __Pyx_RefNannyDeclarations
3403  PyObject *__pyx_t_1 = NULL;
3404  PyObject *__pyx_t_2 = NULL;
3405  PyObject *__pyx_t_3 = NULL;
3406  PyArrayObject *__pyx_t_4 = NULL;
3407  int __pyx_t_5;
3408  PyObject *__pyx_t_6 = NULL;
3409  PyObject *__pyx_t_7 = NULL;
3410  PyObject *__pyx_t_8 = NULL;
3411  Py_ssize_t __pyx_t_9;
3412  int __pyx_lineno = 0;
3413  const char *__pyx_filename = NULL;
3414  int __pyx_clineno = 0;
3415  __Pyx_RefNannySetupContext("updateSphereCoordinates", 0);
3416  __Pyx_INCREF((PyObject *)__pyx_v_sphereCenter);
3417  __pyx_pybuffer_sphereCenter.pybuffer.buf = NULL;
3418  __pyx_pybuffer_sphereCenter.refcount = 0;
3419  __pyx_pybuffernd_sphereCenter.data = NULL;
3420  __pyx_pybuffernd_sphereCenter.rcbuffer = &__pyx_pybuffer_sphereCenter;
3421  {
3422  __Pyx_BufFmt_StackElem __pyx_stack[1];
3423  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer, (PyObject*)__pyx_v_sphereCenter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 89, __pyx_L1_error)
3424  }
3425  __pyx_pybuffernd_sphereCenter.diminfo[0].strides = __pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sphereCenter.diminfo[0].shape = __pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer.shape[0];
3426 
3427  /* "MeshAdaptPUMI/MeshAdapt.pyx":90
3428  * return self.thisptr.loadMeshForAnalytic(meshName,&boxDim[0],&sphereCenter[0],sphereRadius)
3429  * def updateSphereCoordinates(self,np.ndarray[np.double_t,ndim=1,mode="c"] sphereCenter):
3430  * sphereCenter = np.ascontiguousarray(sphereCenter) # <<<<<<<<<<<<<<
3431  * return self.thisptr.updateSphereCoordinates(&sphereCenter[0])
3432  * def reconstructFromProteus(self,cmeshTools.CMesh cmesh,cmeshTools.CMesh global_cmesh,hasModel=0):
3433  */
3434  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 90, __pyx_L1_error)
3435  __Pyx_GOTREF(__pyx_t_2);
3436  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 90, __pyx_L1_error)
3437  __Pyx_GOTREF(__pyx_t_3);
3438  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3439  __pyx_t_2 = NULL;
3440  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3441  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3442  if (likely(__pyx_t_2)) {
3443  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3444  __Pyx_INCREF(__pyx_t_2);
3445  __Pyx_INCREF(function);
3446  __Pyx_DECREF_SET(__pyx_t_3, function);
3447  }
3448  }
3449  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_sphereCenter)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_sphereCenter));
3450  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3451  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 90, __pyx_L1_error)
3452  __Pyx_GOTREF(__pyx_t_1);
3453  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3454  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 90, __pyx_L1_error)
3455  __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
3456  {
3457  __Pyx_BufFmt_StackElem __pyx_stack[1];
3458  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer);
3459  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
3460  if (unlikely(__pyx_t_5 < 0)) {
3461  PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
3462  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer, (PyObject*)__pyx_v_sphereCenter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
3463  Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
3464  __Pyx_RaiseBufferFallbackError();
3465  } else {
3466  PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3467  }
3468  __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
3469  }
3470  __pyx_pybuffernd_sphereCenter.diminfo[0].strides = __pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sphereCenter.diminfo[0].shape = __pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer.shape[0];
3471  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 90, __pyx_L1_error)
3472  }
3473  __pyx_t_4 = 0;
3474  __Pyx_DECREF_SET(__pyx_v_sphereCenter, ((PyArrayObject *)__pyx_t_1));
3475  __pyx_t_1 = 0;
3476 
3477  /* "MeshAdaptPUMI/MeshAdapt.pyx":91
3478  * def updateSphereCoordinates(self,np.ndarray[np.double_t,ndim=1,mode="c"] sphereCenter):
3479  * sphereCenter = np.ascontiguousarray(sphereCenter)
3480  * return self.thisptr.updateSphereCoordinates(&sphereCenter[0]) # <<<<<<<<<<<<<<
3481  * def reconstructFromProteus(self,cmeshTools.CMesh cmesh,cmeshTools.CMesh global_cmesh,hasModel=0):
3482  * return self.thisptr.reconstructFromProteus(cmesh.mesh,global_cmesh.mesh,hasModel)
3483  */
3484  __Pyx_XDECREF(__pyx_r);
3485  __pyx_t_9 = 0;
3486  __pyx_t_5 = -1;
3487  if (__pyx_t_9 < 0) {
3488  __pyx_t_9 += __pyx_pybuffernd_sphereCenter.diminfo[0].shape;
3489  if (unlikely(__pyx_t_9 < 0)) __pyx_t_5 = 0;
3490  } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_sphereCenter.diminfo[0].shape)) __pyx_t_5 = 0;
3491  if (unlikely(__pyx_t_5 != -1)) {
3492  __Pyx_RaiseBufferIndexError(__pyx_t_5);
3493  __PYX_ERR(1, 91, __pyx_L1_error)
3494  }
3495  __pyx_t_1 = __Pyx_void_to_None(__pyx_v_self->thisptr->updateSphereCoordinates((&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_sphereCenter.diminfo[0].strides))))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 91, __pyx_L1_error)
3496  __Pyx_GOTREF(__pyx_t_1);
3497  __pyx_r = __pyx_t_1;
3498  __pyx_t_1 = 0;
3499  goto __pyx_L0;
3500 
3501  /* "MeshAdaptPUMI/MeshAdapt.pyx":89
3502  * sphereRadius = np.ascontiguousarray(sphereRadius)
3503  * return self.thisptr.loadMeshForAnalytic(meshName,&boxDim[0],&sphereCenter[0],sphereRadius)
3504  * def updateSphereCoordinates(self,np.ndarray[np.double_t,ndim=1,mode="c"] sphereCenter): # <<<<<<<<<<<<<<
3505  * sphereCenter = np.ascontiguousarray(sphereCenter)
3506  * return self.thisptr.updateSphereCoordinates(&sphereCenter[0])
3507  */
3508 
3509  /* function exit code */
3510  __pyx_L1_error:;
3511  __Pyx_XDECREF(__pyx_t_1);
3512  __Pyx_XDECREF(__pyx_t_2);
3513  __Pyx_XDECREF(__pyx_t_3);
3514  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3515  __Pyx_PyThreadState_declare
3516  __Pyx_PyThreadState_assign
3517  __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3518  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer);
3519  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3520  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.updateSphereCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename);
3521  __pyx_r = NULL;
3522  goto __pyx_L2;
3523  __pyx_L0:;
3524  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer);
3525  __pyx_L2:;
3526  __Pyx_XDECREF((PyObject *)__pyx_v_sphereCenter);
3527  __Pyx_XGIVEREF(__pyx_r);
3528  __Pyx_RefNannyFinishContext();
3529  return __pyx_r;
3530 }
3531 
3532 /* "MeshAdaptPUMI/MeshAdapt.pyx":92
3533  * sphereCenter = np.ascontiguousarray(sphereCenter)
3534  * return self.thisptr.updateSphereCoordinates(&sphereCenter[0])
3535  * def reconstructFromProteus(self,cmeshTools.CMesh cmesh,cmeshTools.CMesh global_cmesh,hasModel=0): # <<<<<<<<<<<<<<
3536  * return self.thisptr.reconstructFromProteus(cmesh.mesh,global_cmesh.mesh,hasModel)
3537  * def reconstructFromProteus2(self,cmeshTools.CMesh cmesh,np.ndarray[int,ndim=1,mode="c"] isModelVert,
3538  */
3539 
3540 /* Python wrapper */
3541 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_27reconstructFromProteus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3542 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_27reconstructFromProteus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3543  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3544  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_global_cmesh = 0;
3545  PyObject *__pyx_v_hasModel = 0;
3546  int __pyx_lineno = 0;
3547  const char *__pyx_filename = NULL;
3548  int __pyx_clineno = 0;
3549  PyObject *__pyx_r = 0;
3550  __Pyx_RefNannyDeclarations
3551  __Pyx_RefNannySetupContext("reconstructFromProteus (wrapper)", 0);
3552  {
3553  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cmesh,&__pyx_n_s_global_cmesh,&__pyx_n_s_hasModel,0};
3554  PyObject* values[3] = {0,0,0};
3555  values[2] = ((PyObject *)__pyx_int_0);
3556  if (unlikely(__pyx_kwds)) {
3557  Py_ssize_t kw_args;
3558  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3559  switch (pos_args) {
3560  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3561  CYTHON_FALLTHROUGH;
3562  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3563  CYTHON_FALLTHROUGH;
3564  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3565  CYTHON_FALLTHROUGH;
3566  case 0: break;
3567  default: goto __pyx_L5_argtuple_error;
3568  }
3569  kw_args = PyDict_Size(__pyx_kwds);
3570  switch (pos_args) {
3571  case 0:
3572  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3573  else goto __pyx_L5_argtuple_error;
3574  CYTHON_FALLTHROUGH;
3575  case 1:
3576  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_global_cmesh)) != 0)) kw_args--;
3577  else {
3578  __Pyx_RaiseArgtupleInvalid("reconstructFromProteus", 0, 2, 3, 1); __PYX_ERR(1, 92, __pyx_L3_error)
3579  }
3580  CYTHON_FALLTHROUGH;
3581  case 2:
3582  if (kw_args > 0) {
3583  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasModel);
3584  if (value) { values[2] = value; kw_args--; }
3585  }
3586  }
3587  if (unlikely(kw_args > 0)) {
3588  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reconstructFromProteus") < 0)) __PYX_ERR(1, 92, __pyx_L3_error)
3589  }
3590  } else {
3591  switch (PyTuple_GET_SIZE(__pyx_args)) {
3592  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3593  CYTHON_FALLTHROUGH;
3594  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3595  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3596  break;
3597  default: goto __pyx_L5_argtuple_error;
3598  }
3599  }
3600  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[0]);
3601  __pyx_v_global_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[1]);
3602  __pyx_v_hasModel = values[2];
3603  }
3604  goto __pyx_L4_argument_unpacking_done;
3605  __pyx_L5_argtuple_error:;
3606  __Pyx_RaiseArgtupleInvalid("reconstructFromProteus", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 92, __pyx_L3_error)
3607  __pyx_L3_error:;
3608  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.reconstructFromProteus", __pyx_clineno, __pyx_lineno, __pyx_filename);
3609  __Pyx_RefNannyFinishContext();
3610  return NULL;
3611  __pyx_L4_argument_unpacking_done:;
3612  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(1, 92, __pyx_L1_error)
3613  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_global_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "global_cmesh", 0))) __PYX_ERR(1, 92, __pyx_L1_error)
3614  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_26reconstructFromProteus(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), __pyx_v_cmesh, __pyx_v_global_cmesh, __pyx_v_hasModel);
3615 
3616  /* function exit code */
3617  goto __pyx_L0;
3618  __pyx_L1_error:;
3619  __pyx_r = NULL;
3620  __pyx_L0:;
3621  __Pyx_RefNannyFinishContext();
3622  return __pyx_r;
3623 }
3624 
3625 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_26reconstructFromProteus(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_global_cmesh, PyObject *__pyx_v_hasModel) {
3626  PyObject *__pyx_r = NULL;
3627  __Pyx_RefNannyDeclarations
3628  int __pyx_t_1;
3629  PyObject *__pyx_t_2 = NULL;
3630  int __pyx_lineno = 0;
3631  const char *__pyx_filename = NULL;
3632  int __pyx_clineno = 0;
3633  __Pyx_RefNannySetupContext("reconstructFromProteus", 0);
3634 
3635  /* "MeshAdaptPUMI/MeshAdapt.pyx":93
3636  * return self.thisptr.updateSphereCoordinates(&sphereCenter[0])
3637  * def reconstructFromProteus(self,cmeshTools.CMesh cmesh,cmeshTools.CMesh global_cmesh,hasModel=0):
3638  * return self.thisptr.reconstructFromProteus(cmesh.mesh,global_cmesh.mesh,hasModel) # <<<<<<<<<<<<<<
3639  * def reconstructFromProteus2(self,cmeshTools.CMesh cmesh,np.ndarray[int,ndim=1,mode="c"] isModelVert,
3640  * np.ndarray[int,ndim=2,mode="c"] bFaces):
3641  */
3642  __Pyx_XDECREF(__pyx_r);
3643  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_hasModel); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 93, __pyx_L1_error)
3644  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->reconstructFromProteus(__pyx_v_cmesh->mesh, __pyx_v_global_cmesh->mesh, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 93, __pyx_L1_error)
3645  __Pyx_GOTREF(__pyx_t_2);
3646  __pyx_r = __pyx_t_2;
3647  __pyx_t_2 = 0;
3648  goto __pyx_L0;
3649 
3650  /* "MeshAdaptPUMI/MeshAdapt.pyx":92
3651  * sphereCenter = np.ascontiguousarray(sphereCenter)
3652  * return self.thisptr.updateSphereCoordinates(&sphereCenter[0])
3653  * def reconstructFromProteus(self,cmeshTools.CMesh cmesh,cmeshTools.CMesh global_cmesh,hasModel=0): # <<<<<<<<<<<<<<
3654  * return self.thisptr.reconstructFromProteus(cmesh.mesh,global_cmesh.mesh,hasModel)
3655  * def reconstructFromProteus2(self,cmeshTools.CMesh cmesh,np.ndarray[int,ndim=1,mode="c"] isModelVert,
3656  */
3657 
3658  /* function exit code */
3659  __pyx_L1_error:;
3660  __Pyx_XDECREF(__pyx_t_2);
3661  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.reconstructFromProteus", __pyx_clineno, __pyx_lineno, __pyx_filename);
3662  __pyx_r = NULL;
3663  __pyx_L0:;
3664  __Pyx_XGIVEREF(__pyx_r);
3665  __Pyx_RefNannyFinishContext();
3666  return __pyx_r;
3667 }
3668 
3669 /* "MeshAdaptPUMI/MeshAdapt.pyx":94
3670  * def reconstructFromProteus(self,cmeshTools.CMesh cmesh,cmeshTools.CMesh global_cmesh,hasModel=0):
3671  * return self.thisptr.reconstructFromProteus(cmesh.mesh,global_cmesh.mesh,hasModel)
3672  * def reconstructFromProteus2(self,cmeshTools.CMesh cmesh,np.ndarray[int,ndim=1,mode="c"] isModelVert, # <<<<<<<<<<<<<<
3673  * np.ndarray[int,ndim=2,mode="c"] bFaces):
3674  * isModelVert = np.ascontiguousarray(isModelVert)
3675  */
3676 
3677 /* Python wrapper */
3678 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_29reconstructFromProteus2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3679 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_29reconstructFromProteus2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3680  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3681  PyArrayObject *__pyx_v_isModelVert = 0;
3682  PyArrayObject *__pyx_v_bFaces = 0;
3683  int __pyx_lineno = 0;
3684  const char *__pyx_filename = NULL;
3685  int __pyx_clineno = 0;
3686  PyObject *__pyx_r = 0;
3687  __Pyx_RefNannyDeclarations
3688  __Pyx_RefNannySetupContext("reconstructFromProteus2 (wrapper)", 0);
3689  {
3690  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cmesh,&__pyx_n_s_isModelVert,&__pyx_n_s_bFaces,0};
3691  PyObject* values[3] = {0,0,0};
3692  if (unlikely(__pyx_kwds)) {
3693  Py_ssize_t kw_args;
3694  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3695  switch (pos_args) {
3696  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3697  CYTHON_FALLTHROUGH;
3698  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3699  CYTHON_FALLTHROUGH;
3700  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3701  CYTHON_FALLTHROUGH;
3702  case 0: break;
3703  default: goto __pyx_L5_argtuple_error;
3704  }
3705  kw_args = PyDict_Size(__pyx_kwds);
3706  switch (pos_args) {
3707  case 0:
3708  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3709  else goto __pyx_L5_argtuple_error;
3710  CYTHON_FALLTHROUGH;
3711  case 1:
3712  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isModelVert)) != 0)) kw_args--;
3713  else {
3714  __Pyx_RaiseArgtupleInvalid("reconstructFromProteus2", 1, 3, 3, 1); __PYX_ERR(1, 94, __pyx_L3_error)
3715  }
3716  CYTHON_FALLTHROUGH;
3717  case 2:
3718  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bFaces)) != 0)) kw_args--;
3719  else {
3720  __Pyx_RaiseArgtupleInvalid("reconstructFromProteus2", 1, 3, 3, 2); __PYX_ERR(1, 94, __pyx_L3_error)
3721  }
3722  }
3723  if (unlikely(kw_args > 0)) {
3724  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reconstructFromProteus2") < 0)) __PYX_ERR(1, 94, __pyx_L3_error)
3725  }
3726  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3727  goto __pyx_L5_argtuple_error;
3728  } else {
3729  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3730  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3731  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3732  }
3733  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[0]);
3734  __pyx_v_isModelVert = ((PyArrayObject *)values[1]);
3735  __pyx_v_bFaces = ((PyArrayObject *)values[2]);
3736  }
3737  goto __pyx_L4_argument_unpacking_done;
3738  __pyx_L5_argtuple_error:;
3739  __Pyx_RaiseArgtupleInvalid("reconstructFromProteus2", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 94, __pyx_L3_error)
3740  __pyx_L3_error:;
3741  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.reconstructFromProteus2", __pyx_clineno, __pyx_lineno, __pyx_filename);
3742  __Pyx_RefNannyFinishContext();
3743  return NULL;
3744  __pyx_L4_argument_unpacking_done:;
3745  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(1, 94, __pyx_L1_error)
3746  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isModelVert), __pyx_ptype_5numpy_ndarray, 1, "isModelVert", 0))) __PYX_ERR(1, 94, __pyx_L1_error)
3747  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bFaces), __pyx_ptype_5numpy_ndarray, 1, "bFaces", 0))) __PYX_ERR(1, 95, __pyx_L1_error)
3748  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_28reconstructFromProteus2(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), __pyx_v_cmesh, __pyx_v_isModelVert, __pyx_v_bFaces);
3749 
3750  /* function exit code */
3751  goto __pyx_L0;
3752  __pyx_L1_error:;
3753  __pyx_r = NULL;
3754  __pyx_L0:;
3755  __Pyx_RefNannyFinishContext();
3756  return __pyx_r;
3757 }
3758 
3759 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_28reconstructFromProteus2(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, PyArrayObject *__pyx_v_isModelVert, PyArrayObject *__pyx_v_bFaces) {
3760  __Pyx_LocalBuf_ND __pyx_pybuffernd_bFaces;
3761  __Pyx_Buffer __pyx_pybuffer_bFaces;
3762  __Pyx_LocalBuf_ND __pyx_pybuffernd_isModelVert;
3763  __Pyx_Buffer __pyx_pybuffer_isModelVert;
3764  PyObject *__pyx_r = NULL;
3765  __Pyx_RefNannyDeclarations
3766  PyObject *__pyx_t_1 = NULL;
3767  PyObject *__pyx_t_2 = NULL;
3768  PyObject *__pyx_t_3 = NULL;
3769  PyArrayObject *__pyx_t_4 = NULL;
3770  int __pyx_t_5;
3771  PyObject *__pyx_t_6 = NULL;
3772  PyObject *__pyx_t_7 = NULL;
3773  PyObject *__pyx_t_8 = NULL;
3774  Py_ssize_t __pyx_t_9;
3775  int __pyx_lineno = 0;
3776  const char *__pyx_filename = NULL;
3777  int __pyx_clineno = 0;
3778  __Pyx_RefNannySetupContext("reconstructFromProteus2", 0);
3779  __Pyx_INCREF((PyObject *)__pyx_v_isModelVert);
3780  __pyx_pybuffer_isModelVert.pybuffer.buf = NULL;
3781  __pyx_pybuffer_isModelVert.refcount = 0;
3782  __pyx_pybuffernd_isModelVert.data = NULL;
3783  __pyx_pybuffernd_isModelVert.rcbuffer = &__pyx_pybuffer_isModelVert;
3784  __pyx_pybuffer_bFaces.pybuffer.buf = NULL;
3785  __pyx_pybuffer_bFaces.refcount = 0;
3786  __pyx_pybuffernd_bFaces.data = NULL;
3787  __pyx_pybuffernd_bFaces.rcbuffer = &__pyx_pybuffer_bFaces;
3788  {
3789  __Pyx_BufFmt_StackElem __pyx_stack[1];
3790  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_isModelVert.rcbuffer->pybuffer, (PyObject*)__pyx_v_isModelVert, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 94, __pyx_L1_error)
3791  }
3792  __pyx_pybuffernd_isModelVert.diminfo[0].strides = __pyx_pybuffernd_isModelVert.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_isModelVert.diminfo[0].shape = __pyx_pybuffernd_isModelVert.rcbuffer->pybuffer.shape[0];
3793  {
3794  __Pyx_BufFmt_StackElem __pyx_stack[1];
3795  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bFaces.rcbuffer->pybuffer, (PyObject*)__pyx_v_bFaces, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 94, __pyx_L1_error)
3796  }
3797  __pyx_pybuffernd_bFaces.diminfo[0].strides = __pyx_pybuffernd_bFaces.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bFaces.diminfo[0].shape = __pyx_pybuffernd_bFaces.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_bFaces.diminfo[1].strides = __pyx_pybuffernd_bFaces.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_bFaces.diminfo[1].shape = __pyx_pybuffernd_bFaces.rcbuffer->pybuffer.shape[1];
3798 
3799  /* "MeshAdaptPUMI/MeshAdapt.pyx":96
3800  * def reconstructFromProteus2(self,cmeshTools.CMesh cmesh,np.ndarray[int,ndim=1,mode="c"] isModelVert,
3801  * np.ndarray[int,ndim=2,mode="c"] bFaces):
3802  * isModelVert = np.ascontiguousarray(isModelVert) # <<<<<<<<<<<<<<
3803  * return self.thisptr.reconstructFromProteus2(cmesh.mesh,&isModelVert[0], <int *> bFaces.data)
3804  * def constructFromSerialPUMIMesh(self, cmeshTools.CMesh cmesh):
3805  */
3806  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 96, __pyx_L1_error)
3807  __Pyx_GOTREF(__pyx_t_2);
3808  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 96, __pyx_L1_error)
3809  __Pyx_GOTREF(__pyx_t_3);
3810  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3811  __pyx_t_2 = NULL;
3812  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3813  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3814  if (likely(__pyx_t_2)) {
3815  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3816  __Pyx_INCREF(__pyx_t_2);
3817  __Pyx_INCREF(function);
3818  __Pyx_DECREF_SET(__pyx_t_3, function);
3819  }
3820  }
3821  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_isModelVert)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_isModelVert));
3822  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3823  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error)
3824  __Pyx_GOTREF(__pyx_t_1);
3825  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3826  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 96, __pyx_L1_error)
3827  __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
3828  {
3829  __Pyx_BufFmt_StackElem __pyx_stack[1];
3830  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_isModelVert.rcbuffer->pybuffer);
3831  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_isModelVert.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
3832  if (unlikely(__pyx_t_5 < 0)) {
3833  PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
3834  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_isModelVert.rcbuffer->pybuffer, (PyObject*)__pyx_v_isModelVert, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
3835  Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
3836  __Pyx_RaiseBufferFallbackError();
3837  } else {
3838  PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3839  }
3840  __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
3841  }
3842  __pyx_pybuffernd_isModelVert.diminfo[0].strides = __pyx_pybuffernd_isModelVert.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_isModelVert.diminfo[0].shape = __pyx_pybuffernd_isModelVert.rcbuffer->pybuffer.shape[0];
3843  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 96, __pyx_L1_error)
3844  }
3845  __pyx_t_4 = 0;
3846  __Pyx_DECREF_SET(__pyx_v_isModelVert, ((PyArrayObject *)__pyx_t_1));
3847  __pyx_t_1 = 0;
3848 
3849  /* "MeshAdaptPUMI/MeshAdapt.pyx":97
3850  * np.ndarray[int,ndim=2,mode="c"] bFaces):
3851  * isModelVert = np.ascontiguousarray(isModelVert)
3852  * return self.thisptr.reconstructFromProteus2(cmesh.mesh,&isModelVert[0], <int *> bFaces.data) # <<<<<<<<<<<<<<
3853  * def constructFromSerialPUMIMesh(self, cmeshTools.CMesh cmesh):
3854  * return self.thisptr.constructFromSerialPUMIMesh(cmesh.mesh)
3855  */
3856  __Pyx_XDECREF(__pyx_r);
3857  __pyx_t_9 = 0;
3858  __pyx_t_5 = -1;
3859  if (__pyx_t_9 < 0) {
3860  __pyx_t_9 += __pyx_pybuffernd_isModelVert.diminfo[0].shape;
3861  if (unlikely(__pyx_t_9 < 0)) __pyx_t_5 = 0;
3862  } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_isModelVert.diminfo[0].shape)) __pyx_t_5 = 0;
3863  if (unlikely(__pyx_t_5 != -1)) {
3864  __Pyx_RaiseBufferIndexError(__pyx_t_5);
3865  __PYX_ERR(1, 97, __pyx_L1_error)
3866  }
3867  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->reconstructFromProteus2(__pyx_v_cmesh->mesh, (&(*__Pyx_BufPtrCContig1d(int *, __pyx_pybuffernd_isModelVert.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_isModelVert.diminfo[0].strides))), ((int *)__pyx_v_bFaces->data))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 97, __pyx_L1_error)
3868  __Pyx_GOTREF(__pyx_t_1);
3869  __pyx_r = __pyx_t_1;
3870  __pyx_t_1 = 0;
3871  goto __pyx_L0;
3872 
3873  /* "MeshAdaptPUMI/MeshAdapt.pyx":94
3874  * def reconstructFromProteus(self,cmeshTools.CMesh cmesh,cmeshTools.CMesh global_cmesh,hasModel=0):
3875  * return self.thisptr.reconstructFromProteus(cmesh.mesh,global_cmesh.mesh,hasModel)
3876  * def reconstructFromProteus2(self,cmeshTools.CMesh cmesh,np.ndarray[int,ndim=1,mode="c"] isModelVert, # <<<<<<<<<<<<<<
3877  * np.ndarray[int,ndim=2,mode="c"] bFaces):
3878  * isModelVert = np.ascontiguousarray(isModelVert)
3879  */
3880 
3881  /* function exit code */
3882  __pyx_L1_error:;
3883  __Pyx_XDECREF(__pyx_t_1);
3884  __Pyx_XDECREF(__pyx_t_2);
3885  __Pyx_XDECREF(__pyx_t_3);
3886  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3887  __Pyx_PyThreadState_declare
3888  __Pyx_PyThreadState_assign
3889  __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3890  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bFaces.rcbuffer->pybuffer);
3891  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_isModelVert.rcbuffer->pybuffer);
3892  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3893  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.reconstructFromProteus2", __pyx_clineno, __pyx_lineno, __pyx_filename);
3894  __pyx_r = NULL;
3895  goto __pyx_L2;
3896  __pyx_L0:;
3897  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bFaces.rcbuffer->pybuffer);
3898  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_isModelVert.rcbuffer->pybuffer);
3899  __pyx_L2:;
3900  __Pyx_XDECREF((PyObject *)__pyx_v_isModelVert);
3901  __Pyx_XGIVEREF(__pyx_r);
3902  __Pyx_RefNannyFinishContext();
3903  return __pyx_r;
3904 }
3905 
3906 /* "MeshAdaptPUMI/MeshAdapt.pyx":98
3907  * isModelVert = np.ascontiguousarray(isModelVert)
3908  * return self.thisptr.reconstructFromProteus2(cmesh.mesh,&isModelVert[0], <int *> bFaces.data)
3909  * def constructFromSerialPUMIMesh(self, cmeshTools.CMesh cmesh): # <<<<<<<<<<<<<<
3910  * return self.thisptr.constructFromSerialPUMIMesh(cmesh.mesh)
3911  * def constructFromParallelPUMIMesh(self, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3912  */
3913 
3914 /* Python wrapper */
3915 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_31constructFromSerialPUMIMesh(PyObject *__pyx_v_self, PyObject *__pyx_v_cmesh); /*proto*/
3916 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_31constructFromSerialPUMIMesh(PyObject *__pyx_v_self, PyObject *__pyx_v_cmesh) {
3917  int __pyx_lineno = 0;
3918  const char *__pyx_filename = NULL;
3919  int __pyx_clineno = 0;
3920  PyObject *__pyx_r = 0;
3921  __Pyx_RefNannyDeclarations
3922  __Pyx_RefNannySetupContext("constructFromSerialPUMIMesh (wrapper)", 0);
3923  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(1, 98, __pyx_L1_error)
3924  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_30constructFromSerialPUMIMesh(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)__pyx_v_cmesh));
3925 
3926  /* function exit code */
3927  goto __pyx_L0;
3928  __pyx_L1_error:;
3929  __pyx_r = NULL;
3930  __pyx_L0:;
3931  __Pyx_RefNannyFinishContext();
3932  return __pyx_r;
3933 }
3934 
3935 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_30constructFromSerialPUMIMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh) {
3936  PyObject *__pyx_r = NULL;
3937  __Pyx_RefNannyDeclarations
3938  PyObject *__pyx_t_1 = NULL;
3939  int __pyx_lineno = 0;
3940  const char *__pyx_filename = NULL;
3941  int __pyx_clineno = 0;
3942  __Pyx_RefNannySetupContext("constructFromSerialPUMIMesh", 0);
3943 
3944  /* "MeshAdaptPUMI/MeshAdapt.pyx":99
3945  * return self.thisptr.reconstructFromProteus2(cmesh.mesh,&isModelVert[0], <int *> bFaces.data)
3946  * def constructFromSerialPUMIMesh(self, cmeshTools.CMesh cmesh):
3947  * return self.thisptr.constructFromSerialPUMIMesh(cmesh.mesh) # <<<<<<<<<<<<<<
3948  * def constructFromParallelPUMIMesh(self, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3949  * return self.thisptr.constructFromParallelPUMIMesh(cmesh.mesh, subdomain_cmesh.mesh)
3950  */
3951  __Pyx_XDECREF(__pyx_r);
3952  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->constructFromSerialPUMIMesh(__pyx_v_cmesh->mesh)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 99, __pyx_L1_error)
3953  __Pyx_GOTREF(__pyx_t_1);
3954  __pyx_r = __pyx_t_1;
3955  __pyx_t_1 = 0;
3956  goto __pyx_L0;
3957 
3958  /* "MeshAdaptPUMI/MeshAdapt.pyx":98
3959  * isModelVert = np.ascontiguousarray(isModelVert)
3960  * return self.thisptr.reconstructFromProteus2(cmesh.mesh,&isModelVert[0], <int *> bFaces.data)
3961  * def constructFromSerialPUMIMesh(self, cmeshTools.CMesh cmesh): # <<<<<<<<<<<<<<
3962  * return self.thisptr.constructFromSerialPUMIMesh(cmesh.mesh)
3963  * def constructFromParallelPUMIMesh(self, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3964  */
3965 
3966  /* function exit code */
3967  __pyx_L1_error:;
3968  __Pyx_XDECREF(__pyx_t_1);
3969  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.constructFromSerialPUMIMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
3970  __pyx_r = NULL;
3971  __pyx_L0:;
3972  __Pyx_XGIVEREF(__pyx_r);
3973  __Pyx_RefNannyFinishContext();
3974  return __pyx_r;
3975 }
3976 
3977 /* "MeshAdaptPUMI/MeshAdapt.pyx":100
3978  * def constructFromSerialPUMIMesh(self, cmeshTools.CMesh cmesh):
3979  * return self.thisptr.constructFromSerialPUMIMesh(cmesh.mesh)
3980  * def constructFromParallelPUMIMesh(self, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3981  * return self.thisptr.constructFromParallelPUMIMesh(cmesh.mesh, subdomain_cmesh.mesh)
3982  * def updateMaterialArrays(self, cmeshTools.CMesh cmesh, dim=None,bdryId=None, geomTag=None):
3983  */
3984 
3985 /* Python wrapper */
3986 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_33constructFromParallelPUMIMesh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3987 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_33constructFromParallelPUMIMesh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3988  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3989  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3990  int __pyx_lineno = 0;
3991  const char *__pyx_filename = NULL;
3992  int __pyx_clineno = 0;
3993  PyObject *__pyx_r = 0;
3994  __Pyx_RefNannyDeclarations
3995  __Pyx_RefNannySetupContext("constructFromParallelPUMIMesh (wrapper)", 0);
3996  {
3997  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3998  PyObject* values[2] = {0,0};
3999  if (unlikely(__pyx_kwds)) {
4000  Py_ssize_t kw_args;
4001  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4002  switch (pos_args) {
4003  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4004  CYTHON_FALLTHROUGH;
4005  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4006  CYTHON_FALLTHROUGH;
4007  case 0: break;
4008  default: goto __pyx_L5_argtuple_error;
4009  }
4010  kw_args = PyDict_Size(__pyx_kwds);
4011  switch (pos_args) {
4012  case 0:
4013  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4014  else goto __pyx_L5_argtuple_error;
4015  CYTHON_FALLTHROUGH;
4016  case 1:
4017  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4018  else {
4019  __Pyx_RaiseArgtupleInvalid("constructFromParallelPUMIMesh", 1, 2, 2, 1); __PYX_ERR(1, 100, __pyx_L3_error)
4020  }
4021  }
4022  if (unlikely(kw_args > 0)) {
4023  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "constructFromParallelPUMIMesh") < 0)) __PYX_ERR(1, 100, __pyx_L3_error)
4024  }
4025  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4026  goto __pyx_L5_argtuple_error;
4027  } else {
4028  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4029  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4030  }
4031  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[0]);
4032  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[1]);
4033  }
4034  goto __pyx_L4_argument_unpacking_done;
4035  __pyx_L5_argtuple_error:;
4036  __Pyx_RaiseArgtupleInvalid("constructFromParallelPUMIMesh", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 100, __pyx_L3_error)
4037  __pyx_L3_error:;
4038  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.constructFromParallelPUMIMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
4039  __Pyx_RefNannyFinishContext();
4040  return NULL;
4041  __pyx_L4_argument_unpacking_done:;
4042  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(1, 100, __pyx_L1_error)
4043  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(1, 100, __pyx_L1_error)
4044  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_32constructFromParallelPUMIMesh(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4045 
4046  /* function exit code */
4047  goto __pyx_L0;
4048  __pyx_L1_error:;
4049  __pyx_r = NULL;
4050  __pyx_L0:;
4051  __Pyx_RefNannyFinishContext();
4052  return __pyx_r;
4053 }
4054 
4055 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_32constructFromParallelPUMIMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4056  PyObject *__pyx_r = NULL;
4057  __Pyx_RefNannyDeclarations
4058  PyObject *__pyx_t_1 = NULL;
4059  int __pyx_lineno = 0;
4060  const char *__pyx_filename = NULL;
4061  int __pyx_clineno = 0;
4062  __Pyx_RefNannySetupContext("constructFromParallelPUMIMesh", 0);
4063 
4064  /* "MeshAdaptPUMI/MeshAdapt.pyx":101
4065  * return self.thisptr.constructFromSerialPUMIMesh(cmesh.mesh)
4066  * def constructFromParallelPUMIMesh(self, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4067  * return self.thisptr.constructFromParallelPUMIMesh(cmesh.mesh, subdomain_cmesh.mesh) # <<<<<<<<<<<<<<
4068  * def updateMaterialArrays(self, cmeshTools.CMesh cmesh, dim=None,bdryId=None, geomTag=None):
4069  * if(dim is None):
4070  */
4071  __Pyx_XDECREF(__pyx_r);
4072  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->constructFromParallelPUMIMesh(__pyx_v_cmesh->mesh, __pyx_v_subdomain_cmesh->mesh)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 101, __pyx_L1_error)
4073  __Pyx_GOTREF(__pyx_t_1);
4074  __pyx_r = __pyx_t_1;
4075  __pyx_t_1 = 0;
4076  goto __pyx_L0;
4077 
4078  /* "MeshAdaptPUMI/MeshAdapt.pyx":100
4079  * def constructFromSerialPUMIMesh(self, cmeshTools.CMesh cmesh):
4080  * return self.thisptr.constructFromSerialPUMIMesh(cmesh.mesh)
4081  * def constructFromParallelPUMIMesh(self, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4082  * return self.thisptr.constructFromParallelPUMIMesh(cmesh.mesh, subdomain_cmesh.mesh)
4083  * def updateMaterialArrays(self, cmeshTools.CMesh cmesh, dim=None,bdryId=None, geomTag=None):
4084  */
4085 
4086  /* function exit code */
4087  __pyx_L1_error:;
4088  __Pyx_XDECREF(__pyx_t_1);
4089  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.constructFromParallelPUMIMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
4090  __pyx_r = NULL;
4091  __pyx_L0:;
4092  __Pyx_XGIVEREF(__pyx_r);
4093  __Pyx_RefNannyFinishContext();
4094  return __pyx_r;
4095 }
4096 
4097 /* "MeshAdaptPUMI/MeshAdapt.pyx":102
4098  * def constructFromParallelPUMIMesh(self, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4099  * return self.thisptr.constructFromParallelPUMIMesh(cmesh.mesh, subdomain_cmesh.mesh)
4100  * def updateMaterialArrays(self, cmeshTools.CMesh cmesh, dim=None,bdryId=None, geomTag=None): # <<<<<<<<<<<<<<
4101  * if(dim is None):
4102  * return self.thisptr.updateMaterialArrays(cmesh.mesh)
4103  */
4104 
4105 /* Python wrapper */
4106 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_35updateMaterialArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4107 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_35updateMaterialArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4108  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4109  PyObject *__pyx_v_dim = 0;
4110  PyObject *__pyx_v_bdryId = 0;
4111  PyObject *__pyx_v_geomTag = 0;
4112  int __pyx_lineno = 0;
4113  const char *__pyx_filename = NULL;
4114  int __pyx_clineno = 0;
4115  PyObject *__pyx_r = 0;
4116  __Pyx_RefNannyDeclarations
4117  __Pyx_RefNannySetupContext("updateMaterialArrays (wrapper)", 0);
4118  {
4119  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cmesh,&__pyx_n_s_dim,&__pyx_n_s_bdryId,&__pyx_n_s_geomTag,0};
4120  PyObject* values[4] = {0,0,0,0};
4121  values[1] = ((PyObject *)Py_None);
4122  values[2] = ((PyObject *)Py_None);
4123  values[3] = ((PyObject *)Py_None);
4124  if (unlikely(__pyx_kwds)) {
4125  Py_ssize_t kw_args;
4126  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4127  switch (pos_args) {
4128  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4129  CYTHON_FALLTHROUGH;
4130  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4131  CYTHON_FALLTHROUGH;
4132  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4133  CYTHON_FALLTHROUGH;
4134  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4135  CYTHON_FALLTHROUGH;
4136  case 0: break;
4137  default: goto __pyx_L5_argtuple_error;
4138  }
4139  kw_args = PyDict_Size(__pyx_kwds);
4140  switch (pos_args) {
4141  case 0:
4142  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4143  else goto __pyx_L5_argtuple_error;
4144  CYTHON_FALLTHROUGH;
4145  case 1:
4146  if (kw_args > 0) {
4147  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim);
4148  if (value) { values[1] = value; kw_args--; }
4149  }
4150  CYTHON_FALLTHROUGH;
4151  case 2:
4152  if (kw_args > 0) {
4153  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bdryId);
4154  if (value) { values[2] = value; kw_args--; }
4155  }
4156  CYTHON_FALLTHROUGH;
4157  case 3:
4158  if (kw_args > 0) {
4159  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_geomTag);
4160  if (value) { values[3] = value; kw_args--; }
4161  }
4162  }
4163  if (unlikely(kw_args > 0)) {
4164  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "updateMaterialArrays") < 0)) __PYX_ERR(1, 102, __pyx_L3_error)
4165  }
4166  } else {
4167  switch (PyTuple_GET_SIZE(__pyx_args)) {
4168  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4169  CYTHON_FALLTHROUGH;
4170  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4171  CYTHON_FALLTHROUGH;
4172  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4173  CYTHON_FALLTHROUGH;
4174  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4175  break;
4176  default: goto __pyx_L5_argtuple_error;
4177  }
4178  }
4179  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[0]);
4180  __pyx_v_dim = values[1];
4181  __pyx_v_bdryId = values[2];
4182  __pyx_v_geomTag = values[3];
4183  }
4184  goto __pyx_L4_argument_unpacking_done;
4185  __pyx_L5_argtuple_error:;
4186  __Pyx_RaiseArgtupleInvalid("updateMaterialArrays", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 102, __pyx_L3_error)
4187  __pyx_L3_error:;
4188  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.updateMaterialArrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
4189  __Pyx_RefNannyFinishContext();
4190  return NULL;
4191  __pyx_L4_argument_unpacking_done:;
4192  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(1, 102, __pyx_L1_error)
4193  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_34updateMaterialArrays(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), __pyx_v_cmesh, __pyx_v_dim, __pyx_v_bdryId, __pyx_v_geomTag);
4194 
4195  /* function exit code */
4196  goto __pyx_L0;
4197  __pyx_L1_error:;
4198  __pyx_r = NULL;
4199  __pyx_L0:;
4200  __Pyx_RefNannyFinishContext();
4201  return __pyx_r;
4202 }
4203 
4204 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_34updateMaterialArrays(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, PyObject *__pyx_v_dim, PyObject *__pyx_v_bdryId, PyObject *__pyx_v_geomTag) {
4205  PyObject *__pyx_r = NULL;
4206  __Pyx_RefNannyDeclarations
4207  int __pyx_t_1;
4208  int __pyx_t_2;
4209  PyObject *__pyx_t_3 = NULL;
4210  int __pyx_t_4;
4211  int __pyx_t_5;
4212  int __pyx_t_6;
4213  int __pyx_lineno = 0;
4214  const char *__pyx_filename = NULL;
4215  int __pyx_clineno = 0;
4216  __Pyx_RefNannySetupContext("updateMaterialArrays", 0);
4217 
4218  /* "MeshAdaptPUMI/MeshAdapt.pyx":103
4219  * return self.thisptr.constructFromParallelPUMIMesh(cmesh.mesh, subdomain_cmesh.mesh)
4220  * def updateMaterialArrays(self, cmeshTools.CMesh cmesh, dim=None,bdryId=None, geomTag=None):
4221  * if(dim is None): # <<<<<<<<<<<<<<
4222  * return self.thisptr.updateMaterialArrays(cmesh.mesh)
4223  * else:
4224  */
4225  __pyx_t_1 = (__pyx_v_dim == Py_None);
4226  __pyx_t_2 = (__pyx_t_1 != 0);
4227  if (__pyx_t_2) {
4228 
4229  /* "MeshAdaptPUMI/MeshAdapt.pyx":104
4230  * def updateMaterialArrays(self, cmeshTools.CMesh cmesh, dim=None,bdryId=None, geomTag=None):
4231  * if(dim is None):
4232  * return self.thisptr.updateMaterialArrays(cmesh.mesh) # <<<<<<<<<<<<<<
4233  * else:
4234  * return self.thisptr.updateMaterialArrays(cmesh.mesh,dim, bdryId, geomTag)
4235  */
4236  __Pyx_XDECREF(__pyx_r);
4237  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->updateMaterialArrays(__pyx_v_cmesh->mesh)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error)
4238  __Pyx_GOTREF(__pyx_t_3);
4239  __pyx_r = __pyx_t_3;
4240  __pyx_t_3 = 0;
4241  goto __pyx_L0;
4242 
4243  /* "MeshAdaptPUMI/MeshAdapt.pyx":103
4244  * return self.thisptr.constructFromParallelPUMIMesh(cmesh.mesh, subdomain_cmesh.mesh)
4245  * def updateMaterialArrays(self, cmeshTools.CMesh cmesh, dim=None,bdryId=None, geomTag=None):
4246  * if(dim is None): # <<<<<<<<<<<<<<
4247  * return self.thisptr.updateMaterialArrays(cmesh.mesh)
4248  * else:
4249  */
4250  }
4251 
4252  /* "MeshAdaptPUMI/MeshAdapt.pyx":106
4253  * return self.thisptr.updateMaterialArrays(cmesh.mesh)
4254  * else:
4255  * return self.thisptr.updateMaterialArrays(cmesh.mesh,dim, bdryId, geomTag) # <<<<<<<<<<<<<<
4256  * def updateMaterialArrays2(self, cmeshTools.CMesh cmesh):
4257  * return self.thisptr.updateMaterialArrays2(cmesh.mesh)
4258  */
4259  /*else*/ {
4260  __Pyx_XDECREF(__pyx_r);
4261  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 106, __pyx_L1_error)
4262  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_bdryId); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 106, __pyx_L1_error)
4263  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_geomTag); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 106, __pyx_L1_error)
4264  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->updateMaterialArrays(__pyx_v_cmesh->mesh, __pyx_t_4, __pyx_t_5, __pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 106, __pyx_L1_error)
4265  __Pyx_GOTREF(__pyx_t_3);
4266  __pyx_r = __pyx_t_3;
4267  __pyx_t_3 = 0;
4268  goto __pyx_L0;
4269  }
4270 
4271  /* "MeshAdaptPUMI/MeshAdapt.pyx":102
4272  * def constructFromParallelPUMIMesh(self, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4273  * return self.thisptr.constructFromParallelPUMIMesh(cmesh.mesh, subdomain_cmesh.mesh)
4274  * def updateMaterialArrays(self, cmeshTools.CMesh cmesh, dim=None,bdryId=None, geomTag=None): # <<<<<<<<<<<<<<
4275  * if(dim is None):
4276  * return self.thisptr.updateMaterialArrays(cmesh.mesh)
4277  */
4278 
4279  /* function exit code */
4280  __pyx_L1_error:;
4281  __Pyx_XDECREF(__pyx_t_3);
4282  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.updateMaterialArrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
4283  __pyx_r = NULL;
4284  __pyx_L0:;
4285  __Pyx_XGIVEREF(__pyx_r);
4286  __Pyx_RefNannyFinishContext();
4287  return __pyx_r;
4288 }
4289 
4290 /* "MeshAdaptPUMI/MeshAdapt.pyx":107
4291  * else:
4292  * return self.thisptr.updateMaterialArrays(cmesh.mesh,dim, bdryId, geomTag)
4293  * def updateMaterialArrays2(self, cmeshTools.CMesh cmesh): # <<<<<<<<<<<<<<
4294  * return self.thisptr.updateMaterialArrays2(cmesh.mesh)
4295  * def transferFieldToPUMI(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] inArray):
4296  */
4297 
4298 /* Python wrapper */
4299 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_37updateMaterialArrays2(PyObject *__pyx_v_self, PyObject *__pyx_v_cmesh); /*proto*/
4300 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_37updateMaterialArrays2(PyObject *__pyx_v_self, PyObject *__pyx_v_cmesh) {
4301  int __pyx_lineno = 0;
4302  const char *__pyx_filename = NULL;
4303  int __pyx_clineno = 0;
4304  PyObject *__pyx_r = 0;
4305  __Pyx_RefNannyDeclarations
4306  __Pyx_RefNannySetupContext("updateMaterialArrays2 (wrapper)", 0);
4307  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(1, 107, __pyx_L1_error)
4308  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_36updateMaterialArrays2(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)__pyx_v_cmesh));
4309 
4310  /* function exit code */
4311  goto __pyx_L0;
4312  __pyx_L1_error:;
4313  __pyx_r = NULL;
4314  __pyx_L0:;
4315  __Pyx_RefNannyFinishContext();
4316  return __pyx_r;
4317 }
4318 
4319 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_36updateMaterialArrays2(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh) {
4320  PyObject *__pyx_r = NULL;
4321  __Pyx_RefNannyDeclarations
4322  PyObject *__pyx_t_1 = NULL;
4323  int __pyx_lineno = 0;
4324  const char *__pyx_filename = NULL;
4325  int __pyx_clineno = 0;
4326  __Pyx_RefNannySetupContext("updateMaterialArrays2", 0);
4327 
4328  /* "MeshAdaptPUMI/MeshAdapt.pyx":108
4329  * return self.thisptr.updateMaterialArrays(cmesh.mesh,dim, bdryId, geomTag)
4330  * def updateMaterialArrays2(self, cmeshTools.CMesh cmesh):
4331  * return self.thisptr.updateMaterialArrays2(cmesh.mesh) # <<<<<<<<<<<<<<
4332  * def transferFieldToPUMI(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] inArray):
4333  * inArray = np.ascontiguousarray(inArray)
4334  */
4335  __Pyx_XDECREF(__pyx_r);
4336  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->updateMaterialArrays2(__pyx_v_cmesh->mesh)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 108, __pyx_L1_error)
4337  __Pyx_GOTREF(__pyx_t_1);
4338  __pyx_r = __pyx_t_1;
4339  __pyx_t_1 = 0;
4340  goto __pyx_L0;
4341 
4342  /* "MeshAdaptPUMI/MeshAdapt.pyx":107
4343  * else:
4344  * return self.thisptr.updateMaterialArrays(cmesh.mesh,dim, bdryId, geomTag)
4345  * def updateMaterialArrays2(self, cmeshTools.CMesh cmesh): # <<<<<<<<<<<<<<
4346  * return self.thisptr.updateMaterialArrays2(cmesh.mesh)
4347  * def transferFieldToPUMI(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] inArray):
4348  */
4349 
4350  /* function exit code */
4351  __pyx_L1_error:;
4352  __Pyx_XDECREF(__pyx_t_1);
4353  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.updateMaterialArrays2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4354  __pyx_r = NULL;
4355  __pyx_L0:;
4356  __Pyx_XGIVEREF(__pyx_r);
4357  __Pyx_RefNannyFinishContext();
4358  return __pyx_r;
4359 }
4360 
4361 /* "MeshAdaptPUMI/MeshAdapt.pyx":109
4362  * def updateMaterialArrays2(self, cmeshTools.CMesh cmesh):
4363  * return self.thisptr.updateMaterialArrays2(cmesh.mesh)
4364  * def transferFieldToPUMI(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] inArray): # <<<<<<<<<<<<<<
4365  * inArray = np.ascontiguousarray(inArray)
4366  * return self.thisptr.transferFieldToPUMI(name, &inArray[0,0], inArray.shape[1], inArray.shape[0])
4367  */
4368 
4369 /* Python wrapper */
4370 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_39transferFieldToPUMI(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4371 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_39transferFieldToPUMI(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4372  PyObject *__pyx_v_name = 0;
4373  PyArrayObject *__pyx_v_inArray = 0;
4374  int __pyx_lineno = 0;
4375  const char *__pyx_filename = NULL;
4376  int __pyx_clineno = 0;
4377  PyObject *__pyx_r = 0;
4378  __Pyx_RefNannyDeclarations
4379  __Pyx_RefNannySetupContext("transferFieldToPUMI (wrapper)", 0);
4380  {
4381  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_inArray,0};
4382  PyObject* values[2] = {0,0};
4383  if (unlikely(__pyx_kwds)) {
4384  Py_ssize_t kw_args;
4385  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4386  switch (pos_args) {
4387  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4388  CYTHON_FALLTHROUGH;
4389  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4390  CYTHON_FALLTHROUGH;
4391  case 0: break;
4392  default: goto __pyx_L5_argtuple_error;
4393  }
4394  kw_args = PyDict_Size(__pyx_kwds);
4395  switch (pos_args) {
4396  case 0:
4397  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
4398  else goto __pyx_L5_argtuple_error;
4399  CYTHON_FALLTHROUGH;
4400  case 1:
4401  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inArray)) != 0)) kw_args--;
4402  else {
4403  __Pyx_RaiseArgtupleInvalid("transferFieldToPUMI", 1, 2, 2, 1); __PYX_ERR(1, 109, __pyx_L3_error)
4404  }
4405  }
4406  if (unlikely(kw_args > 0)) {
4407  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "transferFieldToPUMI") < 0)) __PYX_ERR(1, 109, __pyx_L3_error)
4408  }
4409  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4410  goto __pyx_L5_argtuple_error;
4411  } else {
4412  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4413  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4414  }
4415  __pyx_v_name = values[0];
4416  __pyx_v_inArray = ((PyArrayObject *)values[1]);
4417  }
4418  goto __pyx_L4_argument_unpacking_done;
4419  __pyx_L5_argtuple_error:;
4420  __Pyx_RaiseArgtupleInvalid("transferFieldToPUMI", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 109, __pyx_L3_error)
4421  __pyx_L3_error:;
4422  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferFieldToPUMI", __pyx_clineno, __pyx_lineno, __pyx_filename);
4423  __Pyx_RefNannyFinishContext();
4424  return NULL;
4425  __pyx_L4_argument_unpacking_done:;
4426  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_inArray), __pyx_ptype_5numpy_ndarray, 1, "inArray", 0))) __PYX_ERR(1, 109, __pyx_L1_error)
4427  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_38transferFieldToPUMI(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), __pyx_v_name, __pyx_v_inArray);
4428 
4429  /* function exit code */
4430  goto __pyx_L0;
4431  __pyx_L1_error:;
4432  __pyx_r = NULL;
4433  __pyx_L0:;
4434  __Pyx_RefNannyFinishContext();
4435  return __pyx_r;
4436 }
4437 
4438 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_38transferFieldToPUMI(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_name, PyArrayObject *__pyx_v_inArray) {
4439  __Pyx_LocalBuf_ND __pyx_pybuffernd_inArray;
4440  __Pyx_Buffer __pyx_pybuffer_inArray;
4441  PyObject *__pyx_r = NULL;
4442  __Pyx_RefNannyDeclarations
4443  PyObject *__pyx_t_1 = NULL;
4444  PyObject *__pyx_t_2 = NULL;
4445  PyObject *__pyx_t_3 = NULL;
4446  PyArrayObject *__pyx_t_4 = NULL;
4447  int __pyx_t_5;
4448  PyObject *__pyx_t_6 = NULL;
4449  PyObject *__pyx_t_7 = NULL;
4450  PyObject *__pyx_t_8 = NULL;
4451  char *__pyx_t_9;
4452  Py_ssize_t __pyx_t_10;
4453  Py_ssize_t __pyx_t_11;
4454  int __pyx_lineno = 0;
4455  const char *__pyx_filename = NULL;
4456  int __pyx_clineno = 0;
4457  __Pyx_RefNannySetupContext("transferFieldToPUMI", 0);
4458  __Pyx_INCREF((PyObject *)__pyx_v_inArray);
4459  __pyx_pybuffer_inArray.pybuffer.buf = NULL;
4460  __pyx_pybuffer_inArray.refcount = 0;
4461  __pyx_pybuffernd_inArray.data = NULL;
4462  __pyx_pybuffernd_inArray.rcbuffer = &__pyx_pybuffer_inArray;
4463  {
4464  __Pyx_BufFmt_StackElem __pyx_stack[1];
4465  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_inArray, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 109, __pyx_L1_error)
4466  }
4467  __pyx_pybuffernd_inArray.diminfo[0].strides = __pyx_pybuffernd_inArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inArray.diminfo[0].shape = __pyx_pybuffernd_inArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_inArray.diminfo[1].strides = __pyx_pybuffernd_inArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_inArray.diminfo[1].shape = __pyx_pybuffernd_inArray.rcbuffer->pybuffer.shape[1];
4468 
4469  /* "MeshAdaptPUMI/MeshAdapt.pyx":110
4470  * return self.thisptr.updateMaterialArrays2(cmesh.mesh)
4471  * def transferFieldToPUMI(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] inArray):
4472  * inArray = np.ascontiguousarray(inArray) # <<<<<<<<<<<<<<
4473  * return self.thisptr.transferFieldToPUMI(name, &inArray[0,0], inArray.shape[1], inArray.shape[0])
4474  * def transferFieldToProteus(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] outArray):
4475  */
4476  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 110, __pyx_L1_error)
4477  __Pyx_GOTREF(__pyx_t_2);
4478  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 110, __pyx_L1_error)
4479  __Pyx_GOTREF(__pyx_t_3);
4480  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4481  __pyx_t_2 = NULL;
4482  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4483  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4484  if (likely(__pyx_t_2)) {
4485  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4486  __Pyx_INCREF(__pyx_t_2);
4487  __Pyx_INCREF(function);
4488  __Pyx_DECREF_SET(__pyx_t_3, function);
4489  }
4490  }
4491  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_inArray)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_inArray));
4492  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4493  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 110, __pyx_L1_error)
4494  __Pyx_GOTREF(__pyx_t_1);
4495  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4496  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 110, __pyx_L1_error)
4497  __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
4498  {
4499  __Pyx_BufFmt_StackElem __pyx_stack[1];
4500  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inArray.rcbuffer->pybuffer);
4501  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inArray.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
4502  if (unlikely(__pyx_t_5 < 0)) {
4503  PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
4504  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_inArray, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
4505  Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
4506  __Pyx_RaiseBufferFallbackError();
4507  } else {
4508  PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
4509  }
4510  __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
4511  }
4512  __pyx_pybuffernd_inArray.diminfo[0].strides = __pyx_pybuffernd_inArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inArray.diminfo[0].shape = __pyx_pybuffernd_inArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_inArray.diminfo[1].strides = __pyx_pybuffernd_inArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_inArray.diminfo[1].shape = __pyx_pybuffernd_inArray.rcbuffer->pybuffer.shape[1];
4513  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 110, __pyx_L1_error)
4514  }
4515  __pyx_t_4 = 0;
4516  __Pyx_DECREF_SET(__pyx_v_inArray, ((PyArrayObject *)__pyx_t_1));
4517  __pyx_t_1 = 0;
4518 
4519  /* "MeshAdaptPUMI/MeshAdapt.pyx":111
4520  * def transferFieldToPUMI(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] inArray):
4521  * inArray = np.ascontiguousarray(inArray)
4522  * return self.thisptr.transferFieldToPUMI(name, &inArray[0,0], inArray.shape[1], inArray.shape[0]) # <<<<<<<<<<<<<<
4523  * def transferFieldToProteus(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] outArray):
4524  * outArray = np.ascontiguousarray(outArray)
4525  */
4526  __Pyx_XDECREF(__pyx_r);
4527  __pyx_t_9 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(1, 111, __pyx_L1_error)
4528  __pyx_t_10 = 0;
4529  __pyx_t_11 = 0;
4530  __pyx_t_5 = -1;
4531  if (__pyx_t_10 < 0) {
4532  __pyx_t_10 += __pyx_pybuffernd_inArray.diminfo[0].shape;
4533  if (unlikely(__pyx_t_10 < 0)) __pyx_t_5 = 0;
4534  } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_inArray.diminfo[0].shape)) __pyx_t_5 = 0;
4535  if (__pyx_t_11 < 0) {
4536  __pyx_t_11 += __pyx_pybuffernd_inArray.diminfo[1].shape;
4537  if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 1;
4538  } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_inArray.diminfo[1].shape)) __pyx_t_5 = 1;
4539  if (unlikely(__pyx_t_5 != -1)) {
4540  __Pyx_RaiseBufferIndexError(__pyx_t_5);
4541  __PYX_ERR(1, 111, __pyx_L1_error)
4542  }
4543  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->transferFieldToPUMI(__pyx_t_9, (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_inArray.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_inArray.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_inArray.diminfo[1].strides))), (__pyx_v_inArray->dimensions[1]), (__pyx_v_inArray->dimensions[0]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 111, __pyx_L1_error)
4544  __Pyx_GOTREF(__pyx_t_1);
4545  __pyx_r = __pyx_t_1;
4546  __pyx_t_1 = 0;
4547  goto __pyx_L0;
4548 
4549  /* "MeshAdaptPUMI/MeshAdapt.pyx":109
4550  * def updateMaterialArrays2(self, cmeshTools.CMesh cmesh):
4551  * return self.thisptr.updateMaterialArrays2(cmesh.mesh)
4552  * def transferFieldToPUMI(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] inArray): # <<<<<<<<<<<<<<
4553  * inArray = np.ascontiguousarray(inArray)
4554  * return self.thisptr.transferFieldToPUMI(name, &inArray[0,0], inArray.shape[1], inArray.shape[0])
4555  */
4556 
4557  /* function exit code */
4558  __pyx_L1_error:;
4559  __Pyx_XDECREF(__pyx_t_1);
4560  __Pyx_XDECREF(__pyx_t_2);
4561  __Pyx_XDECREF(__pyx_t_3);
4562  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4563  __Pyx_PyThreadState_declare
4564  __Pyx_PyThreadState_assign
4565  __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4566  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inArray.rcbuffer->pybuffer);
4567  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4568  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferFieldToPUMI", __pyx_clineno, __pyx_lineno, __pyx_filename);
4569  __pyx_r = NULL;
4570  goto __pyx_L2;
4571  __pyx_L0:;
4572  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inArray.rcbuffer->pybuffer);
4573  __pyx_L2:;
4574  __Pyx_XDECREF((PyObject *)__pyx_v_inArray);
4575  __Pyx_XGIVEREF(__pyx_r);
4576  __Pyx_RefNannyFinishContext();
4577  return __pyx_r;
4578 }
4579 
4580 /* "MeshAdaptPUMI/MeshAdapt.pyx":112
4581  * inArray = np.ascontiguousarray(inArray)
4582  * return self.thisptr.transferFieldToPUMI(name, &inArray[0,0], inArray.shape[1], inArray.shape[0])
4583  * def transferFieldToProteus(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] outArray): # <<<<<<<<<<<<<<
4584  * outArray = np.ascontiguousarray(outArray)
4585  * return self.thisptr.transferFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0])
4586  */
4587 
4588 /* Python wrapper */
4589 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_41transferFieldToProteus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4590 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_41transferFieldToProteus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4591  PyObject *__pyx_v_name = 0;
4592  PyArrayObject *__pyx_v_outArray = 0;
4593  int __pyx_lineno = 0;
4594  const char *__pyx_filename = NULL;
4595  int __pyx_clineno = 0;
4596  PyObject *__pyx_r = 0;
4597  __Pyx_RefNannyDeclarations
4598  __Pyx_RefNannySetupContext("transferFieldToProteus (wrapper)", 0);
4599  {
4600  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_outArray,0};
4601  PyObject* values[2] = {0,0};
4602  if (unlikely(__pyx_kwds)) {
4603  Py_ssize_t kw_args;
4604  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4605  switch (pos_args) {
4606  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4607  CYTHON_FALLTHROUGH;
4608  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4609  CYTHON_FALLTHROUGH;
4610  case 0: break;
4611  default: goto __pyx_L5_argtuple_error;
4612  }
4613  kw_args = PyDict_Size(__pyx_kwds);
4614  switch (pos_args) {
4615  case 0:
4616  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
4617  else goto __pyx_L5_argtuple_error;
4618  CYTHON_FALLTHROUGH;
4619  case 1:
4620  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outArray)) != 0)) kw_args--;
4621  else {
4622  __Pyx_RaiseArgtupleInvalid("transferFieldToProteus", 1, 2, 2, 1); __PYX_ERR(1, 112, __pyx_L3_error)
4623  }
4624  }
4625  if (unlikely(kw_args > 0)) {
4626  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "transferFieldToProteus") < 0)) __PYX_ERR(1, 112, __pyx_L3_error)
4627  }
4628  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4629  goto __pyx_L5_argtuple_error;
4630  } else {
4631  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4632  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4633  }
4634  __pyx_v_name = values[0];
4635  __pyx_v_outArray = ((PyArrayObject *)values[1]);
4636  }
4637  goto __pyx_L4_argument_unpacking_done;
4638  __pyx_L5_argtuple_error:;
4639  __Pyx_RaiseArgtupleInvalid("transferFieldToProteus", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 112, __pyx_L3_error)
4640  __pyx_L3_error:;
4641  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferFieldToProteus", __pyx_clineno, __pyx_lineno, __pyx_filename);
4642  __Pyx_RefNannyFinishContext();
4643  return NULL;
4644  __pyx_L4_argument_unpacking_done:;
4645  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_outArray), __pyx_ptype_5numpy_ndarray, 1, "outArray", 0))) __PYX_ERR(1, 112, __pyx_L1_error)
4646  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_40transferFieldToProteus(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), __pyx_v_name, __pyx_v_outArray);
4647 
4648  /* function exit code */
4649  goto __pyx_L0;
4650  __pyx_L1_error:;
4651  __pyx_r = NULL;
4652  __pyx_L0:;
4653  __Pyx_RefNannyFinishContext();
4654  return __pyx_r;
4655 }
4656 
4657 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_40transferFieldToProteus(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_name, PyArrayObject *__pyx_v_outArray) {
4658  __Pyx_LocalBuf_ND __pyx_pybuffernd_outArray;
4659  __Pyx_Buffer __pyx_pybuffer_outArray;
4660  PyObject *__pyx_r = NULL;
4661  __Pyx_RefNannyDeclarations
4662  PyObject *__pyx_t_1 = NULL;
4663  PyObject *__pyx_t_2 = NULL;
4664  PyObject *__pyx_t_3 = NULL;
4665  PyArrayObject *__pyx_t_4 = NULL;
4666  int __pyx_t_5;
4667  PyObject *__pyx_t_6 = NULL;
4668  PyObject *__pyx_t_7 = NULL;
4669  PyObject *__pyx_t_8 = NULL;
4670  char *__pyx_t_9;
4671  Py_ssize_t __pyx_t_10;
4672  Py_ssize_t __pyx_t_11;
4673  int __pyx_lineno = 0;
4674  const char *__pyx_filename = NULL;
4675  int __pyx_clineno = 0;
4676  __Pyx_RefNannySetupContext("transferFieldToProteus", 0);
4677  __Pyx_INCREF((PyObject *)__pyx_v_outArray);
4678  __pyx_pybuffer_outArray.pybuffer.buf = NULL;
4679  __pyx_pybuffer_outArray.refcount = 0;
4680  __pyx_pybuffernd_outArray.data = NULL;
4681  __pyx_pybuffernd_outArray.rcbuffer = &__pyx_pybuffer_outArray;
4682  {
4683  __Pyx_BufFmt_StackElem __pyx_stack[1];
4684  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_outArray, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 112, __pyx_L1_error)
4685  }
4686  __pyx_pybuffernd_outArray.diminfo[0].strides = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outArray.diminfo[0].shape = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outArray.diminfo[1].strides = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outArray.diminfo[1].shape = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.shape[1];
4687 
4688  /* "MeshAdaptPUMI/MeshAdapt.pyx":113
4689  * return self.thisptr.transferFieldToPUMI(name, &inArray[0,0], inArray.shape[1], inArray.shape[0])
4690  * def transferFieldToProteus(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] outArray):
4691  * outArray = np.ascontiguousarray(outArray) # <<<<<<<<<<<<<<
4692  * return self.thisptr.transferFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0])
4693  * def transferElementFieldToProteus(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] outArray):
4694  */
4695  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 113, __pyx_L1_error)
4696  __Pyx_GOTREF(__pyx_t_2);
4697  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 113, __pyx_L1_error)
4698  __Pyx_GOTREF(__pyx_t_3);
4699  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4700  __pyx_t_2 = NULL;
4701  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4702  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4703  if (likely(__pyx_t_2)) {
4704  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4705  __Pyx_INCREF(__pyx_t_2);
4706  __Pyx_INCREF(function);
4707  __Pyx_DECREF_SET(__pyx_t_3, function);
4708  }
4709  }
4710  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_outArray)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_outArray));
4711  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4712  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 113, __pyx_L1_error)
4713  __Pyx_GOTREF(__pyx_t_1);
4714  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4715  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 113, __pyx_L1_error)
4716  __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
4717  {
4718  __Pyx_BufFmt_StackElem __pyx_stack[1];
4719  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer);
4720  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
4721  if (unlikely(__pyx_t_5 < 0)) {
4722  PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
4723  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_outArray, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
4724  Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
4725  __Pyx_RaiseBufferFallbackError();
4726  } else {
4727  PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
4728  }
4729  __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
4730  }
4731  __pyx_pybuffernd_outArray.diminfo[0].strides = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outArray.diminfo[0].shape = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outArray.diminfo[1].strides = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outArray.diminfo[1].shape = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.shape[1];
4732  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 113, __pyx_L1_error)
4733  }
4734  __pyx_t_4 = 0;
4735  __Pyx_DECREF_SET(__pyx_v_outArray, ((PyArrayObject *)__pyx_t_1));
4736  __pyx_t_1 = 0;
4737 
4738  /* "MeshAdaptPUMI/MeshAdapt.pyx":114
4739  * def transferFieldToProteus(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] outArray):
4740  * outArray = np.ascontiguousarray(outArray)
4741  * return self.thisptr.transferFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0]) # <<<<<<<<<<<<<<
4742  * def transferElementFieldToProteus(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] outArray):
4743  * outArray = np.ascontiguousarray(outArray)
4744  */
4745  __Pyx_XDECREF(__pyx_r);
4746  __pyx_t_9 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(1, 114, __pyx_L1_error)
4747  __pyx_t_10 = 0;
4748  __pyx_t_11 = 0;
4749  __pyx_t_5 = -1;
4750  if (__pyx_t_10 < 0) {
4751  __pyx_t_10 += __pyx_pybuffernd_outArray.diminfo[0].shape;
4752  if (unlikely(__pyx_t_10 < 0)) __pyx_t_5 = 0;
4753  } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_outArray.diminfo[0].shape)) __pyx_t_5 = 0;
4754  if (__pyx_t_11 < 0) {
4755  __pyx_t_11 += __pyx_pybuffernd_outArray.diminfo[1].shape;
4756  if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 1;
4757  } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_outArray.diminfo[1].shape)) __pyx_t_5 = 1;
4758  if (unlikely(__pyx_t_5 != -1)) {
4759  __Pyx_RaiseBufferIndexError(__pyx_t_5);
4760  __PYX_ERR(1, 114, __pyx_L1_error)
4761  }
4762  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->transferFieldToProteus(__pyx_t_9, (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_outArray.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_outArray.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_outArray.diminfo[1].strides))), (__pyx_v_outArray->dimensions[1]), (__pyx_v_outArray->dimensions[0]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error)
4763  __Pyx_GOTREF(__pyx_t_1);
4764  __pyx_r = __pyx_t_1;
4765  __pyx_t_1 = 0;
4766  goto __pyx_L0;
4767 
4768  /* "MeshAdaptPUMI/MeshAdapt.pyx":112
4769  * inArray = np.ascontiguousarray(inArray)
4770  * return self.thisptr.transferFieldToPUMI(name, &inArray[0,0], inArray.shape[1], inArray.shape[0])
4771  * def transferFieldToProteus(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] outArray): # <<<<<<<<<<<<<<
4772  * outArray = np.ascontiguousarray(outArray)
4773  * return self.thisptr.transferFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0])
4774  */
4775 
4776  /* function exit code */
4777  __pyx_L1_error:;
4778  __Pyx_XDECREF(__pyx_t_1);
4779  __Pyx_XDECREF(__pyx_t_2);
4780  __Pyx_XDECREF(__pyx_t_3);
4781  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4782  __Pyx_PyThreadState_declare
4783  __Pyx_PyThreadState_assign
4784  __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4785  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer);
4786  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4787  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferFieldToProteus", __pyx_clineno, __pyx_lineno, __pyx_filename);
4788  __pyx_r = NULL;
4789  goto __pyx_L2;
4790  __pyx_L0:;
4791  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer);
4792  __pyx_L2:;
4793  __Pyx_XDECREF((PyObject *)__pyx_v_outArray);
4794  __Pyx_XGIVEREF(__pyx_r);
4795  __Pyx_RefNannyFinishContext();
4796  return __pyx_r;
4797 }
4798 
4799 /* "MeshAdaptPUMI/MeshAdapt.pyx":115
4800  * outArray = np.ascontiguousarray(outArray)
4801  * return self.thisptr.transferFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0])
4802  * def transferElementFieldToProteus(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] outArray): # <<<<<<<<<<<<<<
4803  * outArray = np.ascontiguousarray(outArray)
4804  * return self.thisptr.transferElementFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0])
4805  */
4806 
4807 /* Python wrapper */
4808 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_43transferElementFieldToProteus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4809 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_43transferElementFieldToProteus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4810  PyObject *__pyx_v_name = 0;
4811  PyArrayObject *__pyx_v_outArray = 0;
4812  int __pyx_lineno = 0;
4813  const char *__pyx_filename = NULL;
4814  int __pyx_clineno = 0;
4815  PyObject *__pyx_r = 0;
4816  __Pyx_RefNannyDeclarations
4817  __Pyx_RefNannySetupContext("transferElementFieldToProteus (wrapper)", 0);
4818  {
4819  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_outArray,0};
4820  PyObject* values[2] = {0,0};
4821  if (unlikely(__pyx_kwds)) {
4822  Py_ssize_t kw_args;
4823  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4824  switch (pos_args) {
4825  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4826  CYTHON_FALLTHROUGH;
4827  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4828  CYTHON_FALLTHROUGH;
4829  case 0: break;
4830  default: goto __pyx_L5_argtuple_error;
4831  }
4832  kw_args = PyDict_Size(__pyx_kwds);
4833  switch (pos_args) {
4834  case 0:
4835  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
4836  else goto __pyx_L5_argtuple_error;
4837  CYTHON_FALLTHROUGH;
4838  case 1:
4839  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outArray)) != 0)) kw_args--;
4840  else {
4841  __Pyx_RaiseArgtupleInvalid("transferElementFieldToProteus", 1, 2, 2, 1); __PYX_ERR(1, 115, __pyx_L3_error)
4842  }
4843  }
4844  if (unlikely(kw_args > 0)) {
4845  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "transferElementFieldToProteus") < 0)) __PYX_ERR(1, 115, __pyx_L3_error)
4846  }
4847  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4848  goto __pyx_L5_argtuple_error;
4849  } else {
4850  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4851  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4852  }
4853  __pyx_v_name = values[0];
4854  __pyx_v_outArray = ((PyArrayObject *)values[1]);
4855  }
4856  goto __pyx_L4_argument_unpacking_done;
4857  __pyx_L5_argtuple_error:;
4858  __Pyx_RaiseArgtupleInvalid("transferElementFieldToProteus", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 115, __pyx_L3_error)
4859  __pyx_L3_error:;
4860  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferElementFieldToProteus", __pyx_clineno, __pyx_lineno, __pyx_filename);
4861  __Pyx_RefNannyFinishContext();
4862  return NULL;
4863  __pyx_L4_argument_unpacking_done:;
4864  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_outArray), __pyx_ptype_5numpy_ndarray, 1, "outArray", 0))) __PYX_ERR(1, 115, __pyx_L1_error)
4865  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_42transferElementFieldToProteus(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), __pyx_v_name, __pyx_v_outArray);
4866 
4867  /* function exit code */
4868  goto __pyx_L0;
4869  __pyx_L1_error:;
4870  __pyx_r = NULL;
4871  __pyx_L0:;
4872  __Pyx_RefNannyFinishContext();
4873  return __pyx_r;
4874 }
4875 
4876 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_42transferElementFieldToProteus(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_name, PyArrayObject *__pyx_v_outArray) {
4877  __Pyx_LocalBuf_ND __pyx_pybuffernd_outArray;
4878  __Pyx_Buffer __pyx_pybuffer_outArray;
4879  PyObject *__pyx_r = NULL;
4880  __Pyx_RefNannyDeclarations
4881  PyObject *__pyx_t_1 = NULL;
4882  PyObject *__pyx_t_2 = NULL;
4883  PyObject *__pyx_t_3 = NULL;
4884  PyArrayObject *__pyx_t_4 = NULL;
4885  int __pyx_t_5;
4886  PyObject *__pyx_t_6 = NULL;
4887  PyObject *__pyx_t_7 = NULL;
4888  PyObject *__pyx_t_8 = NULL;
4889  char *__pyx_t_9;
4890  Py_ssize_t __pyx_t_10;
4891  Py_ssize_t __pyx_t_11;
4892  int __pyx_lineno = 0;
4893  const char *__pyx_filename = NULL;
4894  int __pyx_clineno = 0;
4895  __Pyx_RefNannySetupContext("transferElementFieldToProteus", 0);
4896  __Pyx_INCREF((PyObject *)__pyx_v_outArray);
4897  __pyx_pybuffer_outArray.pybuffer.buf = NULL;
4898  __pyx_pybuffer_outArray.refcount = 0;
4899  __pyx_pybuffernd_outArray.data = NULL;
4900  __pyx_pybuffernd_outArray.rcbuffer = &__pyx_pybuffer_outArray;
4901  {
4902  __Pyx_BufFmt_StackElem __pyx_stack[1];
4903  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_outArray, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 115, __pyx_L1_error)
4904  }
4905  __pyx_pybuffernd_outArray.diminfo[0].strides = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outArray.diminfo[0].shape = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outArray.diminfo[1].strides = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outArray.diminfo[1].shape = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.shape[1];
4906 
4907  /* "MeshAdaptPUMI/MeshAdapt.pyx":116
4908  * return self.thisptr.transferFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0])
4909  * def transferElementFieldToProteus(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] outArray):
4910  * outArray = np.ascontiguousarray(outArray) # <<<<<<<<<<<<<<
4911  * return self.thisptr.transferElementFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0])
4912  * def transferPropertiesToPUMI(self, np.ndarray[np.double_t,ndim=1,mode="c"] rho, np.ndarray[np.double_t,ndim=1,mode="c"] nu, np.ndarray[np.double_t,ndim=1,mode="c"] g, double deltaT,double deltaT_next, double T_simulation,double interfaceBandSize):
4913  */
4914  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 116, __pyx_L1_error)
4915  __Pyx_GOTREF(__pyx_t_2);
4916  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error)
4917  __Pyx_GOTREF(__pyx_t_3);
4918  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4919  __pyx_t_2 = NULL;
4920  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4921  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4922  if (likely(__pyx_t_2)) {
4923  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4924  __Pyx_INCREF(__pyx_t_2);
4925  __Pyx_INCREF(function);
4926  __Pyx_DECREF_SET(__pyx_t_3, function);
4927  }
4928  }
4929  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_outArray)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_outArray));
4930  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4931  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 116, __pyx_L1_error)
4932  __Pyx_GOTREF(__pyx_t_1);
4933  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4934  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 116, __pyx_L1_error)
4935  __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
4936  {
4937  __Pyx_BufFmt_StackElem __pyx_stack[1];
4938  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer);
4939  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
4940  if (unlikely(__pyx_t_5 < 0)) {
4941  PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
4942  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_outArray, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
4943  Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
4944  __Pyx_RaiseBufferFallbackError();
4945  } else {
4946  PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
4947  }
4948  __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
4949  }
4950  __pyx_pybuffernd_outArray.diminfo[0].strides = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_outArray.diminfo[0].shape = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_outArray.diminfo[1].strides = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_outArray.diminfo[1].shape = __pyx_pybuffernd_outArray.rcbuffer->pybuffer.shape[1];
4951  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 116, __pyx_L1_error)
4952  }
4953  __pyx_t_4 = 0;
4954  __Pyx_DECREF_SET(__pyx_v_outArray, ((PyArrayObject *)__pyx_t_1));
4955  __pyx_t_1 = 0;
4956 
4957  /* "MeshAdaptPUMI/MeshAdapt.pyx":117
4958  * def transferElementFieldToProteus(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] outArray):
4959  * outArray = np.ascontiguousarray(outArray)
4960  * return self.thisptr.transferElementFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0]) # <<<<<<<<<<<<<<
4961  * def transferPropertiesToPUMI(self, np.ndarray[np.double_t,ndim=1,mode="c"] rho, np.ndarray[np.double_t,ndim=1,mode="c"] nu, np.ndarray[np.double_t,ndim=1,mode="c"] g, double deltaT,double deltaT_next, double T_simulation,double interfaceBandSize):
4962  * rho = np.ascontiguousarray(rho)
4963  */
4964  __Pyx_XDECREF(__pyx_r);
4965  __pyx_t_9 = __Pyx_PyObject_AsWritableString(__pyx_v_name); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(1, 117, __pyx_L1_error)
4966  __pyx_t_10 = 0;
4967  __pyx_t_11 = 0;
4968  __pyx_t_5 = -1;
4969  if (__pyx_t_10 < 0) {
4970  __pyx_t_10 += __pyx_pybuffernd_outArray.diminfo[0].shape;
4971  if (unlikely(__pyx_t_10 < 0)) __pyx_t_5 = 0;
4972  } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_outArray.diminfo[0].shape)) __pyx_t_5 = 0;
4973  if (__pyx_t_11 < 0) {
4974  __pyx_t_11 += __pyx_pybuffernd_outArray.diminfo[1].shape;
4975  if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 1;
4976  } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_outArray.diminfo[1].shape)) __pyx_t_5 = 1;
4977  if (unlikely(__pyx_t_5 != -1)) {
4978  __Pyx_RaiseBufferIndexError(__pyx_t_5);
4979  __PYX_ERR(1, 117, __pyx_L1_error)
4980  }
4981  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->transferElementFieldToProteus(__pyx_t_9, (&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_outArray.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_outArray.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_outArray.diminfo[1].strides))), (__pyx_v_outArray->dimensions[1]), (__pyx_v_outArray->dimensions[0]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
4982  __Pyx_GOTREF(__pyx_t_1);
4983  __pyx_r = __pyx_t_1;
4984  __pyx_t_1 = 0;
4985  goto __pyx_L0;
4986 
4987  /* "MeshAdaptPUMI/MeshAdapt.pyx":115
4988  * outArray = np.ascontiguousarray(outArray)
4989  * return self.thisptr.transferFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0])
4990  * def transferElementFieldToProteus(self, name, np.ndarray[np.double_t,ndim=2,mode="c"] outArray): # <<<<<<<<<<<<<<
4991  * outArray = np.ascontiguousarray(outArray)
4992  * return self.thisptr.transferElementFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0])
4993  */
4994 
4995  /* function exit code */
4996  __pyx_L1_error:;
4997  __Pyx_XDECREF(__pyx_t_1);
4998  __Pyx_XDECREF(__pyx_t_2);
4999  __Pyx_XDECREF(__pyx_t_3);
5000  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5001  __Pyx_PyThreadState_declare
5002  __Pyx_PyThreadState_assign
5003  __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5004  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer);
5005  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5006  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferElementFieldToProteus", __pyx_clineno, __pyx_lineno, __pyx_filename);
5007  __pyx_r = NULL;
5008  goto __pyx_L2;
5009  __pyx_L0:;
5010  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer);
5011  __pyx_L2:;
5012  __Pyx_XDECREF((PyObject *)__pyx_v_outArray);
5013  __Pyx_XGIVEREF(__pyx_r);
5014  __Pyx_RefNannyFinishContext();
5015  return __pyx_r;
5016 }
5017 
5018 /* "MeshAdaptPUMI/MeshAdapt.pyx":118
5019  * outArray = np.ascontiguousarray(outArray)
5020  * return self.thisptr.transferElementFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0])
5021  * def transferPropertiesToPUMI(self, np.ndarray[np.double_t,ndim=1,mode="c"] rho, np.ndarray[np.double_t,ndim=1,mode="c"] nu, np.ndarray[np.double_t,ndim=1,mode="c"] g, double deltaT,double deltaT_next, double T_simulation,double interfaceBandSize): # <<<<<<<<<<<<<<
5022  * rho = np.ascontiguousarray(rho)
5023  * nu = np.ascontiguousarray(nu)
5024  */
5025 
5026 /* Python wrapper */
5027 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_45transferPropertiesToPUMI(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5028 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_45transferPropertiesToPUMI(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5029  PyArrayObject *__pyx_v_rho = 0;
5030  PyArrayObject *__pyx_v_nu = 0;
5031  PyArrayObject *__pyx_v_g = 0;
5032  double __pyx_v_deltaT;
5033  double __pyx_v_deltaT_next;
5034  double __pyx_v_T_simulation;
5035  double __pyx_v_interfaceBandSize;
5036  int __pyx_lineno = 0;
5037  const char *__pyx_filename = NULL;
5038  int __pyx_clineno = 0;
5039  PyObject *__pyx_r = 0;
5040  __Pyx_RefNannyDeclarations
5041  __Pyx_RefNannySetupContext("transferPropertiesToPUMI (wrapper)", 0);
5042  {
5043  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_nu,&__pyx_n_s_g,&__pyx_n_s_deltaT,&__pyx_n_s_deltaT_next,&__pyx_n_s_T_simulation,&__pyx_n_s_interfaceBandSize,0};
5044  PyObject* values[7] = {0,0,0,0,0,0,0};
5045  if (unlikely(__pyx_kwds)) {
5046  Py_ssize_t kw_args;
5047  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5048  switch (pos_args) {
5049  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5050  CYTHON_FALLTHROUGH;
5051  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5052  CYTHON_FALLTHROUGH;
5053  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5054  CYTHON_FALLTHROUGH;
5055  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5056  CYTHON_FALLTHROUGH;
5057  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5058  CYTHON_FALLTHROUGH;
5059  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5060  CYTHON_FALLTHROUGH;
5061  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5062  CYTHON_FALLTHROUGH;
5063  case 0: break;
5064  default: goto __pyx_L5_argtuple_error;
5065  }
5066  kw_args = PyDict_Size(__pyx_kwds);
5067  switch (pos_args) {
5068  case 0:
5069  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
5070  else goto __pyx_L5_argtuple_error;
5071  CYTHON_FALLTHROUGH;
5072  case 1:
5073  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nu)) != 0)) kw_args--;
5074  else {
5075  __Pyx_RaiseArgtupleInvalid("transferPropertiesToPUMI", 1, 7, 7, 1); __PYX_ERR(1, 118, __pyx_L3_error)
5076  }
5077  CYTHON_FALLTHROUGH;
5078  case 2:
5079  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
5080  else {
5081  __Pyx_RaiseArgtupleInvalid("transferPropertiesToPUMI", 1, 7, 7, 2); __PYX_ERR(1, 118, __pyx_L3_error)
5082  }
5083  CYTHON_FALLTHROUGH;
5084  case 3:
5085  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deltaT)) != 0)) kw_args--;
5086  else {
5087  __Pyx_RaiseArgtupleInvalid("transferPropertiesToPUMI", 1, 7, 7, 3); __PYX_ERR(1, 118, __pyx_L3_error)
5088  }
5089  CYTHON_FALLTHROUGH;
5090  case 4:
5091  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deltaT_next)) != 0)) kw_args--;
5092  else {
5093  __Pyx_RaiseArgtupleInvalid("transferPropertiesToPUMI", 1, 7, 7, 4); __PYX_ERR(1, 118, __pyx_L3_error)
5094  }
5095  CYTHON_FALLTHROUGH;
5096  case 5:
5097  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_T_simulation)) != 0)) kw_args--;
5098  else {
5099  __Pyx_RaiseArgtupleInvalid("transferPropertiesToPUMI", 1, 7, 7, 5); __PYX_ERR(1, 118, __pyx_L3_error)
5100  }
5101  CYTHON_FALLTHROUGH;
5102  case 6:
5103  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interfaceBandSize)) != 0)) kw_args--;
5104  else {
5105  __Pyx_RaiseArgtupleInvalid("transferPropertiesToPUMI", 1, 7, 7, 6); __PYX_ERR(1, 118, __pyx_L3_error)
5106  }
5107  }
5108  if (unlikely(kw_args > 0)) {
5109  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "transferPropertiesToPUMI") < 0)) __PYX_ERR(1, 118, __pyx_L3_error)
5110  }
5111  } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
5112  goto __pyx_L5_argtuple_error;
5113  } else {
5114  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5115  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5116  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5117  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5118  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5119  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5120  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5121  }
5122  __pyx_v_rho = ((PyArrayObject *)values[0]);
5123  __pyx_v_nu = ((PyArrayObject *)values[1]);
5124  __pyx_v_g = ((PyArrayObject *)values[2]);
5125  __pyx_v_deltaT = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_deltaT == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 118, __pyx_L3_error)
5126  __pyx_v_deltaT_next = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_deltaT_next == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 118, __pyx_L3_error)
5127  __pyx_v_T_simulation = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_T_simulation == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 118, __pyx_L3_error)
5128  __pyx_v_interfaceBandSize = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_interfaceBandSize == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 118, __pyx_L3_error)
5129  }
5130  goto __pyx_L4_argument_unpacking_done;
5131  __pyx_L5_argtuple_error:;
5132  __Pyx_RaiseArgtupleInvalid("transferPropertiesToPUMI", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 118, __pyx_L3_error)
5133  __pyx_L3_error:;
5134  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferPropertiesToPUMI", __pyx_clineno, __pyx_lineno, __pyx_filename);
5135  __Pyx_RefNannyFinishContext();
5136  return NULL;
5137  __pyx_L4_argument_unpacking_done:;
5138  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rho), __pyx_ptype_5numpy_ndarray, 1, "rho", 0))) __PYX_ERR(1, 118, __pyx_L1_error)
5139  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nu), __pyx_ptype_5numpy_ndarray, 1, "nu", 0))) __PYX_ERR(1, 118, __pyx_L1_error)
5140  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_5numpy_ndarray, 1, "g", 0))) __PYX_ERR(1, 118, __pyx_L1_error)
5141  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_44transferPropertiesToPUMI(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), __pyx_v_rho, __pyx_v_nu, __pyx_v_g, __pyx_v_deltaT, __pyx_v_deltaT_next, __pyx_v_T_simulation, __pyx_v_interfaceBandSize);
5142 
5143  /* function exit code */
5144  goto __pyx_L0;
5145  __pyx_L1_error:;
5146  __pyx_r = NULL;
5147  __pyx_L0:;
5148  __Pyx_RefNannyFinishContext();
5149  return __pyx_r;
5150 }
5151 
5152 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_44transferPropertiesToPUMI(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyArrayObject *__pyx_v_rho, PyArrayObject *__pyx_v_nu, PyArrayObject *__pyx_v_g, double __pyx_v_deltaT, double __pyx_v_deltaT_next, double __pyx_v_T_simulation, double __pyx_v_interfaceBandSize) {
5153  __Pyx_LocalBuf_ND __pyx_pybuffernd_g;
5154  __Pyx_Buffer __pyx_pybuffer_g;
5155  __Pyx_LocalBuf_ND __pyx_pybuffernd_nu;
5156  __Pyx_Buffer __pyx_pybuffer_nu;
5157  __Pyx_LocalBuf_ND __pyx_pybuffernd_rho;
5158  __Pyx_Buffer __pyx_pybuffer_rho;
5159  PyObject *__pyx_r = NULL;
5160  __Pyx_RefNannyDeclarations
5161  PyObject *__pyx_t_1 = NULL;
5162  PyObject *__pyx_t_2 = NULL;
5163  PyObject *__pyx_t_3 = NULL;
5164  PyArrayObject *__pyx_t_4 = NULL;
5165  int __pyx_t_5;
5166  PyObject *__pyx_t_6 = NULL;
5167  PyObject *__pyx_t_7 = NULL;
5168  PyObject *__pyx_t_8 = NULL;
5169  PyArrayObject *__pyx_t_9 = NULL;
5170  PyArrayObject *__pyx_t_10 = NULL;
5171  int __pyx_lineno = 0;
5172  const char *__pyx_filename = NULL;
5173  int __pyx_clineno = 0;
5174  __Pyx_RefNannySetupContext("transferPropertiesToPUMI", 0);
5175  __Pyx_INCREF((PyObject *)__pyx_v_rho);
5176  __Pyx_INCREF((PyObject *)__pyx_v_nu);
5177  __Pyx_INCREF((PyObject *)__pyx_v_g);
5178  __pyx_pybuffer_rho.pybuffer.buf = NULL;
5179  __pyx_pybuffer_rho.refcount = 0;
5180  __pyx_pybuffernd_rho.data = NULL;
5181  __pyx_pybuffernd_rho.rcbuffer = &__pyx_pybuffer_rho;
5182  __pyx_pybuffer_nu.pybuffer.buf = NULL;
5183  __pyx_pybuffer_nu.refcount = 0;
5184  __pyx_pybuffernd_nu.data = NULL;
5185  __pyx_pybuffernd_nu.rcbuffer = &__pyx_pybuffer_nu;
5186  __pyx_pybuffer_g.pybuffer.buf = NULL;
5187  __pyx_pybuffer_g.refcount = 0;
5188  __pyx_pybuffernd_g.data = NULL;
5189  __pyx_pybuffernd_g.rcbuffer = &__pyx_pybuffer_g;
5190  {
5191  __Pyx_BufFmt_StackElem __pyx_stack[1];
5192  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rho.rcbuffer->pybuffer, (PyObject*)__pyx_v_rho, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 118, __pyx_L1_error)
5193  }
5194  __pyx_pybuffernd_rho.diminfo[0].strides = __pyx_pybuffernd_rho.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rho.diminfo[0].shape = __pyx_pybuffernd_rho.rcbuffer->pybuffer.shape[0];
5195  {
5196  __Pyx_BufFmt_StackElem __pyx_stack[1];
5197  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nu.rcbuffer->pybuffer, (PyObject*)__pyx_v_nu, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 118, __pyx_L1_error)
5198  }
5199  __pyx_pybuffernd_nu.diminfo[0].strides = __pyx_pybuffernd_nu.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nu.diminfo[0].shape = __pyx_pybuffernd_nu.rcbuffer->pybuffer.shape[0];
5200  {
5201  __Pyx_BufFmt_StackElem __pyx_stack[1];
5202  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_g.rcbuffer->pybuffer, (PyObject*)__pyx_v_g, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 118, __pyx_L1_error)
5203  }
5204  __pyx_pybuffernd_g.diminfo[0].strides = __pyx_pybuffernd_g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_g.diminfo[0].shape = __pyx_pybuffernd_g.rcbuffer->pybuffer.shape[0];
5205 
5206  /* "MeshAdaptPUMI/MeshAdapt.pyx":119
5207  * return self.thisptr.transferElementFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0])
5208  * def transferPropertiesToPUMI(self, np.ndarray[np.double_t,ndim=1,mode="c"] rho, np.ndarray[np.double_t,ndim=1,mode="c"] nu, np.ndarray[np.double_t,ndim=1,mode="c"] g, double deltaT,double deltaT_next, double T_simulation,double interfaceBandSize):
5209  * rho = np.ascontiguousarray(rho) # <<<<<<<<<<<<<<
5210  * nu = np.ascontiguousarray(nu)
5211  * g = np.ascontiguousarray(g)
5212  */
5213  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 119, __pyx_L1_error)
5214  __Pyx_GOTREF(__pyx_t_2);
5215  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 119, __pyx_L1_error)
5216  __Pyx_GOTREF(__pyx_t_3);
5217  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5218  __pyx_t_2 = NULL;
5219  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5220  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
5221  if (likely(__pyx_t_2)) {
5222  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5223  __Pyx_INCREF(__pyx_t_2);
5224  __Pyx_INCREF(function);
5225  __Pyx_DECREF_SET(__pyx_t_3, function);
5226  }
5227  }
5228  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_rho)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_rho));
5229  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5230  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 119, __pyx_L1_error)
5231  __Pyx_GOTREF(__pyx_t_1);
5232  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5233  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 119, __pyx_L1_error)
5234  __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
5235  {
5236  __Pyx_BufFmt_StackElem __pyx_stack[1];
5237  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rho.rcbuffer->pybuffer);
5238  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rho.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
5239  if (unlikely(__pyx_t_5 < 0)) {
5240  PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
5241  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rho.rcbuffer->pybuffer, (PyObject*)__pyx_v_rho, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
5242  Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
5243  __Pyx_RaiseBufferFallbackError();
5244  } else {
5245  PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
5246  }
5247  __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
5248  }
5249  __pyx_pybuffernd_rho.diminfo[0].strides = __pyx_pybuffernd_rho.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rho.diminfo[0].shape = __pyx_pybuffernd_rho.rcbuffer->pybuffer.shape[0];
5250  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 119, __pyx_L1_error)
5251  }
5252  __pyx_t_4 = 0;
5253  __Pyx_DECREF_SET(__pyx_v_rho, ((PyArrayObject *)__pyx_t_1));
5254  __pyx_t_1 = 0;
5255 
5256  /* "MeshAdaptPUMI/MeshAdapt.pyx":120
5257  * def transferPropertiesToPUMI(self, np.ndarray[np.double_t,ndim=1,mode="c"] rho, np.ndarray[np.double_t,ndim=1,mode="c"] nu, np.ndarray[np.double_t,ndim=1,mode="c"] g, double deltaT,double deltaT_next, double T_simulation,double interfaceBandSize):
5258  * rho = np.ascontiguousarray(rho)
5259  * nu = np.ascontiguousarray(nu) # <<<<<<<<<<<<<<
5260  * g = np.ascontiguousarray(g)
5261  * return self.thisptr.transferPropertiesToPUMI(<double*> rho.data,<double*>nu.data,<double*>g.data,deltaT,deltaT_next,T_simulation,interfaceBandSize)
5262  */
5263  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 120, __pyx_L1_error)
5264  __Pyx_GOTREF(__pyx_t_3);
5265  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 120, __pyx_L1_error)
5266  __Pyx_GOTREF(__pyx_t_2);
5267  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5268  __pyx_t_3 = NULL;
5269  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
5270  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
5271  if (likely(__pyx_t_3)) {
5272  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5273  __Pyx_INCREF(__pyx_t_3);
5274  __Pyx_INCREF(function);
5275  __Pyx_DECREF_SET(__pyx_t_2, function);
5276  }
5277  }
5278  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_nu)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_nu));
5279  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5280  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 120, __pyx_L1_error)
5281  __Pyx_GOTREF(__pyx_t_1);
5282  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5283  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 120, __pyx_L1_error)
5284  __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
5285  {
5286  __Pyx_BufFmt_StackElem __pyx_stack[1];
5287  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nu.rcbuffer->pybuffer);
5288  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nu.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
5289  if (unlikely(__pyx_t_5 < 0)) {
5290  PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
5291  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nu.rcbuffer->pybuffer, (PyObject*)__pyx_v_nu, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
5292  Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
5293  __Pyx_RaiseBufferFallbackError();
5294  } else {
5295  PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
5296  }
5297  __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
5298  }
5299  __pyx_pybuffernd_nu.diminfo[0].strides = __pyx_pybuffernd_nu.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nu.diminfo[0].shape = __pyx_pybuffernd_nu.rcbuffer->pybuffer.shape[0];
5300  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 120, __pyx_L1_error)
5301  }
5302  __pyx_t_9 = 0;
5303  __Pyx_DECREF_SET(__pyx_v_nu, ((PyArrayObject *)__pyx_t_1));
5304  __pyx_t_1 = 0;
5305 
5306  /* "MeshAdaptPUMI/MeshAdapt.pyx":121
5307  * rho = np.ascontiguousarray(rho)
5308  * nu = np.ascontiguousarray(nu)
5309  * g = np.ascontiguousarray(g) # <<<<<<<<<<<<<<
5310  * return self.thisptr.transferPropertiesToPUMI(<double*> rho.data,<double*>nu.data,<double*>g.data,deltaT,deltaT_next,T_simulation,interfaceBandSize)
5311  *
5312  */
5313  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 121, __pyx_L1_error)
5314  __Pyx_GOTREF(__pyx_t_2);
5315  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 121, __pyx_L1_error)
5316  __Pyx_GOTREF(__pyx_t_3);
5317  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5318  __pyx_t_2 = NULL;
5319  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5320  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
5321  if (likely(__pyx_t_2)) {
5322  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5323  __Pyx_INCREF(__pyx_t_2);
5324  __Pyx_INCREF(function);
5325  __Pyx_DECREF_SET(__pyx_t_3, function);
5326  }
5327  }
5328  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_g)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_g));
5329  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5330  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 121, __pyx_L1_error)
5331  __Pyx_GOTREF(__pyx_t_1);
5332  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5333  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 121, __pyx_L1_error)
5334  __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
5335  {
5336  __Pyx_BufFmt_StackElem __pyx_stack[1];
5337  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_g.rcbuffer->pybuffer);
5338  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_g.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
5339  if (unlikely(__pyx_t_5 < 0)) {
5340  PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
5341  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_g.rcbuffer->pybuffer, (PyObject*)__pyx_v_g, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
5342  Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
5343  __Pyx_RaiseBufferFallbackError();
5344  } else {
5345  PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
5346  }
5347  __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
5348  }
5349  __pyx_pybuffernd_g.diminfo[0].strides = __pyx_pybuffernd_g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_g.diminfo[0].shape = __pyx_pybuffernd_g.rcbuffer->pybuffer.shape[0];
5350  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 121, __pyx_L1_error)
5351  }
5352  __pyx_t_10 = 0;
5353  __Pyx_DECREF_SET(__pyx_v_g, ((PyArrayObject *)__pyx_t_1));
5354  __pyx_t_1 = 0;
5355 
5356  /* "MeshAdaptPUMI/MeshAdapt.pyx":122
5357  * nu = np.ascontiguousarray(nu)
5358  * g = np.ascontiguousarray(g)
5359  * return self.thisptr.transferPropertiesToPUMI(<double*> rho.data,<double*>nu.data,<double*>g.data,deltaT,deltaT_next,T_simulation,interfaceBandSize) # <<<<<<<<<<<<<<
5360  *
5361  * def setAdaptProperties(self,manager):
5362  */
5363  __Pyx_XDECREF(__pyx_r);
5364  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->transferPropertiesToPUMI(((double *)__pyx_v_rho->data), ((double *)__pyx_v_nu->data), ((double *)__pyx_v_g->data), __pyx_v_deltaT, __pyx_v_deltaT_next, __pyx_v_T_simulation, __pyx_v_interfaceBandSize)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 122, __pyx_L1_error)
5365  __Pyx_GOTREF(__pyx_t_1);
5366  __pyx_r = __pyx_t_1;
5367  __pyx_t_1 = 0;
5368  goto __pyx_L0;
5369 
5370  /* "MeshAdaptPUMI/MeshAdapt.pyx":118
5371  * outArray = np.ascontiguousarray(outArray)
5372  * return self.thisptr.transferElementFieldToProteus(name, &outArray[0,0], outArray.shape[1], outArray.shape[0])
5373  * def transferPropertiesToPUMI(self, np.ndarray[np.double_t,ndim=1,mode="c"] rho, np.ndarray[np.double_t,ndim=1,mode="c"] nu, np.ndarray[np.double_t,ndim=1,mode="c"] g, double deltaT,double deltaT_next, double T_simulation,double interfaceBandSize): # <<<<<<<<<<<<<<
5374  * rho = np.ascontiguousarray(rho)
5375  * nu = np.ascontiguousarray(nu)
5376  */
5377 
5378  /* function exit code */
5379  __pyx_L1_error:;
5380  __Pyx_XDECREF(__pyx_t_1);
5381  __Pyx_XDECREF(__pyx_t_2);
5382  __Pyx_XDECREF(__pyx_t_3);
5383  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5384  __Pyx_PyThreadState_declare
5385  __Pyx_PyThreadState_assign
5386  __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5387  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_g.rcbuffer->pybuffer);
5388  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nu.rcbuffer->pybuffer);
5389  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rho.rcbuffer->pybuffer);
5390  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5391  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferPropertiesToPUMI", __pyx_clineno, __pyx_lineno, __pyx_filename);
5392  __pyx_r = NULL;
5393  goto __pyx_L2;
5394  __pyx_L0:;
5395  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_g.rcbuffer->pybuffer);
5396  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nu.rcbuffer->pybuffer);
5397  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rho.rcbuffer->pybuffer);
5398  __pyx_L2:;
5399  __Pyx_XDECREF((PyObject *)__pyx_v_rho);
5400  __Pyx_XDECREF((PyObject *)__pyx_v_nu);
5401  __Pyx_XDECREF((PyObject *)__pyx_v_g);
5402  __Pyx_XGIVEREF(__pyx_r);
5403  __Pyx_RefNannyFinishContext();
5404  return __pyx_r;
5405 }
5406 
5407 /* "MeshAdaptPUMI/MeshAdapt.pyx":124
5408  * return self.thisptr.transferPropertiesToPUMI(<double*> rho.data,<double*>nu.data,<double*>g.data,deltaT,deltaT_next,T_simulation,interfaceBandSize)
5409  *
5410  * def setAdaptProperties(self,manager): # <<<<<<<<<<<<<<
5411  * cdef vector[string] sizeInputs
5412  * for entry in manager.sizeInputs:
5413  */
5414 
5415 /* Python wrapper */
5416 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_47setAdaptProperties(PyObject *__pyx_v_self, PyObject *__pyx_v_manager); /*proto*/
5417 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_47setAdaptProperties(PyObject *__pyx_v_self, PyObject *__pyx_v_manager) {
5418  PyObject *__pyx_r = 0;
5419  __Pyx_RefNannyDeclarations
5420  __Pyx_RefNannySetupContext("setAdaptProperties (wrapper)", 0);
5421  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_46setAdaptProperties(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), ((PyObject *)__pyx_v_manager));
5422 
5423  /* function exit code */
5424  __Pyx_RefNannyFinishContext();
5425  return __pyx_r;
5426 }
5427 
5428 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_46setAdaptProperties(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_manager) {
5429  std::vector<std::string> __pyx_v_sizeInputs;
5430  PyObject *__pyx_v_entry = NULL;
5431  PyObject *__pyx_r = NULL;
5432  __Pyx_RefNannyDeclarations
5433  PyObject *__pyx_t_1 = NULL;
5434  PyObject *__pyx_t_2 = NULL;
5435  Py_ssize_t __pyx_t_3;
5436  PyObject *(*__pyx_t_4)(PyObject *);
5437  std::string __pyx_t_5;
5438  int __pyx_t_6;
5439  double __pyx_t_7;
5440  double __pyx_t_8;
5441  double __pyx_t_9;
5442  int __pyx_t_10;
5443  double __pyx_t_11;
5444  double __pyx_t_12;
5445  int __pyx_t_13;
5446  int __pyx_t_14;
5447  int __pyx_lineno = 0;
5448  const char *__pyx_filename = NULL;
5449  int __pyx_clineno = 0;
5450  __Pyx_RefNannySetupContext("setAdaptProperties", 0);
5451 
5452  /* "MeshAdaptPUMI/MeshAdapt.pyx":126
5453  * def setAdaptProperties(self,manager):
5454  * cdef vector[string] sizeInputs
5455  * for entry in manager.sizeInputs: # <<<<<<<<<<<<<<
5456  * sizeInputs.push_back(entry)
5457  * return self.thisptr.setAdaptProperties(
5458  */
5459  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_sizeInputs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error)
5460  __Pyx_GOTREF(__pyx_t_1);
5461  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
5462  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
5463  __pyx_t_4 = NULL;
5464  } else {
5465  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 126, __pyx_L1_error)
5466  __Pyx_GOTREF(__pyx_t_2);
5467  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 126, __pyx_L1_error)
5468  }
5469  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5470  for (;;) {
5471  if (likely(!__pyx_t_4)) {
5472  if (likely(PyList_CheckExact(__pyx_t_2))) {
5473  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
5474  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5475  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 126, __pyx_L1_error)
5476  #else
5477  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error)
5478  __Pyx_GOTREF(__pyx_t_1);
5479  #endif
5480  } else {
5481  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
5482  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5483  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 126, __pyx_L1_error)
5484  #else
5485  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error)
5486  __Pyx_GOTREF(__pyx_t_1);
5487  #endif
5488  }
5489  } else {
5490  __pyx_t_1 = __pyx_t_4(__pyx_t_2);
5491  if (unlikely(!__pyx_t_1)) {
5492  PyObject* exc_type = PyErr_Occurred();
5493  if (exc_type) {
5494  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5495  else __PYX_ERR(1, 126, __pyx_L1_error)
5496  }
5497  break;
5498  }
5499  __Pyx_GOTREF(__pyx_t_1);
5500  }
5501  __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_1);
5502  __pyx_t_1 = 0;
5503 
5504  /* "MeshAdaptPUMI/MeshAdapt.pyx":127
5505  * cdef vector[string] sizeInputs
5506  * for entry in manager.sizeInputs:
5507  * sizeInputs.push_back(entry) # <<<<<<<<<<<<<<
5508  * return self.thisptr.setAdaptProperties(
5509  * sizeInputs,
5510  */
5511  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_entry); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 127, __pyx_L1_error)
5512  try {
5513  __pyx_v_sizeInputs.push_back(__pyx_t_5);
5514  } catch(...) {
5515  __Pyx_CppExn2PyErr();
5516  __PYX_ERR(1, 127, __pyx_L1_error)
5517  }
5518 
5519  /* "MeshAdaptPUMI/MeshAdapt.pyx":126
5520  * def setAdaptProperties(self,manager):
5521  * cdef vector[string] sizeInputs
5522  * for entry in manager.sizeInputs: # <<<<<<<<<<<<<<
5523  * sizeInputs.push_back(entry)
5524  * return self.thisptr.setAdaptProperties(
5525  */
5526  }
5527  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5528 
5529  /* "MeshAdaptPUMI/MeshAdapt.pyx":128
5530  * for entry in manager.sizeInputs:
5531  * sizeInputs.push_back(entry)
5532  * return self.thisptr.setAdaptProperties( # <<<<<<<<<<<<<<
5533  * sizeInputs,
5534  * manager.adapt,
5535  */
5536  __Pyx_XDECREF(__pyx_r);
5537 
5538  /* "MeshAdaptPUMI/MeshAdapt.pyx":130
5539  * return self.thisptr.setAdaptProperties(
5540  * sizeInputs,
5541  * manager.adapt, # <<<<<<<<<<<<<<
5542  * manager.hmax,
5543  * manager.hmin,
5544  */
5545  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_adapt); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 130, __pyx_L1_error)
5546  __Pyx_GOTREF(__pyx_t_2);
5547  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 130, __pyx_L1_error)
5548  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5549 
5550  /* "MeshAdaptPUMI/MeshAdapt.pyx":131
5551  * sizeInputs,
5552  * manager.adapt,
5553  * manager.hmax, # <<<<<<<<<<<<<<
5554  * manager.hmin,
5555  * manager.hphi,
5556  */
5557  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_hmax); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 131, __pyx_L1_error)
5558  __Pyx_GOTREF(__pyx_t_2);
5559  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L1_error)
5560  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5561 
5562  /* "MeshAdaptPUMI/MeshAdapt.pyx":132
5563  * manager.adapt,
5564  * manager.hmax,
5565  * manager.hmin, # <<<<<<<<<<<<<<
5566  * manager.hphi,
5567  * manager.numAdaptSteps,
5568  */
5569  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_hmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 132, __pyx_L1_error)
5570  __Pyx_GOTREF(__pyx_t_2);
5571  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L1_error)
5572  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5573 
5574  /* "MeshAdaptPUMI/MeshAdapt.pyx":133
5575  * manager.hmax,
5576  * manager.hmin,
5577  * manager.hphi, # <<<<<<<<<<<<<<
5578  * manager.numAdaptSteps,
5579  * manager.targetError,
5580  */
5581  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_hphi); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 133, __pyx_L1_error)
5582  __Pyx_GOTREF(__pyx_t_2);
5583  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 133, __pyx_L1_error)
5584  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5585 
5586  /* "MeshAdaptPUMI/MeshAdapt.pyx":134
5587  * manager.hmin,
5588  * manager.hphi,
5589  * manager.numAdaptSteps, # <<<<<<<<<<<<<<
5590  * manager.targetError,
5591  * manager.gradingFactor,
5592  */
5593  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_numAdaptSteps); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 134, __pyx_L1_error)
5594  __Pyx_GOTREF(__pyx_t_2);
5595  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 134, __pyx_L1_error)
5596  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5597 
5598  /* "MeshAdaptPUMI/MeshAdapt.pyx":135
5599  * manager.hphi,
5600  * manager.numAdaptSteps,
5601  * manager.targetError, # <<<<<<<<<<<<<<
5602  * manager.gradingFactor,
5603  * manager.logging,
5604  */
5605  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_targetError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 135, __pyx_L1_error)
5606  __Pyx_GOTREF(__pyx_t_2);
5607  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 135, __pyx_L1_error)
5608  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5609 
5610  /* "MeshAdaptPUMI/MeshAdapt.pyx":136
5611  * manager.numAdaptSteps,
5612  * manager.targetError,
5613  * manager.gradingFactor, # <<<<<<<<<<<<<<
5614  * manager.logging,
5615  * manager.numIterations
5616  */
5617  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_gradingFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 136, __pyx_L1_error)
5618  __Pyx_GOTREF(__pyx_t_2);
5619  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 136, __pyx_L1_error)
5620  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5621 
5622  /* "MeshAdaptPUMI/MeshAdapt.pyx":137
5623  * manager.targetError,
5624  * manager.gradingFactor,
5625  * manager.logging, # <<<<<<<<<<<<<<
5626  * manager.numIterations
5627  * )
5628  */
5629  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 137, __pyx_L1_error)
5630  __Pyx_GOTREF(__pyx_t_2);
5631  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 137, __pyx_L1_error)
5632  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5633 
5634  /* "MeshAdaptPUMI/MeshAdapt.pyx":138
5635  * manager.gradingFactor,
5636  * manager.logging,
5637  * manager.numIterations # <<<<<<<<<<<<<<
5638  * )
5639  *
5640  */
5641  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_manager, __pyx_n_s_numIterations); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 138, __pyx_L1_error)
5642  __Pyx_GOTREF(__pyx_t_2);
5643  __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 138, __pyx_L1_error)
5644  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5645 
5646  /* "MeshAdaptPUMI/MeshAdapt.pyx":128
5647  * for entry in manager.sizeInputs:
5648  * sizeInputs.push_back(entry)
5649  * return self.thisptr.setAdaptProperties( # <<<<<<<<<<<<<<
5650  * sizeInputs,
5651  * manager.adapt,
5652  */
5653  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->setAdaptProperties(__pyx_v_sizeInputs, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 128, __pyx_L1_error)
5654  __Pyx_GOTREF(__pyx_t_2);
5655  __pyx_r = __pyx_t_2;
5656  __pyx_t_2 = 0;
5657  goto __pyx_L0;
5658 
5659  /* "MeshAdaptPUMI/MeshAdapt.pyx":124
5660  * return self.thisptr.transferPropertiesToPUMI(<double*> rho.data,<double*>nu.data,<double*>g.data,deltaT,deltaT_next,T_simulation,interfaceBandSize)
5661  *
5662  * def setAdaptProperties(self,manager): # <<<<<<<<<<<<<<
5663  * cdef vector[string] sizeInputs
5664  * for entry in manager.sizeInputs:
5665  */
5666 
5667  /* function exit code */
5668  __pyx_L1_error:;
5669  __Pyx_XDECREF(__pyx_t_1);
5670  __Pyx_XDECREF(__pyx_t_2);
5671  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.setAdaptProperties", __pyx_clineno, __pyx_lineno, __pyx_filename);
5672  __pyx_r = NULL;
5673  __pyx_L0:;
5674  __Pyx_XDECREF(__pyx_v_entry);
5675  __Pyx_XGIVEREF(__pyx_r);
5676  __Pyx_RefNannyFinishContext();
5677  return __pyx_r;
5678 }
5679 
5680 /* "MeshAdaptPUMI/MeshAdapt.pyx":142
5681  *
5682  *
5683  * def transferModelInfo(self, np.ndarray[int,ndim=1,mode="c"] numModelEntities, # <<<<<<<<<<<<<<
5684  * np.ndarray[int,ndim=2,mode="c"] edges,
5685  * np.ndarray[int,ndim=2,mode="c"] faces,
5686  */
5687 
5688 /* Python wrapper */
5689 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_49transferModelInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5690 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_49transferModelInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5691  PyArrayObject *__pyx_v_numModelEntities = 0;
5692  PyArrayObject *__pyx_v_edges = 0;
5693  PyArrayObject *__pyx_v_faces = 0;
5694  PyArrayObject *__pyx_v_meshVertex2Model = 0;
5695  PyArrayObject *__pyx_v_meshEdge2Model = 0;
5696  PyArrayObject *__pyx_v_meshBoundary2Model = 0;
5697  int __pyx_lineno = 0;
5698  const char *__pyx_filename = NULL;
5699  int __pyx_clineno = 0;
5700  PyObject *__pyx_r = 0;
5701  __Pyx_RefNannyDeclarations
5702  __Pyx_RefNannySetupContext("transferModelInfo (wrapper)", 0);
5703  {
5704  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numModelEntities,&__pyx_n_s_edges,&__pyx_n_s_faces,&__pyx_n_s_meshVertex2Model,&__pyx_n_s_meshEdge2Model,&__pyx_n_s_meshBoundary2Model,0};
5705  PyObject* values[6] = {0,0,0,0,0,0};
5706  if (unlikely(__pyx_kwds)) {
5707  Py_ssize_t kw_args;
5708  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5709  switch (pos_args) {
5710  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5711  CYTHON_FALLTHROUGH;
5712  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5713  CYTHON_FALLTHROUGH;
5714  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5715  CYTHON_FALLTHROUGH;
5716  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5717  CYTHON_FALLTHROUGH;
5718  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5719  CYTHON_FALLTHROUGH;
5720  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5721  CYTHON_FALLTHROUGH;
5722  case 0: break;
5723  default: goto __pyx_L5_argtuple_error;
5724  }
5725  kw_args = PyDict_Size(__pyx_kwds);
5726  switch (pos_args) {
5727  case 0:
5728  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numModelEntities)) != 0)) kw_args--;
5729  else goto __pyx_L5_argtuple_error;
5730  CYTHON_FALLTHROUGH;
5731  case 1:
5732  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edges)) != 0)) kw_args--;
5733  else {
5734  __Pyx_RaiseArgtupleInvalid("transferModelInfo", 1, 6, 6, 1); __PYX_ERR(1, 142, __pyx_L3_error)
5735  }
5736  CYTHON_FALLTHROUGH;
5737  case 2:
5738  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_faces)) != 0)) kw_args--;
5739  else {
5740  __Pyx_RaiseArgtupleInvalid("transferModelInfo", 1, 6, 6, 2); __PYX_ERR(1, 142, __pyx_L3_error)
5741  }
5742  CYTHON_FALLTHROUGH;
5743  case 3:
5744  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meshVertex2Model)) != 0)) kw_args--;
5745  else {
5746  __Pyx_RaiseArgtupleInvalid("transferModelInfo", 1, 6, 6, 3); __PYX_ERR(1, 142, __pyx_L3_error)
5747  }
5748  CYTHON_FALLTHROUGH;
5749  case 4:
5750  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meshEdge2Model)) != 0)) kw_args--;
5751  else {
5752  __Pyx_RaiseArgtupleInvalid("transferModelInfo", 1, 6, 6, 4); __PYX_ERR(1, 142, __pyx_L3_error)
5753  }
5754  CYTHON_FALLTHROUGH;
5755  case 5:
5756  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meshBoundary2Model)) != 0)) kw_args--;
5757  else {
5758  __Pyx_RaiseArgtupleInvalid("transferModelInfo", 1, 6, 6, 5); __PYX_ERR(1, 142, __pyx_L3_error)
5759  }
5760  }
5761  if (unlikely(kw_args > 0)) {
5762  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "transferModelInfo") < 0)) __PYX_ERR(1, 142, __pyx_L3_error)
5763  }
5764  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5765  goto __pyx_L5_argtuple_error;
5766  } else {
5767  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5768  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5769  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5770  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5771  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5772  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5773  }
5774  __pyx_v_numModelEntities = ((PyArrayObject *)values[0]);
5775  __pyx_v_edges = ((PyArrayObject *)values[1]);
5776  __pyx_v_faces = ((PyArrayObject *)values[2]);
5777  __pyx_v_meshVertex2Model = ((PyArrayObject *)values[3]);
5778  __pyx_v_meshEdge2Model = ((PyArrayObject *)values[4]);
5779  __pyx_v_meshBoundary2Model = ((PyArrayObject *)values[5]);
5780  }
5781  goto __pyx_L4_argument_unpacking_done;
5782  __pyx_L5_argtuple_error:;
5783  __Pyx_RaiseArgtupleInvalid("transferModelInfo", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 142, __pyx_L3_error)
5784  __pyx_L3_error:;
5785  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferModelInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
5786  __Pyx_RefNannyFinishContext();
5787  return NULL;
5788  __pyx_L4_argument_unpacking_done:;
5789  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_numModelEntities), __pyx_ptype_5numpy_ndarray, 1, "numModelEntities", 0))) __PYX_ERR(1, 142, __pyx_L1_error)
5790  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edges), __pyx_ptype_5numpy_ndarray, 1, "edges", 0))) __PYX_ERR(1, 143, __pyx_L1_error)
5791  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_faces), __pyx_ptype_5numpy_ndarray, 1, "faces", 0))) __PYX_ERR(1, 144, __pyx_L1_error)
5792  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_meshVertex2Model), __pyx_ptype_5numpy_ndarray, 1, "meshVertex2Model", 0))) __PYX_ERR(1, 145, __pyx_L1_error)
5793  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_meshEdge2Model), __pyx_ptype_5numpy_ndarray, 1, "meshEdge2Model", 0))) __PYX_ERR(1, 146, __pyx_L1_error)
5794  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_meshBoundary2Model), __pyx_ptype_5numpy_ndarray, 1, "meshBoundary2Model", 0))) __PYX_ERR(1, 147, __pyx_L1_error)
5795  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_48transferModelInfo(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), __pyx_v_numModelEntities, __pyx_v_edges, __pyx_v_faces, __pyx_v_meshVertex2Model, __pyx_v_meshEdge2Model, __pyx_v_meshBoundary2Model);
5796 
5797  /* function exit code */
5798  goto __pyx_L0;
5799  __pyx_L1_error:;
5800  __pyx_r = NULL;
5801  __pyx_L0:;
5802  __Pyx_RefNannyFinishContext();
5803  return __pyx_r;
5804 }
5805 
5806 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_48transferModelInfo(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyArrayObject *__pyx_v_numModelEntities, PyArrayObject *__pyx_v_edges, PyArrayObject *__pyx_v_faces, PyArrayObject *__pyx_v_meshVertex2Model, PyArrayObject *__pyx_v_meshEdge2Model, PyArrayObject *__pyx_v_meshBoundary2Model) {
5807  npy_intp __pyx_v_nMaxSegments;
5808  __Pyx_LocalBuf_ND __pyx_pybuffernd_edges;
5809  __Pyx_Buffer __pyx_pybuffer_edges;
5810  __Pyx_LocalBuf_ND __pyx_pybuffernd_faces;
5811  __Pyx_Buffer __pyx_pybuffer_faces;
5812  __Pyx_LocalBuf_ND __pyx_pybuffernd_meshBoundary2Model;
5813  __Pyx_Buffer __pyx_pybuffer_meshBoundary2Model;
5814  __Pyx_LocalBuf_ND __pyx_pybuffernd_meshEdge2Model;
5815  __Pyx_Buffer __pyx_pybuffer_meshEdge2Model;
5816  __Pyx_LocalBuf_ND __pyx_pybuffernd_meshVertex2Model;
5817  __Pyx_Buffer __pyx_pybuffer_meshVertex2Model;
5818  __Pyx_LocalBuf_ND __pyx_pybuffernd_numModelEntities;
5819  __Pyx_Buffer __pyx_pybuffer_numModelEntities;
5820  PyObject *__pyx_r = NULL;
5821  __Pyx_RefNannyDeclarations
5822  PyObject *__pyx_t_1 = NULL;
5823  PyObject *__pyx_t_2 = NULL;
5824  PyObject *__pyx_t_3 = NULL;
5825  PyArrayObject *__pyx_t_4 = NULL;
5826  int __pyx_t_5;
5827  PyObject *__pyx_t_6 = NULL;
5828  PyObject *__pyx_t_7 = NULL;
5829  PyObject *__pyx_t_8 = NULL;
5830  PyArrayObject *__pyx_t_9 = NULL;
5831  PyArrayObject *__pyx_t_10 = NULL;
5832  PyArrayObject *__pyx_t_11 = NULL;
5833  PyArrayObject *__pyx_t_12 = NULL;
5834  PyArrayObject *__pyx_t_13 = NULL;
5835  int __pyx_lineno = 0;
5836  const char *__pyx_filename = NULL;
5837  int __pyx_clineno = 0;
5838  __Pyx_RefNannySetupContext("transferModelInfo", 0);
5839  __Pyx_INCREF((PyObject *)__pyx_v_numModelEntities);
5840  __Pyx_INCREF((PyObject *)__pyx_v_edges);
5841  __Pyx_INCREF((PyObject *)__pyx_v_faces);
5842  __Pyx_INCREF((PyObject *)__pyx_v_meshVertex2Model);
5843  __Pyx_INCREF((PyObject *)__pyx_v_meshEdge2Model);
5844  __Pyx_INCREF((PyObject *)__pyx_v_meshBoundary2Model);
5845  __pyx_pybuffer_numModelEntities.pybuffer.buf = NULL;
5846  __pyx_pybuffer_numModelEntities.refcount = 0;
5847  __pyx_pybuffernd_numModelEntities.data = NULL;
5848  __pyx_pybuffernd_numModelEntities.rcbuffer = &__pyx_pybuffer_numModelEntities;
5849  __pyx_pybuffer_edges.pybuffer.buf = NULL;
5850  __pyx_pybuffer_edges.refcount = 0;
5851  __pyx_pybuffernd_edges.data = NULL;
5852  __pyx_pybuffernd_edges.rcbuffer = &__pyx_pybuffer_edges;
5853  __pyx_pybuffer_faces.pybuffer.buf = NULL;
5854  __pyx_pybuffer_faces.refcount = 0;
5855  __pyx_pybuffernd_faces.data = NULL;
5856  __pyx_pybuffernd_faces.rcbuffer = &__pyx_pybuffer_faces;
5857  __pyx_pybuffer_meshVertex2Model.pybuffer.buf = NULL;
5858  __pyx_pybuffer_meshVertex2Model.refcount = 0;
5859  __pyx_pybuffernd_meshVertex2Model.data = NULL;
5860  __pyx_pybuffernd_meshVertex2Model.rcbuffer = &__pyx_pybuffer_meshVertex2Model;
5861  __pyx_pybuffer_meshEdge2Model.pybuffer.buf = NULL;
5862  __pyx_pybuffer_meshEdge2Model.refcount = 0;
5863  __pyx_pybuffernd_meshEdge2Model.data = NULL;
5864  __pyx_pybuffernd_meshEdge2Model.rcbuffer = &__pyx_pybuffer_meshEdge2Model;
5865  __pyx_pybuffer_meshBoundary2Model.pybuffer.buf = NULL;
5866  __pyx_pybuffer_meshBoundary2Model.refcount = 0;
5867  __pyx_pybuffernd_meshBoundary2Model.data = NULL;
5868  __pyx_pybuffernd_meshBoundary2Model.rcbuffer = &__pyx_pybuffer_meshBoundary2Model;
5869  {
5870  __Pyx_BufFmt_StackElem __pyx_stack[1];
5871  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_numModelEntities.rcbuffer->pybuffer, (PyObject*)__pyx_v_numModelEntities, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(1, 142, __pyx_L1_error)
5872  }
5873  __pyx_pybuffernd_numModelEntities.diminfo[0].strides = __pyx_pybuffernd_numModelEntities.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_numModelEntities.diminfo[0].shape = __pyx_pybuffernd_numModelEntities.rcbuffer->pybuffer.shape[0];
5874  {
5875  __Pyx_BufFmt_StackElem __pyx_stack[1];
5876  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_edges, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 142, __pyx_L1_error)
5877  }
5878  __pyx_pybuffernd_edges.diminfo[0].strides = __pyx_pybuffernd_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_edges.diminfo[0].shape = __pyx_pybuffernd_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_edges.diminfo[1].strides = __pyx_pybuffernd_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_edges.diminfo[1].shape = __pyx_pybuffernd_edges.rcbuffer->pybuffer.shape[1];
5879  {
5880  __Pyx_BufFmt_StackElem __pyx_stack[1];
5881  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_faces.rcbuffer->pybuffer, (PyObject*)__pyx_v_faces, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 142, __pyx_L1_error)
5882  }
5883  __pyx_pybuffernd_faces.diminfo[0].strides = __pyx_pybuffernd_faces.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_faces.diminfo[0].shape = __pyx_pybuffernd_faces.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_faces.diminfo[1].strides = __pyx_pybuffernd_faces.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_faces.diminfo[1].shape = __pyx_pybuffernd_faces.rcbuffer->pybuffer.shape[1];
5884  {
5885  __Pyx_BufFmt_StackElem __pyx_stack[1];
5886  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer, (PyObject*)__pyx_v_meshVertex2Model, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 142, __pyx_L1_error)
5887  }
5888  __pyx_pybuffernd_meshVertex2Model.diminfo[0].strides = __pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_meshVertex2Model.diminfo[0].shape = __pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_meshVertex2Model.diminfo[1].strides = __pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_meshVertex2Model.diminfo[1].shape = __pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer.shape[1];
5889  {
5890  __Pyx_BufFmt_StackElem __pyx_stack[1];
5891  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer, (PyObject*)__pyx_v_meshEdge2Model, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 142, __pyx_L1_error)
5892  }
5893  __pyx_pybuffernd_meshEdge2Model.diminfo[0].strides = __pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_meshEdge2Model.diminfo[0].shape = __pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_meshEdge2Model.diminfo[1].strides = __pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_meshEdge2Model.diminfo[1].shape = __pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer.shape[1];
5894  {
5895  __Pyx_BufFmt_StackElem __pyx_stack[1];
5896  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer, (PyObject*)__pyx_v_meshBoundary2Model, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 142, __pyx_L1_error)
5897  }
5898  __pyx_pybuffernd_meshBoundary2Model.diminfo[0].strides = __pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_meshBoundary2Model.diminfo[0].shape = __pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_meshBoundary2Model.diminfo[1].strides = __pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_meshBoundary2Model.diminfo[1].shape = __pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer.shape[1];
5899 
5900  /* "MeshAdaptPUMI/MeshAdapt.pyx":149
5901  * np.ndarray[int,ndim=2,mode="c"] meshBoundary2Model
5902  * ):
5903  * numModelEntities = np.ascontiguousarray(numModelEntities) # <<<<<<<<<<<<<<
5904  * edges = np.ascontiguousarray(edges)
5905  * nMaxSegments = faces.shape[1]
5906  */
5907  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 149, __pyx_L1_error)
5908  __Pyx_GOTREF(__pyx_t_2);
5909  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
5910  __Pyx_GOTREF(__pyx_t_3);
5911  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5912  __pyx_t_2 = NULL;
5913  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5914  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
5915  if (likely(__pyx_t_2)) {
5916  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5917  __Pyx_INCREF(__pyx_t_2);
5918  __Pyx_INCREF(function);
5919  __Pyx_DECREF_SET(__pyx_t_3, function);
5920  }
5921  }
5922  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_numModelEntities)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_numModelEntities));
5923  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5924  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 149, __pyx_L1_error)
5925  __Pyx_GOTREF(__pyx_t_1);
5926  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5927  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 149, __pyx_L1_error)
5928  __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
5929  {
5930  __Pyx_BufFmt_StackElem __pyx_stack[1];
5931  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_numModelEntities.rcbuffer->pybuffer);
5932  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_numModelEntities.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack);
5933  if (unlikely(__pyx_t_5 < 0)) {
5934  PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
5935  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_numModelEntities.rcbuffer->pybuffer, (PyObject*)__pyx_v_numModelEntities, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
5936  Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
5937  __Pyx_RaiseBufferFallbackError();
5938  } else {
5939  PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
5940  }
5941  __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
5942  }
5943  __pyx_pybuffernd_numModelEntities.diminfo[0].strides = __pyx_pybuffernd_numModelEntities.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_numModelEntities.diminfo[0].shape = __pyx_pybuffernd_numModelEntities.rcbuffer->pybuffer.shape[0];
5944  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 149, __pyx_L1_error)
5945  }
5946  __pyx_t_4 = 0;
5947  __Pyx_DECREF_SET(__pyx_v_numModelEntities, ((PyArrayObject *)__pyx_t_1));
5948  __pyx_t_1 = 0;
5949 
5950  /* "MeshAdaptPUMI/MeshAdapt.pyx":150
5951  * ):
5952  * numModelEntities = np.ascontiguousarray(numModelEntities)
5953  * edges = np.ascontiguousarray(edges) # <<<<<<<<<<<<<<
5954  * nMaxSegments = faces.shape[1]
5955  * faces = np.ascontiguousarray(faces)
5956  */
5957  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 150, __pyx_L1_error)
5958  __Pyx_GOTREF(__pyx_t_3);
5959  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 150, __pyx_L1_error)
5960  __Pyx_GOTREF(__pyx_t_2);
5961  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5962  __pyx_t_3 = NULL;
5963  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
5964  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
5965  if (likely(__pyx_t_3)) {
5966  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5967  __Pyx_INCREF(__pyx_t_3);
5968  __Pyx_INCREF(function);
5969  __Pyx_DECREF_SET(__pyx_t_2, function);
5970  }
5971  }
5972  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_edges)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_edges));
5973  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5974  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 150, __pyx_L1_error)
5975  __Pyx_GOTREF(__pyx_t_1);
5976  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5977  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 150, __pyx_L1_error)
5978  __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
5979  {
5980  __Pyx_BufFmt_StackElem __pyx_stack[1];
5981  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges.rcbuffer->pybuffer);
5982  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_edges.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
5983  if (unlikely(__pyx_t_5 < 0)) {
5984  PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
5985  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_edges.rcbuffer->pybuffer, (PyObject*)__pyx_v_edges, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
5986  Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
5987  __Pyx_RaiseBufferFallbackError();
5988  } else {
5989  PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
5990  }
5991  __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
5992  }
5993  __pyx_pybuffernd_edges.diminfo[0].strides = __pyx_pybuffernd_edges.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_edges.diminfo[0].shape = __pyx_pybuffernd_edges.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_edges.diminfo[1].strides = __pyx_pybuffernd_edges.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_edges.diminfo[1].shape = __pyx_pybuffernd_edges.rcbuffer->pybuffer.shape[1];
5994  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 150, __pyx_L1_error)
5995  }
5996  __pyx_t_9 = 0;
5997  __Pyx_DECREF_SET(__pyx_v_edges, ((PyArrayObject *)__pyx_t_1));
5998  __pyx_t_1 = 0;
5999 
6000  /* "MeshAdaptPUMI/MeshAdapt.pyx":151
6001  * numModelEntities = np.ascontiguousarray(numModelEntities)
6002  * edges = np.ascontiguousarray(edges)
6003  * nMaxSegments = faces.shape[1] # <<<<<<<<<<<<<<
6004  * faces = np.ascontiguousarray(faces)
6005  * meshVertex2Model = np.ascontiguousarray(meshVertex2Model)
6006  */
6007  __pyx_v_nMaxSegments = (__pyx_v_faces->dimensions[1]);
6008 
6009  /* "MeshAdaptPUMI/MeshAdapt.pyx":152
6010  * edges = np.ascontiguousarray(edges)
6011  * nMaxSegments = faces.shape[1]
6012  * faces = np.ascontiguousarray(faces) # <<<<<<<<<<<<<<
6013  * meshVertex2Model = np.ascontiguousarray(meshVertex2Model)
6014  * meshEdge2Model = np.ascontiguousarray(meshEdge2Model)
6015  */
6016  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 152, __pyx_L1_error)
6017  __Pyx_GOTREF(__pyx_t_2);
6018  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 152, __pyx_L1_error)
6019  __Pyx_GOTREF(__pyx_t_3);
6020  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6021  __pyx_t_2 = NULL;
6022  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6023  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
6024  if (likely(__pyx_t_2)) {
6025  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6026  __Pyx_INCREF(__pyx_t_2);
6027  __Pyx_INCREF(function);
6028  __Pyx_DECREF_SET(__pyx_t_3, function);
6029  }
6030  }
6031  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_faces)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_faces));
6032  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6033  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 152, __pyx_L1_error)
6034  __Pyx_GOTREF(__pyx_t_1);
6035  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6036  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 152, __pyx_L1_error)
6037  __pyx_t_10 = ((PyArrayObject *)__pyx_t_1);
6038  {
6039  __Pyx_BufFmt_StackElem __pyx_stack[1];
6040  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_faces.rcbuffer->pybuffer);
6041  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_faces.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
6042  if (unlikely(__pyx_t_5 < 0)) {
6043  PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
6044  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_faces.rcbuffer->pybuffer, (PyObject*)__pyx_v_faces, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
6045  Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
6046  __Pyx_RaiseBufferFallbackError();
6047  } else {
6048  PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
6049  }
6050  __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
6051  }
6052  __pyx_pybuffernd_faces.diminfo[0].strides = __pyx_pybuffernd_faces.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_faces.diminfo[0].shape = __pyx_pybuffernd_faces.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_faces.diminfo[1].strides = __pyx_pybuffernd_faces.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_faces.diminfo[1].shape = __pyx_pybuffernd_faces.rcbuffer->pybuffer.shape[1];
6053  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 152, __pyx_L1_error)
6054  }
6055  __pyx_t_10 = 0;
6056  __Pyx_DECREF_SET(__pyx_v_faces, ((PyArrayObject *)__pyx_t_1));
6057  __pyx_t_1 = 0;
6058 
6059  /* "MeshAdaptPUMI/MeshAdapt.pyx":153
6060  * nMaxSegments = faces.shape[1]
6061  * faces = np.ascontiguousarray(faces)
6062  * meshVertex2Model = np.ascontiguousarray(meshVertex2Model) # <<<<<<<<<<<<<<
6063  * meshEdge2Model = np.ascontiguousarray(meshEdge2Model)
6064  * meshBoundary2Model = np.ascontiguousarray(meshBoundary2Model)
6065  */
6066  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 153, __pyx_L1_error)
6067  __Pyx_GOTREF(__pyx_t_3);
6068  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error)
6069  __Pyx_GOTREF(__pyx_t_2);
6070  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6071  __pyx_t_3 = NULL;
6072  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6073  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6074  if (likely(__pyx_t_3)) {
6075  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6076  __Pyx_INCREF(__pyx_t_3);
6077  __Pyx_INCREF(function);
6078  __Pyx_DECREF_SET(__pyx_t_2, function);
6079  }
6080  }
6081  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_meshVertex2Model)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_meshVertex2Model));
6082  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6083  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 153, __pyx_L1_error)
6084  __Pyx_GOTREF(__pyx_t_1);
6085  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6086  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 153, __pyx_L1_error)
6087  __pyx_t_11 = ((PyArrayObject *)__pyx_t_1);
6088  {
6089  __Pyx_BufFmt_StackElem __pyx_stack[1];
6090  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer);
6091  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
6092  if (unlikely(__pyx_t_5 < 0)) {
6093  PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
6094  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer, (PyObject*)__pyx_v_meshVertex2Model, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
6095  Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
6096  __Pyx_RaiseBufferFallbackError();
6097  } else {
6098  PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
6099  }
6100  __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
6101  }
6102  __pyx_pybuffernd_meshVertex2Model.diminfo[0].strides = __pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_meshVertex2Model.diminfo[0].shape = __pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_meshVertex2Model.diminfo[1].strides = __pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_meshVertex2Model.diminfo[1].shape = __pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer.shape[1];
6103  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 153, __pyx_L1_error)
6104  }
6105  __pyx_t_11 = 0;
6106  __Pyx_DECREF_SET(__pyx_v_meshVertex2Model, ((PyArrayObject *)__pyx_t_1));
6107  __pyx_t_1 = 0;
6108 
6109  /* "MeshAdaptPUMI/MeshAdapt.pyx":154
6110  * faces = np.ascontiguousarray(faces)
6111  * meshVertex2Model = np.ascontiguousarray(meshVertex2Model)
6112  * meshEdge2Model = np.ascontiguousarray(meshEdge2Model) # <<<<<<<<<<<<<<
6113  * meshBoundary2Model = np.ascontiguousarray(meshBoundary2Model)
6114  * return self.thisptr.transferModelInfo(<int*> numModelEntities.data,<int*> edges.data,<int *> faces.data,<int*> meshVertex2Model.data,<int*> meshEdge2Model.data,<int*> meshBoundary2Model.data,nMaxSegments)
6115  */
6116  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 154, __pyx_L1_error)
6117  __Pyx_GOTREF(__pyx_t_2);
6118  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 154, __pyx_L1_error)
6119  __Pyx_GOTREF(__pyx_t_3);
6120  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6121  __pyx_t_2 = NULL;
6122  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6123  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
6124  if (likely(__pyx_t_2)) {
6125  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6126  __Pyx_INCREF(__pyx_t_2);
6127  __Pyx_INCREF(function);
6128  __Pyx_DECREF_SET(__pyx_t_3, function);
6129  }
6130  }
6131  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_meshEdge2Model)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_meshEdge2Model));
6132  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6133  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 154, __pyx_L1_error)
6134  __Pyx_GOTREF(__pyx_t_1);
6135  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6136  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 154, __pyx_L1_error)
6137  __pyx_t_12 = ((PyArrayObject *)__pyx_t_1);
6138  {
6139  __Pyx_BufFmt_StackElem __pyx_stack[1];
6140  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer);
6141  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
6142  if (unlikely(__pyx_t_5 < 0)) {
6143  PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
6144  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer, (PyObject*)__pyx_v_meshEdge2Model, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
6145  Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
6146  __Pyx_RaiseBufferFallbackError();
6147  } else {
6148  PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
6149  }
6150  __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
6151  }
6152  __pyx_pybuffernd_meshEdge2Model.diminfo[0].strides = __pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_meshEdge2Model.diminfo[0].shape = __pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_meshEdge2Model.diminfo[1].strides = __pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_meshEdge2Model.diminfo[1].shape = __pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer.shape[1];
6153  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 154, __pyx_L1_error)
6154  }
6155  __pyx_t_12 = 0;
6156  __Pyx_DECREF_SET(__pyx_v_meshEdge2Model, ((PyArrayObject *)__pyx_t_1));
6157  __pyx_t_1 = 0;
6158 
6159  /* "MeshAdaptPUMI/MeshAdapt.pyx":155
6160  * meshVertex2Model = np.ascontiguousarray(meshVertex2Model)
6161  * meshEdge2Model = np.ascontiguousarray(meshEdge2Model)
6162  * meshBoundary2Model = np.ascontiguousarray(meshBoundary2Model) # <<<<<<<<<<<<<<
6163  * return self.thisptr.transferModelInfo(<int*> numModelEntities.data,<int*> edges.data,<int *> faces.data,<int*> meshVertex2Model.data,<int*> meshEdge2Model.data,<int*> meshBoundary2Model.data,nMaxSegments)
6164  * #def transferBCtagsToProteus(self, np.ndarray[int,ndim=2,mode="c"] tagArray, int idx, np.ndarray[int,ndim=1,mode="c"] ebN, np.ndarray[int, ndim=2, mode="c"] eN_global, np.ndarray[np.double_t,ndim=2,mode="c"] fluxBC):
6165  */
6166  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 155, __pyx_L1_error)
6167  __Pyx_GOTREF(__pyx_t_3);
6168  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 155, __pyx_L1_error)
6169  __Pyx_GOTREF(__pyx_t_2);
6170  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6171  __pyx_t_3 = NULL;
6172  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6173  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6174  if (likely(__pyx_t_3)) {
6175  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6176  __Pyx_INCREF(__pyx_t_3);
6177  __Pyx_INCREF(function);
6178  __Pyx_DECREF_SET(__pyx_t_2, function);
6179  }
6180  }
6181  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_meshBoundary2Model)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_meshBoundary2Model));
6182  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6183  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 155, __pyx_L1_error)
6184  __Pyx_GOTREF(__pyx_t_1);
6185  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6186  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 155, __pyx_L1_error)
6187  __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
6188  {
6189  __Pyx_BufFmt_StackElem __pyx_stack[1];
6190  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer);
6191  __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack);
6192  if (unlikely(__pyx_t_5 < 0)) {
6193  PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
6194  if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer, (PyObject*)__pyx_v_meshBoundary2Model, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {
6195  Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
6196  __Pyx_RaiseBufferFallbackError();
6197  } else {
6198  PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
6199  }
6200  __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
6201  }
6202  __pyx_pybuffernd_meshBoundary2Model.diminfo[0].strides = __pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_meshBoundary2Model.diminfo[0].shape = __pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_meshBoundary2Model.diminfo[1].strides = __pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_meshBoundary2Model.diminfo[1].shape = __pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer.shape[1];
6203  if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 155, __pyx_L1_error)
6204  }
6205  __pyx_t_13 = 0;
6206  __Pyx_DECREF_SET(__pyx_v_meshBoundary2Model, ((PyArrayObject *)__pyx_t_1));
6207  __pyx_t_1 = 0;
6208 
6209  /* "MeshAdaptPUMI/MeshAdapt.pyx":156
6210  * meshEdge2Model = np.ascontiguousarray(meshEdge2Model)
6211  * meshBoundary2Model = np.ascontiguousarray(meshBoundary2Model)
6212  * return self.thisptr.transferModelInfo(<int*> numModelEntities.data,<int*> edges.data,<int *> faces.data,<int*> meshVertex2Model.data,<int*> meshEdge2Model.data,<int*> meshBoundary2Model.data,nMaxSegments) # <<<<<<<<<<<<<<
6213  * #def transferBCtagsToProteus(self, np.ndarray[int,ndim=2,mode="c"] tagArray, int idx, np.ndarray[int,ndim=1,mode="c"] ebN, np.ndarray[int, ndim=2, mode="c"] eN_global, np.ndarray[np.double_t,ndim=2,mode="c"] fluxBC):
6214  * # tagArray = np.ascontiguousarray(tagArray)
6215  */
6216  __Pyx_XDECREF(__pyx_r);
6217  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->transferModelInfo(((int *)__pyx_v_numModelEntities->data), ((int *)__pyx_v_edges->data), ((int *)__pyx_v_faces->data), ((int *)__pyx_v_meshVertex2Model->data), ((int *)__pyx_v_meshEdge2Model->data), ((int *)__pyx_v_meshBoundary2Model->data), __pyx_v_nMaxSegments)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 156, __pyx_L1_error)
6218  __Pyx_GOTREF(__pyx_t_1);
6219  __pyx_r = __pyx_t_1;
6220  __pyx_t_1 = 0;
6221  goto __pyx_L0;
6222 
6223  /* "MeshAdaptPUMI/MeshAdapt.pyx":142
6224  *
6225  *
6226  * def transferModelInfo(self, np.ndarray[int,ndim=1,mode="c"] numModelEntities, # <<<<<<<<<<<<<<
6227  * np.ndarray[int,ndim=2,mode="c"] edges,
6228  * np.ndarray[int,ndim=2,mode="c"] faces,
6229  */
6230 
6231  /* function exit code */
6232  __pyx_L1_error:;
6233  __Pyx_XDECREF(__pyx_t_1);
6234  __Pyx_XDECREF(__pyx_t_2);
6235  __Pyx_XDECREF(__pyx_t_3);
6236  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6237  __Pyx_PyThreadState_declare
6238  __Pyx_PyThreadState_assign
6239  __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6240  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges.rcbuffer->pybuffer);
6241  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_faces.rcbuffer->pybuffer);
6242  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer);
6243  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer);
6244  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer);
6245  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_numModelEntities.rcbuffer->pybuffer);
6246  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6247  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferModelInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
6248  __pyx_r = NULL;
6249  goto __pyx_L2;
6250  __pyx_L0:;
6251  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_edges.rcbuffer->pybuffer);
6252  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_faces.rcbuffer->pybuffer);
6253  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_meshBoundary2Model.rcbuffer->pybuffer);
6254  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_meshEdge2Model.rcbuffer->pybuffer);
6255  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_meshVertex2Model.rcbuffer->pybuffer);
6256  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_numModelEntities.rcbuffer->pybuffer);
6257  __pyx_L2:;
6258  __Pyx_XDECREF((PyObject *)__pyx_v_numModelEntities);
6259  __Pyx_XDECREF((PyObject *)__pyx_v_edges);
6260  __Pyx_XDECREF((PyObject *)__pyx_v_faces);
6261  __Pyx_XDECREF((PyObject *)__pyx_v_meshVertex2Model);
6262  __Pyx_XDECREF((PyObject *)__pyx_v_meshEdge2Model);
6263  __Pyx_XDECREF((PyObject *)__pyx_v_meshBoundary2Model);
6264  __Pyx_XGIVEREF(__pyx_r);
6265  __Pyx_RefNannyFinishContext();
6266  return __pyx_r;
6267 }
6268 
6269 /* "MeshAdaptPUMI/MeshAdapt.pyx":165
6270  * #def transferBCsToProteus(self):
6271  * # return self.thisptr.transferBCsToProteus()
6272  * def adaptPUMIMesh(self,inputString=""): # <<<<<<<<<<<<<<
6273  * return self.thisptr.adaptPUMIMesh(inputString)
6274  * def dumpMesh(self, cmeshTools.CMesh cmesh):
6275  */
6276 
6277 /* Python wrapper */
6278 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_51adaptPUMIMesh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6279 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_51adaptPUMIMesh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6280  PyObject *__pyx_v_inputString = 0;
6281  int __pyx_lineno = 0;
6282  const char *__pyx_filename = NULL;
6283  int __pyx_clineno = 0;
6284  PyObject *__pyx_r = 0;
6285  __Pyx_RefNannyDeclarations
6286  __Pyx_RefNannySetupContext("adaptPUMIMesh (wrapper)", 0);
6287  {
6288  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_inputString,0};
6289  PyObject* values[1] = {0};
6290  values[0] = ((PyObject *)__pyx_kp_s_);
6291  if (unlikely(__pyx_kwds)) {
6292  Py_ssize_t kw_args;
6293  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6294  switch (pos_args) {
6295  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6296  CYTHON_FALLTHROUGH;
6297  case 0: break;
6298  default: goto __pyx_L5_argtuple_error;
6299  }
6300  kw_args = PyDict_Size(__pyx_kwds);
6301  switch (pos_args) {
6302  case 0:
6303  if (kw_args > 0) {
6304  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inputString);
6305  if (value) { values[0] = value; kw_args--; }
6306  }
6307  }
6308  if (unlikely(kw_args > 0)) {
6309  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "adaptPUMIMesh") < 0)) __PYX_ERR(1, 165, __pyx_L3_error)
6310  }
6311  } else {
6312  switch (PyTuple_GET_SIZE(__pyx_args)) {
6313  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6314  CYTHON_FALLTHROUGH;
6315  case 0: break;
6316  default: goto __pyx_L5_argtuple_error;
6317  }
6318  }
6319  __pyx_v_inputString = values[0];
6320  }
6321  goto __pyx_L4_argument_unpacking_done;
6322  __pyx_L5_argtuple_error:;
6323  __Pyx_RaiseArgtupleInvalid("adaptPUMIMesh", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 165, __pyx_L3_error)
6324  __pyx_L3_error:;
6325  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.adaptPUMIMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
6326  __Pyx_RefNannyFinishContext();
6327  return NULL;
6328  __pyx_L4_argument_unpacking_done:;
6329  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_50adaptPUMIMesh(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), __pyx_v_inputString);
6330 
6331  /* function exit code */
6332  __Pyx_RefNannyFinishContext();
6333  return __pyx_r;
6334 }
6335 
6336 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_50adaptPUMIMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_inputString) {
6337  PyObject *__pyx_r = NULL;
6338  __Pyx_RefNannyDeclarations
6339  char *__pyx_t_1;
6340  PyObject *__pyx_t_2 = NULL;
6341  int __pyx_lineno = 0;
6342  const char *__pyx_filename = NULL;
6343  int __pyx_clineno = 0;
6344  __Pyx_RefNannySetupContext("adaptPUMIMesh", 0);
6345 
6346  /* "MeshAdaptPUMI/MeshAdapt.pyx":166
6347  * # return self.thisptr.transferBCsToProteus()
6348  * def adaptPUMIMesh(self,inputString=""):
6349  * return self.thisptr.adaptPUMIMesh(inputString) # <<<<<<<<<<<<<<
6350  * def dumpMesh(self, cmeshTools.CMesh cmesh):
6351  * return self.thisptr.dumpMesh(cmesh.mesh)
6352  */
6353  __Pyx_XDECREF(__pyx_r);
6354  __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_inputString); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(1, 166, __pyx_L1_error)
6355  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->adaptPUMIMesh(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 166, __pyx_L1_error)
6356  __Pyx_GOTREF(__pyx_t_2);
6357  __pyx_r = __pyx_t_2;
6358  __pyx_t_2 = 0;
6359  goto __pyx_L0;
6360 
6361  /* "MeshAdaptPUMI/MeshAdapt.pyx":165
6362  * #def transferBCsToProteus(self):
6363  * # return self.thisptr.transferBCsToProteus()
6364  * def adaptPUMIMesh(self,inputString=""): # <<<<<<<<<<<<<<
6365  * return self.thisptr.adaptPUMIMesh(inputString)
6366  * def dumpMesh(self, cmeshTools.CMesh cmesh):
6367  */
6368 
6369  /* function exit code */
6370  __pyx_L1_error:;
6371  __Pyx_XDECREF(__pyx_t_2);
6372  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.adaptPUMIMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
6373  __pyx_r = NULL;
6374  __pyx_L0:;
6375  __Pyx_XGIVEREF(__pyx_r);
6376  __Pyx_RefNannyFinishContext();
6377  return __pyx_r;
6378 }
6379 
6380 /* "MeshAdaptPUMI/MeshAdapt.pyx":167
6381  * def adaptPUMIMesh(self,inputString=""):
6382  * return self.thisptr.adaptPUMIMesh(inputString)
6383  * def dumpMesh(self, cmeshTools.CMesh cmesh): # <<<<<<<<<<<<<<
6384  * return self.thisptr.dumpMesh(cmesh.mesh)
6385  * def getERMSizeField(self, err_total):
6386  */
6387 
6388 /* Python wrapper */
6389 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_53dumpMesh(PyObject *__pyx_v_self, PyObject *__pyx_v_cmesh); /*proto*/
6390 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_53dumpMesh(PyObject *__pyx_v_self, PyObject *__pyx_v_cmesh) {
6391  int __pyx_lineno = 0;
6392  const char *__pyx_filename = NULL;
6393  int __pyx_clineno = 0;
6394  PyObject *__pyx_r = 0;
6395  __Pyx_RefNannyDeclarations
6396  __Pyx_RefNannySetupContext("dumpMesh (wrapper)", 0);
6397  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(1, 167, __pyx_L1_error)
6398  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_52dumpMesh(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)__pyx_v_cmesh));
6399 
6400  /* function exit code */
6401  goto __pyx_L0;
6402  __pyx_L1_error:;
6403  __pyx_r = NULL;
6404  __pyx_L0:;
6405  __Pyx_RefNannyFinishContext();
6406  return __pyx_r;
6407 }
6408 
6409 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_52dumpMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh) {
6410  PyObject *__pyx_r = NULL;
6411  __Pyx_RefNannyDeclarations
6412  PyObject *__pyx_t_1 = NULL;
6413  int __pyx_lineno = 0;
6414  const char *__pyx_filename = NULL;
6415  int __pyx_clineno = 0;
6416  __Pyx_RefNannySetupContext("dumpMesh", 0);
6417 
6418  /* "MeshAdaptPUMI/MeshAdapt.pyx":168
6419  * return self.thisptr.adaptPUMIMesh(inputString)
6420  * def dumpMesh(self, cmeshTools.CMesh cmesh):
6421  * return self.thisptr.dumpMesh(cmesh.mesh) # <<<<<<<<<<<<<<
6422  * def getERMSizeField(self, err_total):
6423  * return self.thisptr.getERMSizeField(err_total);
6424  */
6425  __Pyx_XDECREF(__pyx_r);
6426  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->dumpMesh(__pyx_v_cmesh->mesh)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 168, __pyx_L1_error)
6427  __Pyx_GOTREF(__pyx_t_1);
6428  __pyx_r = __pyx_t_1;
6429  __pyx_t_1 = 0;
6430  goto __pyx_L0;
6431 
6432  /* "MeshAdaptPUMI/MeshAdapt.pyx":167
6433  * def adaptPUMIMesh(self,inputString=""):
6434  * return self.thisptr.adaptPUMIMesh(inputString)
6435  * def dumpMesh(self, cmeshTools.CMesh cmesh): # <<<<<<<<<<<<<<
6436  * return self.thisptr.dumpMesh(cmesh.mesh)
6437  * def getERMSizeField(self, err_total):
6438  */
6439 
6440  /* function exit code */
6441  __pyx_L1_error:;
6442  __Pyx_XDECREF(__pyx_t_1);
6443  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.dumpMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
6444  __pyx_r = NULL;
6445  __pyx_L0:;
6446  __Pyx_XGIVEREF(__pyx_r);
6447  __Pyx_RefNannyFinishContext();
6448  return __pyx_r;
6449 }
6450 
6451 /* "MeshAdaptPUMI/MeshAdapt.pyx":169
6452  * def dumpMesh(self, cmeshTools.CMesh cmesh):
6453  * return self.thisptr.dumpMesh(cmesh.mesh)
6454  * def getERMSizeField(self, err_total): # <<<<<<<<<<<<<<
6455  * return self.thisptr.getERMSizeField(err_total);
6456  * def getMPvalue(self,field_val,val_0,val_1):
6457  */
6458 
6459 /* Python wrapper */
6460 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_55getERMSizeField(PyObject *__pyx_v_self, PyObject *__pyx_v_err_total); /*proto*/
6461 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_55getERMSizeField(PyObject *__pyx_v_self, PyObject *__pyx_v_err_total) {
6462  PyObject *__pyx_r = 0;
6463  __Pyx_RefNannyDeclarations
6464  __Pyx_RefNannySetupContext("getERMSizeField (wrapper)", 0);
6465  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_54getERMSizeField(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), ((PyObject *)__pyx_v_err_total));
6466 
6467  /* function exit code */
6468  __Pyx_RefNannyFinishContext();
6469  return __pyx_r;
6470 }
6471 
6472 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_54getERMSizeField(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_err_total) {
6473  PyObject *__pyx_r = NULL;
6474  __Pyx_RefNannyDeclarations
6475  double __pyx_t_1;
6476  PyObject *__pyx_t_2 = NULL;
6477  int __pyx_lineno = 0;
6478  const char *__pyx_filename = NULL;
6479  int __pyx_clineno = 0;
6480  __Pyx_RefNannySetupContext("getERMSizeField", 0);
6481 
6482  /* "MeshAdaptPUMI/MeshAdapt.pyx":170
6483  * return self.thisptr.dumpMesh(cmesh.mesh)
6484  * def getERMSizeField(self, err_total):
6485  * return self.thisptr.getERMSizeField(err_total); # <<<<<<<<<<<<<<
6486  * def getMPvalue(self,field_val,val_0,val_1):
6487  * return self.thisptr.getMPvalue(field_val,val_0,val_1)
6488  */
6489  __Pyx_XDECREF(__pyx_r);
6490  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_err_total); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
6491  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->getERMSizeField(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 170, __pyx_L1_error)
6492  __Pyx_GOTREF(__pyx_t_2);
6493  __pyx_r = __pyx_t_2;
6494  __pyx_t_2 = 0;
6495  goto __pyx_L0;
6496 
6497  /* "MeshAdaptPUMI/MeshAdapt.pyx":169
6498  * def dumpMesh(self, cmeshTools.CMesh cmesh):
6499  * return self.thisptr.dumpMesh(cmesh.mesh)
6500  * def getERMSizeField(self, err_total): # <<<<<<<<<<<<<<
6501  * return self.thisptr.getERMSizeField(err_total);
6502  * def getMPvalue(self,field_val,val_0,val_1):
6503  */
6504 
6505  /* function exit code */
6506  __pyx_L1_error:;
6507  __Pyx_XDECREF(__pyx_t_2);
6508  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.getERMSizeField", __pyx_clineno, __pyx_lineno, __pyx_filename);
6509  __pyx_r = NULL;
6510  __pyx_L0:;
6511  __Pyx_XGIVEREF(__pyx_r);
6512  __Pyx_RefNannyFinishContext();
6513  return __pyx_r;
6514 }
6515 
6516 /* "MeshAdaptPUMI/MeshAdapt.pyx":171
6517  * def getERMSizeField(self, err_total):
6518  * return self.thisptr.getERMSizeField(err_total);
6519  * def getMPvalue(self,field_val,val_0,val_1): # <<<<<<<<<<<<<<
6520  * return self.thisptr.getMPvalue(field_val,val_0,val_1)
6521  * def willAdapt(self):
6522  */
6523 
6524 /* Python wrapper */
6525 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_57getMPvalue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6526 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_57getMPvalue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6527  PyObject *__pyx_v_field_val = 0;
6528  PyObject *__pyx_v_val_0 = 0;
6529  PyObject *__pyx_v_val_1 = 0;
6530  int __pyx_lineno = 0;
6531  const char *__pyx_filename = NULL;
6532  int __pyx_clineno = 0;
6533  PyObject *__pyx_r = 0;
6534  __Pyx_RefNannyDeclarations
6535  __Pyx_RefNannySetupContext("getMPvalue (wrapper)", 0);
6536  {
6537  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field_val,&__pyx_n_s_val_0,&__pyx_n_s_val_1,0};
6538  PyObject* values[3] = {0,0,0};
6539  if (unlikely(__pyx_kwds)) {
6540  Py_ssize_t kw_args;
6541  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6542  switch (pos_args) {
6543  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6544  CYTHON_FALLTHROUGH;
6545  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6546  CYTHON_FALLTHROUGH;
6547  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6548  CYTHON_FALLTHROUGH;
6549  case 0: break;
6550  default: goto __pyx_L5_argtuple_error;
6551  }
6552  kw_args = PyDict_Size(__pyx_kwds);
6553  switch (pos_args) {
6554  case 0:
6555  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field_val)) != 0)) kw_args--;
6556  else goto __pyx_L5_argtuple_error;
6557  CYTHON_FALLTHROUGH;
6558  case 1:
6559  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val_0)) != 0)) kw_args--;
6560  else {
6561  __Pyx_RaiseArgtupleInvalid("getMPvalue", 1, 3, 3, 1); __PYX_ERR(1, 171, __pyx_L3_error)
6562  }
6563  CYTHON_FALLTHROUGH;
6564  case 2:
6565  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val_1)) != 0)) kw_args--;
6566  else {
6567  __Pyx_RaiseArgtupleInvalid("getMPvalue", 1, 3, 3, 2); __PYX_ERR(1, 171, __pyx_L3_error)
6568  }
6569  }
6570  if (unlikely(kw_args > 0)) {
6571  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMPvalue") < 0)) __PYX_ERR(1, 171, __pyx_L3_error)
6572  }
6573  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6574  goto __pyx_L5_argtuple_error;
6575  } else {
6576  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6577  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6578  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6579  }
6580  __pyx_v_field_val = values[0];
6581  __pyx_v_val_0 = values[1];
6582  __pyx_v_val_1 = values[2];
6583  }
6584  goto __pyx_L4_argument_unpacking_done;
6585  __pyx_L5_argtuple_error:;
6586  __Pyx_RaiseArgtupleInvalid("getMPvalue", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 171, __pyx_L3_error)
6587  __pyx_L3_error:;
6588  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.getMPvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
6589  __Pyx_RefNannyFinishContext();
6590  return NULL;
6591  __pyx_L4_argument_unpacking_done:;
6592  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_56getMPvalue(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), __pyx_v_field_val, __pyx_v_val_0, __pyx_v_val_1);
6593 
6594  /* function exit code */
6595  __Pyx_RefNannyFinishContext();
6596  return __pyx_r;
6597 }
6598 
6599 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_56getMPvalue(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_field_val, PyObject *__pyx_v_val_0, PyObject *__pyx_v_val_1) {
6600  PyObject *__pyx_r = NULL;
6601  __Pyx_RefNannyDeclarations
6602  double __pyx_t_1;
6603  double __pyx_t_2;
6604  double __pyx_t_3;
6605  PyObject *__pyx_t_4 = NULL;
6606  int __pyx_lineno = 0;
6607  const char *__pyx_filename = NULL;
6608  int __pyx_clineno = 0;
6609  __Pyx_RefNannySetupContext("getMPvalue", 0);
6610 
6611  /* "MeshAdaptPUMI/MeshAdapt.pyx":172
6612  * return self.thisptr.getERMSizeField(err_total);
6613  * def getMPvalue(self,field_val,val_0,val_1):
6614  * return self.thisptr.getMPvalue(field_val,val_0,val_1) # <<<<<<<<<<<<<<
6615  * def willAdapt(self):
6616  * return self.thisptr.willAdapt()
6617  */
6618  __Pyx_XDECREF(__pyx_r);
6619  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_field_val); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 172, __pyx_L1_error)
6620  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_val_0); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 172, __pyx_L1_error)
6621  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_val_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 172, __pyx_L1_error)
6622  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->thisptr->getMPvalue(__pyx_t_1, __pyx_t_2, __pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 172, __pyx_L1_error)
6623  __Pyx_GOTREF(__pyx_t_4);
6624  __pyx_r = __pyx_t_4;
6625  __pyx_t_4 = 0;
6626  goto __pyx_L0;
6627 
6628  /* "MeshAdaptPUMI/MeshAdapt.pyx":171
6629  * def getERMSizeField(self, err_total):
6630  * return self.thisptr.getERMSizeField(err_total);
6631  * def getMPvalue(self,field_val,val_0,val_1): # <<<<<<<<<<<<<<
6632  * return self.thisptr.getMPvalue(field_val,val_0,val_1)
6633  * def willAdapt(self):
6634  */
6635 
6636  /* function exit code */
6637  __pyx_L1_error:;
6638  __Pyx_XDECREF(__pyx_t_4);
6639  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.getMPvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
6640  __pyx_r = NULL;
6641  __pyx_L0:;
6642  __Pyx_XGIVEREF(__pyx_r);
6643  __Pyx_RefNannyFinishContext();
6644  return __pyx_r;
6645 }
6646 
6647 /* "MeshAdaptPUMI/MeshAdapt.pyx":173
6648  * def getMPvalue(self,field_val,val_0,val_1):
6649  * return self.thisptr.getMPvalue(field_val,val_0,val_1)
6650  * def willAdapt(self): # <<<<<<<<<<<<<<
6651  * return self.thisptr.willAdapt()
6652  * def willInterfaceAdapt(self):
6653  */
6654 
6655 /* Python wrapper */
6656 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_59willAdapt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6657 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_59willAdapt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6658  PyObject *__pyx_r = 0;
6659  __Pyx_RefNannyDeclarations
6660  __Pyx_RefNannySetupContext("willAdapt (wrapper)", 0);
6661  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_58willAdapt(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
6662 
6663  /* function exit code */
6664  __Pyx_RefNannyFinishContext();
6665  return __pyx_r;
6666 }
6667 
6668 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_58willAdapt(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
6669  PyObject *__pyx_r = NULL;
6670  __Pyx_RefNannyDeclarations
6671  PyObject *__pyx_t_1 = NULL;
6672  int __pyx_lineno = 0;
6673  const char *__pyx_filename = NULL;
6674  int __pyx_clineno = 0;
6675  __Pyx_RefNannySetupContext("willAdapt", 0);
6676 
6677  /* "MeshAdaptPUMI/MeshAdapt.pyx":174
6678  * return self.thisptr.getMPvalue(field_val,val_0,val_1)
6679  * def willAdapt(self):
6680  * return self.thisptr.willAdapt() # <<<<<<<<<<<<<<
6681  * def willInterfaceAdapt(self):
6682  * return self.thisptr.willInterfaceAdapt()
6683  */
6684  __Pyx_XDECREF(__pyx_r);
6685  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->willAdapt()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 174, __pyx_L1_error)
6686  __Pyx_GOTREF(__pyx_t_1);
6687  __pyx_r = __pyx_t_1;
6688  __pyx_t_1 = 0;
6689  goto __pyx_L0;
6690 
6691  /* "MeshAdaptPUMI/MeshAdapt.pyx":173
6692  * def getMPvalue(self,field_val,val_0,val_1):
6693  * return self.thisptr.getMPvalue(field_val,val_0,val_1)
6694  * def willAdapt(self): # <<<<<<<<<<<<<<
6695  * return self.thisptr.willAdapt()
6696  * def willInterfaceAdapt(self):
6697  */
6698 
6699  /* function exit code */
6700  __pyx_L1_error:;
6701  __Pyx_XDECREF(__pyx_t_1);
6702  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.willAdapt", __pyx_clineno, __pyx_lineno, __pyx_filename);
6703  __pyx_r = NULL;
6704  __pyx_L0:;
6705  __Pyx_XGIVEREF(__pyx_r);
6706  __Pyx_RefNannyFinishContext();
6707  return __pyx_r;
6708 }
6709 
6710 /* "MeshAdaptPUMI/MeshAdapt.pyx":175
6711  * def willAdapt(self):
6712  * return self.thisptr.willAdapt()
6713  * def willInterfaceAdapt(self): # <<<<<<<<<<<<<<
6714  * return self.thisptr.willInterfaceAdapt()
6715  * def get_local_error(self):
6716  */
6717 
6718 /* Python wrapper */
6719 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_61willInterfaceAdapt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6720 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_61willInterfaceAdapt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6721  PyObject *__pyx_r = 0;
6722  __Pyx_RefNannyDeclarations
6723  __Pyx_RefNannySetupContext("willInterfaceAdapt (wrapper)", 0);
6724  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_60willInterfaceAdapt(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
6725 
6726  /* function exit code */
6727  __Pyx_RefNannyFinishContext();
6728  return __pyx_r;
6729 }
6730 
6731 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_60willInterfaceAdapt(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
6732  PyObject *__pyx_r = NULL;
6733  __Pyx_RefNannyDeclarations
6734  PyObject *__pyx_t_1 = NULL;
6735  int __pyx_lineno = 0;
6736  const char *__pyx_filename = NULL;
6737  int __pyx_clineno = 0;
6738  __Pyx_RefNannySetupContext("willInterfaceAdapt", 0);
6739 
6740  /* "MeshAdaptPUMI/MeshAdapt.pyx":176
6741  * return self.thisptr.willAdapt()
6742  * def willInterfaceAdapt(self):
6743  * return self.thisptr.willInterfaceAdapt() # <<<<<<<<<<<<<<
6744  * def get_local_error(self):
6745  * errTotal=0.0;
6746  */
6747  __Pyx_XDECREF(__pyx_r);
6748  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->thisptr->willInterfaceAdapt()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 176, __pyx_L1_error)
6749  __Pyx_GOTREF(__pyx_t_1);
6750  __pyx_r = __pyx_t_1;
6751  __pyx_t_1 = 0;
6752  goto __pyx_L0;
6753 
6754  /* "MeshAdaptPUMI/MeshAdapt.pyx":175
6755  * def willAdapt(self):
6756  * return self.thisptr.willAdapt()
6757  * def willInterfaceAdapt(self): # <<<<<<<<<<<<<<
6758  * return self.thisptr.willInterfaceAdapt()
6759  * def get_local_error(self):
6760  */
6761 
6762  /* function exit code */
6763  __pyx_L1_error:;
6764  __Pyx_XDECREF(__pyx_t_1);
6765  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.willInterfaceAdapt", __pyx_clineno, __pyx_lineno, __pyx_filename);
6766  __pyx_r = NULL;
6767  __pyx_L0:;
6768  __Pyx_XGIVEREF(__pyx_r);
6769  __Pyx_RefNannyFinishContext();
6770  return __pyx_r;
6771 }
6772 
6773 /* "MeshAdaptPUMI/MeshAdapt.pyx":177
6774  * def willInterfaceAdapt(self):
6775  * return self.thisptr.willInterfaceAdapt()
6776  * def get_local_error(self): # <<<<<<<<<<<<<<
6777  * errTotal=0.0;
6778  * self.thisptr.get_local_error(errTotal)
6779  */
6780 
6781 /* Python wrapper */
6782 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_63get_local_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6783 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_63get_local_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6784  PyObject *__pyx_r = 0;
6785  __Pyx_RefNannyDeclarations
6786  __Pyx_RefNannySetupContext("get_local_error (wrapper)", 0);
6787  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_62get_local_error(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
6788 
6789  /* function exit code */
6790  __Pyx_RefNannyFinishContext();
6791  return __pyx_r;
6792 }
6793 
6794 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_62get_local_error(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
6795  double __pyx_v_errTotal;
6796  PyObject *__pyx_r = NULL;
6797  __Pyx_RefNannyDeclarations
6798  PyObject *__pyx_t_1 = NULL;
6799  int __pyx_lineno = 0;
6800  const char *__pyx_filename = NULL;
6801  int __pyx_clineno = 0;
6802  __Pyx_RefNannySetupContext("get_local_error", 0);
6803 
6804  /* "MeshAdaptPUMI/MeshAdapt.pyx":178
6805  * return self.thisptr.willInterfaceAdapt()
6806  * def get_local_error(self):
6807  * errTotal=0.0; # <<<<<<<<<<<<<<
6808  * self.thisptr.get_local_error(errTotal)
6809  * return errTotal
6810  */
6811  __pyx_v_errTotal = 0.0;
6812 
6813  /* "MeshAdaptPUMI/MeshAdapt.pyx":179
6814  * def get_local_error(self):
6815  * errTotal=0.0;
6816  * self.thisptr.get_local_error(errTotal) # <<<<<<<<<<<<<<
6817  * return errTotal
6818  * def get_VMS_error(self):
6819  */
6820  __pyx_v_self->thisptr->get_local_error(__pyx_v_errTotal);
6821 
6822  /* "MeshAdaptPUMI/MeshAdapt.pyx":180
6823  * errTotal=0.0;
6824  * self.thisptr.get_local_error(errTotal)
6825  * return errTotal # <<<<<<<<<<<<<<
6826  * def get_VMS_error(self):
6827  * errTotal=0.0;
6828  */
6829  __Pyx_XDECREF(__pyx_r);
6830  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_errTotal); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 180, __pyx_L1_error)
6831  __Pyx_GOTREF(__pyx_t_1);
6832  __pyx_r = __pyx_t_1;
6833  __pyx_t_1 = 0;
6834  goto __pyx_L0;
6835 
6836  /* "MeshAdaptPUMI/MeshAdapt.pyx":177
6837  * def willInterfaceAdapt(self):
6838  * return self.thisptr.willInterfaceAdapt()
6839  * def get_local_error(self): # <<<<<<<<<<<<<<
6840  * errTotal=0.0;
6841  * self.thisptr.get_local_error(errTotal)
6842  */
6843 
6844  /* function exit code */
6845  __pyx_L1_error:;
6846  __Pyx_XDECREF(__pyx_t_1);
6847  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.get_local_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
6848  __pyx_r = NULL;
6849  __pyx_L0:;
6850  __Pyx_XGIVEREF(__pyx_r);
6851  __Pyx_RefNannyFinishContext();
6852  return __pyx_r;
6853 }
6854 
6855 /* "MeshAdaptPUMI/MeshAdapt.pyx":181
6856  * self.thisptr.get_local_error(errTotal)
6857  * return errTotal
6858  * def get_VMS_error(self): # <<<<<<<<<<<<<<
6859  * errTotal=0.0;
6860  * self.thisptr.get_VMS_error(errTotal)
6861  */
6862 
6863 /* Python wrapper */
6864 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_65get_VMS_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6865 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_65get_VMS_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6866  PyObject *__pyx_r = 0;
6867  __Pyx_RefNannyDeclarations
6868  __Pyx_RefNannySetupContext("get_VMS_error (wrapper)", 0);
6869  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_64get_VMS_error(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
6870 
6871  /* function exit code */
6872  __Pyx_RefNannyFinishContext();
6873  return __pyx_r;
6874 }
6875 
6876 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_64get_VMS_error(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
6877  double __pyx_v_errTotal;
6878  PyObject *__pyx_r = NULL;
6879  __Pyx_RefNannyDeclarations
6880  PyObject *__pyx_t_1 = NULL;
6881  int __pyx_lineno = 0;
6882  const char *__pyx_filename = NULL;
6883  int __pyx_clineno = 0;
6884  __Pyx_RefNannySetupContext("get_VMS_error", 0);
6885 
6886  /* "MeshAdaptPUMI/MeshAdapt.pyx":182
6887  * return errTotal
6888  * def get_VMS_error(self):
6889  * errTotal=0.0; # <<<<<<<<<<<<<<
6890  * self.thisptr.get_VMS_error(errTotal)
6891  * return errTotal
6892  */
6893  __pyx_v_errTotal = 0.0;
6894 
6895  /* "MeshAdaptPUMI/MeshAdapt.pyx":183
6896  * def get_VMS_error(self):
6897  * errTotal=0.0;
6898  * self.thisptr.get_VMS_error(errTotal) # <<<<<<<<<<<<<<
6899  * return errTotal
6900  * def getMinimumQuality(self):
6901  */
6902  __pyx_v_self->thisptr->get_VMS_error(__pyx_v_errTotal);
6903 
6904  /* "MeshAdaptPUMI/MeshAdapt.pyx":184
6905  * errTotal=0.0;
6906  * self.thisptr.get_VMS_error(errTotal)
6907  * return errTotal # <<<<<<<<<<<<<<
6908  * def getMinimumQuality(self):
6909  * return self.thisptr.getMinimumQuality()
6910  */
6911  __Pyx_XDECREF(__pyx_r);
6912  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_errTotal); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 184, __pyx_L1_error)
6913  __Pyx_GOTREF(__pyx_t_1);
6914  __pyx_r = __pyx_t_1;
6915  __pyx_t_1 = 0;
6916  goto __pyx_L0;
6917 
6918  /* "MeshAdaptPUMI/MeshAdapt.pyx":181
6919  * self.thisptr.get_local_error(errTotal)
6920  * return errTotal
6921  * def get_VMS_error(self): # <<<<<<<<<<<<<<
6922  * errTotal=0.0;
6923  * self.thisptr.get_VMS_error(errTotal)
6924  */
6925 
6926  /* function exit code */
6927  __pyx_L1_error:;
6928  __Pyx_XDECREF(__pyx_t_1);
6929  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.get_VMS_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
6930  __pyx_r = NULL;
6931  __pyx_L0:;
6932  __Pyx_XGIVEREF(__pyx_r);
6933  __Pyx_RefNannyFinishContext();
6934  return __pyx_r;
6935 }
6936 
6937 /* "MeshAdaptPUMI/MeshAdapt.pyx":185
6938  * self.thisptr.get_VMS_error(errTotal)
6939  * return errTotal
6940  * def getMinimumQuality(self): # <<<<<<<<<<<<<<
6941  * return self.thisptr.getMinimumQuality()
6942  * def writeMesh(self,meshName):
6943  */
6944 
6945 /* Python wrapper */
6946 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_67getMinimumQuality(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6947 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_67getMinimumQuality(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6948  PyObject *__pyx_r = 0;
6949  __Pyx_RefNannyDeclarations
6950  __Pyx_RefNannySetupContext("getMinimumQuality (wrapper)", 0);
6951  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_66getMinimumQuality(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
6952 
6953  /* function exit code */
6954  __Pyx_RefNannyFinishContext();
6955  return __pyx_r;
6956 }
6957 
6958 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_66getMinimumQuality(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
6959  PyObject *__pyx_r = NULL;
6960  __Pyx_RefNannyDeclarations
6961  PyObject *__pyx_t_1 = NULL;
6962  int __pyx_lineno = 0;
6963  const char *__pyx_filename = NULL;
6964  int __pyx_clineno = 0;
6965  __Pyx_RefNannySetupContext("getMinimumQuality", 0);
6966 
6967  /* "MeshAdaptPUMI/MeshAdapt.pyx":186
6968  * return errTotal
6969  * def getMinimumQuality(self):
6970  * return self.thisptr.getMinimumQuality() # <<<<<<<<<<<<<<
6971  * def writeMesh(self,meshName):
6972  * return self.thisptr.writeMesh(meshName)
6973  */
6974  __Pyx_XDECREF(__pyx_r);
6975  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->thisptr->getMinimumQuality()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 186, __pyx_L1_error)
6976  __Pyx_GOTREF(__pyx_t_1);
6977  __pyx_r = __pyx_t_1;
6978  __pyx_t_1 = 0;
6979  goto __pyx_L0;
6980 
6981  /* "MeshAdaptPUMI/MeshAdapt.pyx":185
6982  * self.thisptr.get_VMS_error(errTotal)
6983  * return errTotal
6984  * def getMinimumQuality(self): # <<<<<<<<<<<<<<
6985  * return self.thisptr.getMinimumQuality()
6986  * def writeMesh(self,meshName):
6987  */
6988 
6989  /* function exit code */
6990  __pyx_L1_error:;
6991  __Pyx_XDECREF(__pyx_t_1);
6992  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.getMinimumQuality", __pyx_clineno, __pyx_lineno, __pyx_filename);
6993  __pyx_r = NULL;
6994  __pyx_L0:;
6995  __Pyx_XGIVEREF(__pyx_r);
6996  __Pyx_RefNannyFinishContext();
6997  return __pyx_r;
6998 }
6999 
7000 /* "MeshAdaptPUMI/MeshAdapt.pyx":187
7001  * def getMinimumQuality(self):
7002  * return self.thisptr.getMinimumQuality()
7003  * def writeMesh(self,meshName): # <<<<<<<<<<<<<<
7004  * return self.thisptr.writeMesh(meshName)
7005  * def cleanMesh(self):
7006  */
7007 
7008 /* Python wrapper */
7009 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_69writeMesh(PyObject *__pyx_v_self, PyObject *__pyx_v_meshName); /*proto*/
7010 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_69writeMesh(PyObject *__pyx_v_self, PyObject *__pyx_v_meshName) {
7011  PyObject *__pyx_r = 0;
7012  __Pyx_RefNannyDeclarations
7013  __Pyx_RefNannySetupContext("writeMesh (wrapper)", 0);
7014  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_68writeMesh(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), ((PyObject *)__pyx_v_meshName));
7015 
7016  /* function exit code */
7017  __Pyx_RefNannyFinishContext();
7018  return __pyx_r;
7019 }
7020 
7021 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_68writeMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_meshName) {
7022  PyObject *__pyx_r = NULL;
7023  __Pyx_RefNannyDeclarations
7024  char *__pyx_t_1;
7025  PyObject *__pyx_t_2 = NULL;
7026  int __pyx_lineno = 0;
7027  const char *__pyx_filename = NULL;
7028  int __pyx_clineno = 0;
7029  __Pyx_RefNannySetupContext("writeMesh", 0);
7030 
7031  /* "MeshAdaptPUMI/MeshAdapt.pyx":188
7032  * return self.thisptr.getMinimumQuality()
7033  * def writeMesh(self,meshName):
7034  * return self.thisptr.writeMesh(meshName) # <<<<<<<<<<<<<<
7035  * def cleanMesh(self):
7036  * return self.thisptr.cleanMesh()
7037  */
7038  __Pyx_XDECREF(__pyx_r);
7039  __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_meshName); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(1, 188, __pyx_L1_error)
7040  __pyx_t_2 = __Pyx_void_to_None(__pyx_v_self->thisptr->writeMesh(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 188, __pyx_L1_error)
7041  __Pyx_GOTREF(__pyx_t_2);
7042  __pyx_r = __pyx_t_2;
7043  __pyx_t_2 = 0;
7044  goto __pyx_L0;
7045 
7046  /* "MeshAdaptPUMI/MeshAdapt.pyx":187
7047  * def getMinimumQuality(self):
7048  * return self.thisptr.getMinimumQuality()
7049  * def writeMesh(self,meshName): # <<<<<<<<<<<<<<
7050  * return self.thisptr.writeMesh(meshName)
7051  * def cleanMesh(self):
7052  */
7053 
7054  /* function exit code */
7055  __pyx_L1_error:;
7056  __Pyx_XDECREF(__pyx_t_2);
7057  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.writeMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
7058  __pyx_r = NULL;
7059  __pyx_L0:;
7060  __Pyx_XGIVEREF(__pyx_r);
7061  __Pyx_RefNannyFinishContext();
7062  return __pyx_r;
7063 }
7064 
7065 /* "MeshAdaptPUMI/MeshAdapt.pyx":189
7066  * def writeMesh(self,meshName):
7067  * return self.thisptr.writeMesh(meshName)
7068  * def cleanMesh(self): # <<<<<<<<<<<<<<
7069  * return self.thisptr.cleanMesh()
7070  *
7071  */
7072 
7073 /* Python wrapper */
7074 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_71cleanMesh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7075 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_71cleanMesh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7076  PyObject *__pyx_r = 0;
7077  __Pyx_RefNannyDeclarations
7078  __Pyx_RefNannySetupContext("cleanMesh (wrapper)", 0);
7079  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_70cleanMesh(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
7080 
7081  /* function exit code */
7082  __Pyx_RefNannyFinishContext();
7083  return __pyx_r;
7084 }
7085 
7086 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_70cleanMesh(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
7087  PyObject *__pyx_r = NULL;
7088  __Pyx_RefNannyDeclarations
7089  PyObject *__pyx_t_1 = NULL;
7090  int __pyx_lineno = 0;
7091  const char *__pyx_filename = NULL;
7092  int __pyx_clineno = 0;
7093  __Pyx_RefNannySetupContext("cleanMesh", 0);
7094 
7095  /* "MeshAdaptPUMI/MeshAdapt.pyx":190
7096  * return self.thisptr.writeMesh(meshName)
7097  * def cleanMesh(self):
7098  * return self.thisptr.cleanMesh() # <<<<<<<<<<<<<<
7099  *
7100  * class AdaptManager():
7101  */
7102  __Pyx_XDECREF(__pyx_r);
7103  __pyx_t_1 = __Pyx_void_to_None(__pyx_v_self->thisptr->cleanMesh()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 190, __pyx_L1_error)
7104  __Pyx_GOTREF(__pyx_t_1);
7105  __pyx_r = __pyx_t_1;
7106  __pyx_t_1 = 0;
7107  goto __pyx_L0;
7108 
7109  /* "MeshAdaptPUMI/MeshAdapt.pyx":189
7110  * def writeMesh(self,meshName):
7111  * return self.thisptr.writeMesh(meshName)
7112  * def cleanMesh(self): # <<<<<<<<<<<<<<
7113  * return self.thisptr.cleanMesh()
7114  *
7115  */
7116 
7117  /* function exit code */
7118  __pyx_L1_error:;
7119  __Pyx_XDECREF(__pyx_t_1);
7120  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.cleanMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
7121  __pyx_r = NULL;
7122  __pyx_L0:;
7123  __Pyx_XGIVEREF(__pyx_r);
7124  __Pyx_RefNannyFinishContext();
7125  return __pyx_r;
7126 }
7127 
7128 /* "(tree fragment)":1
7129  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7130  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7131  * def __setstate_cython__(self, __pyx_state):
7132  */
7133 
7134 /* Python wrapper */
7135 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_73__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7136 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_73__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7137  PyObject *__pyx_r = 0;
7138  __Pyx_RefNannyDeclarations
7139  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7140  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_72__reduce_cython__(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self));
7141 
7142  /* function exit code */
7143  __Pyx_RefNannyFinishContext();
7144  return __pyx_r;
7145 }
7146 
7147 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_72__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
7148  PyObject *__pyx_r = NULL;
7149  __Pyx_RefNannyDeclarations
7150  PyObject *__pyx_t_1 = NULL;
7151  int __pyx_lineno = 0;
7152  const char *__pyx_filename = NULL;
7153  int __pyx_clineno = 0;
7154  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7155 
7156  /* "(tree fragment)":2
7157  * def __reduce_cython__(self):
7158  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7159  * def __setstate_cython__(self, __pyx_state):
7160  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7161  */
7162  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
7163  __Pyx_GOTREF(__pyx_t_1);
7164  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7165  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7166  __PYX_ERR(0, 2, __pyx_L1_error)
7167 
7168  /* "(tree fragment)":1
7169  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7170  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7171  * def __setstate_cython__(self, __pyx_state):
7172  */
7173 
7174  /* function exit code */
7175  __pyx_L1_error:;
7176  __Pyx_XDECREF(__pyx_t_1);
7177  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7178  __pyx_r = NULL;
7179  __Pyx_XGIVEREF(__pyx_r);
7180  __Pyx_RefNannyFinishContext();
7181  return __pyx_r;
7182 }
7183 
7184 /* "(tree fragment)":3
7185  * def __reduce_cython__(self):
7186  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7187  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7188  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7189  */
7190 
7191 /* Python wrapper */
7192 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_75__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7193 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_75__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7194  PyObject *__pyx_r = 0;
7195  __Pyx_RefNannyDeclarations
7196  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7197  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_74__setstate_cython__(((struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7198 
7199  /* function exit code */
7200  __Pyx_RefNannyFinishContext();
7201  return __pyx_r;
7202 }
7203 
7204 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_74__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7205  PyObject *__pyx_r = NULL;
7206  __Pyx_RefNannyDeclarations
7207  PyObject *__pyx_t_1 = NULL;
7208  int __pyx_lineno = 0;
7209  const char *__pyx_filename = NULL;
7210  int __pyx_clineno = 0;
7211  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7212 
7213  /* "(tree fragment)":4
7214  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7215  * def __setstate_cython__(self, __pyx_state):
7216  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7217  */
7218  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
7219  __Pyx_GOTREF(__pyx_t_1);
7220  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7221  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7222  __PYX_ERR(0, 4, __pyx_L1_error)
7223 
7224  /* "(tree fragment)":3
7225  * def __reduce_cython__(self):
7226  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7227  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7228  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7229  */
7230 
7231  /* function exit code */
7232  __pyx_L1_error:;
7233  __Pyx_XDECREF(__pyx_t_1);
7234  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.MeshAdapt.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7235  __pyx_r = NULL;
7236  __Pyx_XGIVEREF(__pyx_r);
7237  __Pyx_RefNannyFinishContext();
7238  return __pyx_r;
7239 }
7240 
7241 /* "MeshAdaptPUMI/MeshAdapt.pyx":193
7242  *
7243  * class AdaptManager():
7244  * def __init__(self,adapter=MeshAdapt()): # <<<<<<<<<<<<<<
7245  * self.modelDict = {}
7246  * self.sizeInputs = []
7247  */
7248 
7249 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt___defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
7250  PyObject *__pyx_r = NULL;
7251  __Pyx_RefNannyDeclarations
7252  PyObject *__pyx_t_1 = NULL;
7253  PyObject *__pyx_t_2 = NULL;
7254  int __pyx_lineno = 0;
7255  const char *__pyx_filename = NULL;
7256  int __pyx_clineno = 0;
7257  __Pyx_RefNannySetupContext("__defaults__", 0);
7258  __Pyx_XDECREF(__pyx_r);
7259  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 193, __pyx_L1_error)
7260  __Pyx_GOTREF(__pyx_t_1);
7261  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_adapter);
7262  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_adapter);
7263  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_adapter);
7264  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 193, __pyx_L1_error)
7265  __Pyx_GOTREF(__pyx_t_2);
7266  __Pyx_GIVEREF(__pyx_t_1);
7267  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
7268  __Pyx_INCREF(Py_None);
7269  __Pyx_GIVEREF(Py_None);
7270  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
7271  __pyx_t_1 = 0;
7272  __pyx_r = __pyx_t_2;
7273  __pyx_t_2 = 0;
7274  goto __pyx_L0;
7275 
7276  /* function exit code */
7277  __pyx_L1_error:;
7278  __Pyx_XDECREF(__pyx_t_1);
7279  __Pyx_XDECREF(__pyx_t_2);
7280  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7281  __pyx_r = NULL;
7282  __pyx_L0:;
7283  __Pyx_XGIVEREF(__pyx_r);
7284  __Pyx_RefNannyFinishContext();
7285  return __pyx_r;
7286 }
7287 
7288 /* Python wrapper */
7289 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_12AdaptManager_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7290 static PyMethodDef __pyx_mdef_13MeshAdaptPUMI_9MeshAdapt_12AdaptManager_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_12AdaptManager_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
7291 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_12AdaptManager_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7292  PyObject *__pyx_v_self = 0;
7293  PyObject *__pyx_v_adapter = 0;
7294  int __pyx_lineno = 0;
7295  const char *__pyx_filename = NULL;
7296  int __pyx_clineno = 0;
7297  PyObject *__pyx_r = 0;
7298  __Pyx_RefNannyDeclarations
7299  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
7300  {
7301  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_adapter,0};
7302  PyObject* values[2] = {0,0};
7303  __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
7304  values[1] = __pyx_dynamic_args->__pyx_arg_adapter;
7305  if (unlikely(__pyx_kwds)) {
7306  Py_ssize_t kw_args;
7307  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7308  switch (pos_args) {
7309  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7310  CYTHON_FALLTHROUGH;
7311  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7312  CYTHON_FALLTHROUGH;
7313  case 0: break;
7314  default: goto __pyx_L5_argtuple_error;
7315  }
7316  kw_args = PyDict_Size(__pyx_kwds);
7317  switch (pos_args) {
7318  case 0:
7319  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
7320  else goto __pyx_L5_argtuple_error;
7321  CYTHON_FALLTHROUGH;
7322  case 1:
7323  if (kw_args > 0) {
7324  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_adapter);
7325  if (value) { values[1] = value; kw_args--; }
7326  }
7327  }
7328  if (unlikely(kw_args > 0)) {
7329  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 193, __pyx_L3_error)
7330  }
7331  } else {
7332  switch (PyTuple_GET_SIZE(__pyx_args)) {
7333  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7334  CYTHON_FALLTHROUGH;
7335  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7336  break;
7337  default: goto __pyx_L5_argtuple_error;
7338  }
7339  }
7340  __pyx_v_self = values[0];
7341  __pyx_v_adapter = values[1];
7342  }
7343  goto __pyx_L4_argument_unpacking_done;
7344  __pyx_L5_argtuple_error:;
7345  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 193, __pyx_L3_error)
7346  __pyx_L3_error:;
7347  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.AdaptManager.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7348  __Pyx_RefNannyFinishContext();
7349  return NULL;
7350  __pyx_L4_argument_unpacking_done:;
7351  __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_12AdaptManager___init__(__pyx_self, __pyx_v_self, __pyx_v_adapter);
7352 
7353  /* function exit code */
7354  __Pyx_RefNannyFinishContext();
7355  return __pyx_r;
7356 }
7357 
7358 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_12AdaptManager___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_adapter) {
7359  PyObject *__pyx_r = NULL;
7360  __Pyx_RefNannyDeclarations
7361  PyObject *__pyx_t_1 = NULL;
7362  int __pyx_lineno = 0;
7363  const char *__pyx_filename = NULL;
7364  int __pyx_clineno = 0;
7365  __Pyx_RefNannySetupContext("__init__", 0);
7366 
7367  /* "MeshAdaptPUMI/MeshAdapt.pyx":194
7368  * class AdaptManager():
7369  * def __init__(self,adapter=MeshAdapt()):
7370  * self.modelDict = {} # <<<<<<<<<<<<<<
7371  * self.sizeInputs = []
7372  * self.PUMIAdapter=adapter
7373  */
7374  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 194, __pyx_L1_error)
7375  __Pyx_GOTREF(__pyx_t_1);
7376  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_modelDict, __pyx_t_1) < 0) __PYX_ERR(1, 194, __pyx_L1_error)
7377  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7378 
7379  /* "MeshAdaptPUMI/MeshAdapt.pyx":195
7380  * def __init__(self,adapter=MeshAdapt()):
7381  * self.modelDict = {}
7382  * self.sizeInputs = [] # <<<<<<<<<<<<<<
7383  * self.PUMIAdapter=adapter
7384  * self.adapt = 0
7385  */
7386  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 195, __pyx_L1_error)
7387  __Pyx_GOTREF(__pyx_t_1);
7388  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sizeInputs, __pyx_t_1) < 0) __PYX_ERR(1, 195, __pyx_L1_error)
7389  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7390 
7391  /* "MeshAdaptPUMI/MeshAdapt.pyx":196
7392  * self.modelDict = {}
7393  * self.sizeInputs = []
7394  * self.PUMIAdapter=adapter # <<<<<<<<<<<<<<
7395  * self.adapt = 0
7396  * self.hmax = 100.0
7397  */
7398  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_PUMIAdapter, __pyx_v_adapter) < 0) __PYX_ERR(1, 196, __pyx_L1_error)
7399 
7400  /* "MeshAdaptPUMI/MeshAdapt.pyx":197
7401  * self.sizeInputs = []
7402  * self.PUMIAdapter=adapter
7403  * self.adapt = 0 # <<<<<<<<<<<<<<
7404  * self.hmax = 100.0
7405  * self.hmin= 1e-8
7406  */
7407  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_adapt, __pyx_int_0) < 0) __PYX_ERR(1, 197, __pyx_L1_error)
7408 
7409  /* "MeshAdaptPUMI/MeshAdapt.pyx":198
7410  * self.PUMIAdapter=adapter
7411  * self.adapt = 0
7412  * self.hmax = 100.0 # <<<<<<<<<<<<<<
7413  * self.hmin= 1e-8
7414  * self.hphi= 1e-2
7415  */
7416  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hmax, __pyx_float_100_0) < 0) __PYX_ERR(1, 198, __pyx_L1_error)
7417 
7418  /* "MeshAdaptPUMI/MeshAdapt.pyx":199
7419  * self.adapt = 0
7420  * self.hmax = 100.0
7421  * self.hmin= 1e-8 # <<<<<<<<<<<<<<
7422  * self.hphi= 1e-2
7423  * self.numAdaptSteps= 10
7424  */
7425  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hmin, __pyx_float_1eneg_8) < 0) __PYX_ERR(1, 199, __pyx_L1_error)
7426 
7427  /* "MeshAdaptPUMI/MeshAdapt.pyx":200
7428  * self.hmax = 100.0
7429  * self.hmin= 1e-8
7430  * self.hphi= 1e-2 # <<<<<<<<<<<<<<
7431  * self.numAdaptSteps= 10
7432  * self.numIterations= 5
7433  */
7434  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hphi, __pyx_float_1eneg_2) < 0) __PYX_ERR(1, 200, __pyx_L1_error)
7435 
7436  /* "MeshAdaptPUMI/MeshAdapt.pyx":201
7437  * self.hmin= 1e-8
7438  * self.hphi= 1e-2
7439  * self.numAdaptSteps= 10 # <<<<<<<<<<<<<<
7440  * self.numIterations= 5
7441  * self.targetError= 0
7442  */
7443  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_numAdaptSteps, __pyx_int_10) < 0) __PYX_ERR(1, 201, __pyx_L1_error)
7444 
7445  /* "MeshAdaptPUMI/MeshAdapt.pyx":202
7446  * self.hphi= 1e-2
7447  * self.numAdaptSteps= 10
7448  * self.numIterations= 5 # <<<<<<<<<<<<<<
7449  * self.targetError= 0
7450  * self.gradingFactor= 1.5
7451  */
7452  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_numIterations, __pyx_int_5) < 0) __PYX_ERR(1, 202, __pyx_L1_error)
7453 
7454  /* "MeshAdaptPUMI/MeshAdapt.pyx":203
7455  * self.numAdaptSteps= 10
7456  * self.numIterations= 5
7457  * self.targetError= 0 # <<<<<<<<<<<<<<
7458  * self.gradingFactor= 1.5
7459  * self.logging= 0
7460  */
7461  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_targetError, __pyx_int_0) < 0) __PYX_ERR(1, 203, __pyx_L1_error)
7462 
7463  /* "MeshAdaptPUMI/MeshAdapt.pyx":204
7464  * self.numIterations= 5
7465  * self.targetError= 0
7466  * self.gradingFactor= 1.5 # <<<<<<<<<<<<<<
7467  * self.logging= 0
7468  * self.maxAspectRatio=100.0
7469  */
7470  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_gradingFactor, __pyx_float_1_5) < 0) __PYX_ERR(1, 204, __pyx_L1_error)
7471 
7472  /* "MeshAdaptPUMI/MeshAdapt.pyx":205
7473  * self.targetError= 0
7474  * self.gradingFactor= 1.5
7475  * self.logging= 0 # <<<<<<<<<<<<<<
7476  * self.maxAspectRatio=100.0
7477  * self.maType = ""
7478  */
7479  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_logging, __pyx_int_0) < 0) __PYX_ERR(1, 205, __pyx_L1_error)
7480 
7481  /* "MeshAdaptPUMI/MeshAdapt.pyx":206
7482  * self.gradingFactor= 1.5
7483  * self.logging= 0
7484  * self.maxAspectRatio=100.0 # <<<<<<<<<<<<<<
7485  * self.maType = ""
7486  * self.reconstructedFlag = 2
7487  */
7488  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_maxAspectRatio, __pyx_float_100_0) < 0) __PYX_ERR(1, 206, __pyx_L1_error)
7489 
7490  /* "MeshAdaptPUMI/MeshAdapt.pyx":207
7491  * self.logging= 0
7492  * self.maxAspectRatio=100.0
7493  * self.maType = "" # <<<<<<<<<<<<<<
7494  * self.reconstructedFlag = 2
7495  *
7496  */
7497  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_maType, __pyx_kp_s_) < 0) __PYX_ERR(1, 207, __pyx_L1_error)
7498 
7499  /* "MeshAdaptPUMI/MeshAdapt.pyx":208
7500  * self.maxAspectRatio=100.0
7501  * self.maType = ""
7502  * self.reconstructedFlag = 2 # <<<<<<<<<<<<<<
7503  *
7504  */
7505  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reconstructedFlag, __pyx_int_2) < 0) __PYX_ERR(1, 208, __pyx_L1_error)
7506 
7507  /* "MeshAdaptPUMI/MeshAdapt.pyx":193
7508  *
7509  * class AdaptManager():
7510  * def __init__(self,adapter=MeshAdapt()): # <<<<<<<<<<<<<<
7511  * self.modelDict = {}
7512  * self.sizeInputs = []
7513  */
7514 
7515  /* function exit code */
7516  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7517  goto __pyx_L0;
7518  __pyx_L1_error:;
7519  __Pyx_XDECREF(__pyx_t_1);
7520  __Pyx_AddTraceback("MeshAdaptPUMI.MeshAdapt.AdaptManager.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7521  __pyx_r = NULL;
7522  __pyx_L0:;
7523  __Pyx_XGIVEREF(__pyx_r);
7524  __Pyx_RefNannyFinishContext();
7525  return __pyx_r;
7526 }
7527 
7528 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
7529  * ctypedef npy_cdouble complex_t
7530  *
7531  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7532  * return PyArray_MultiIterNew(1, <void*>a)
7533  *
7534  */
7535 
7536 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7537  PyObject *__pyx_r = NULL;
7538  __Pyx_RefNannyDeclarations
7539  PyObject *__pyx_t_1 = NULL;
7540  int __pyx_lineno = 0;
7541  const char *__pyx_filename = NULL;
7542  int __pyx_clineno = 0;
7543  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
7544 
7545  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":736
7546  *
7547  * cdef inline object PyArray_MultiIterNew1(a):
7548  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
7549  *
7550  * cdef inline object PyArray_MultiIterNew2(a, b):
7551  */
7552  __Pyx_XDECREF(__pyx_r);
7553  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
7554  __Pyx_GOTREF(__pyx_t_1);
7555  __pyx_r = __pyx_t_1;
7556  __pyx_t_1 = 0;
7557  goto __pyx_L0;
7558 
7559  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
7560  * ctypedef npy_cdouble complex_t
7561  *
7562  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7563  * return PyArray_MultiIterNew(1, <void*>a)
7564  *
7565  */
7566 
7567  /* function exit code */
7568  __pyx_L1_error:;
7569  __Pyx_XDECREF(__pyx_t_1);
7570  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7571  __pyx_r = 0;
7572  __pyx_L0:;
7573  __Pyx_XGIVEREF(__pyx_r);
7574  __Pyx_RefNannyFinishContext();
7575  return __pyx_r;
7576 }
7577 
7578 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
7579  * return PyArray_MultiIterNew(1, <void*>a)
7580  *
7581  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7582  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7583  *
7584  */
7585 
7586 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7587  PyObject *__pyx_r = NULL;
7588  __Pyx_RefNannyDeclarations
7589  PyObject *__pyx_t_1 = NULL;
7590  int __pyx_lineno = 0;
7591  const char *__pyx_filename = NULL;
7592  int __pyx_clineno = 0;
7593  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
7594 
7595  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":739
7596  *
7597  * cdef inline object PyArray_MultiIterNew2(a, b):
7598  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
7599  *
7600  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7601  */
7602  __Pyx_XDECREF(__pyx_r);
7603  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
7604  __Pyx_GOTREF(__pyx_t_1);
7605  __pyx_r = __pyx_t_1;
7606  __pyx_t_1 = 0;
7607  goto __pyx_L0;
7608 
7609  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
7610  * return PyArray_MultiIterNew(1, <void*>a)
7611  *
7612  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7613  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7614  *
7615  */
7616 
7617  /* function exit code */
7618  __pyx_L1_error:;
7619  __Pyx_XDECREF(__pyx_t_1);
7620  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7621  __pyx_r = 0;
7622  __pyx_L0:;
7623  __Pyx_XGIVEREF(__pyx_r);
7624  __Pyx_RefNannyFinishContext();
7625  return __pyx_r;
7626 }
7627 
7628 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
7629  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7630  *
7631  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7632  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7633  *
7634  */
7635 
7636 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7637  PyObject *__pyx_r = NULL;
7638  __Pyx_RefNannyDeclarations
7639  PyObject *__pyx_t_1 = NULL;
7640  int __pyx_lineno = 0;
7641  const char *__pyx_filename = NULL;
7642  int __pyx_clineno = 0;
7643  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
7644 
7645  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":742
7646  *
7647  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7648  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
7649  *
7650  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7651  */
7652  __Pyx_XDECREF(__pyx_r);
7653  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error)
7654  __Pyx_GOTREF(__pyx_t_1);
7655  __pyx_r = __pyx_t_1;
7656  __pyx_t_1 = 0;
7657  goto __pyx_L0;
7658 
7659  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
7660  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7661  *
7662  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7663  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7664  *
7665  */
7666 
7667  /* function exit code */
7668  __pyx_L1_error:;
7669  __Pyx_XDECREF(__pyx_t_1);
7670  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7671  __pyx_r = 0;
7672  __pyx_L0:;
7673  __Pyx_XGIVEREF(__pyx_r);
7674  __Pyx_RefNannyFinishContext();
7675  return __pyx_r;
7676 }
7677 
7678 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
7679  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7680  *
7681  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7682  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7683  *
7684  */
7685 
7686 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7687  PyObject *__pyx_r = NULL;
7688  __Pyx_RefNannyDeclarations
7689  PyObject *__pyx_t_1 = NULL;
7690  int __pyx_lineno = 0;
7691  const char *__pyx_filename = NULL;
7692  int __pyx_clineno = 0;
7693  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
7694 
7695  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":745
7696  *
7697  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7698  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
7699  *
7700  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7701  */
7702  __Pyx_XDECREF(__pyx_r);
7703  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error)
7704  __Pyx_GOTREF(__pyx_t_1);
7705  __pyx_r = __pyx_t_1;
7706  __pyx_t_1 = 0;
7707  goto __pyx_L0;
7708 
7709  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
7710  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7711  *
7712  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7713  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7714  *
7715  */
7716 
7717  /* function exit code */
7718  __pyx_L1_error:;
7719  __Pyx_XDECREF(__pyx_t_1);
7720  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7721  __pyx_r = 0;
7722  __pyx_L0:;
7723  __Pyx_XGIVEREF(__pyx_r);
7724  __Pyx_RefNannyFinishContext();
7725  return __pyx_r;
7726 }
7727 
7728 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
7729  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7730  *
7731  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7732  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7733  *
7734  */
7735 
7736 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7737  PyObject *__pyx_r = NULL;
7738  __Pyx_RefNannyDeclarations
7739  PyObject *__pyx_t_1 = NULL;
7740  int __pyx_lineno = 0;
7741  const char *__pyx_filename = NULL;
7742  int __pyx_clineno = 0;
7743  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7744 
7745  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":748
7746  *
7747  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7748  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
7749  *
7750  * cdef inline tuple PyDataType_SHAPE(dtype d):
7751  */
7752  __Pyx_XDECREF(__pyx_r);
7753  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error)
7754  __Pyx_GOTREF(__pyx_t_1);
7755  __pyx_r = __pyx_t_1;
7756  __pyx_t_1 = 0;
7757  goto __pyx_L0;
7758 
7759  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
7760  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7761  *
7762  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7763  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7764  *
7765  */
7766 
7767  /* function exit code */
7768  __pyx_L1_error:;
7769  __Pyx_XDECREF(__pyx_t_1);
7770  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7771  __pyx_r = 0;
7772  __pyx_L0:;
7773  __Pyx_XGIVEREF(__pyx_r);
7774  __Pyx_RefNannyFinishContext();
7775  return __pyx_r;
7776 }
7777 
7778 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
7779  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7780  *
7781  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7782  * if PyDataType_HASSUBARRAY(d):
7783  * return <tuple>d.subarray.shape
7784  */
7785 
7786 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7787  PyObject *__pyx_r = NULL;
7788  __Pyx_RefNannyDeclarations
7789  int __pyx_t_1;
7790  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7791 
7792  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
7793  *
7794  * cdef inline tuple PyDataType_SHAPE(dtype d):
7795  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7796  * return <tuple>d.subarray.shape
7797  * else:
7798  */
7799  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7800  if (__pyx_t_1) {
7801 
7802  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":752
7803  * cdef inline tuple PyDataType_SHAPE(dtype d):
7804  * if PyDataType_HASSUBARRAY(d):
7805  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
7806  * else:
7807  * return ()
7808  */
7809  __Pyx_XDECREF(__pyx_r);
7810  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7811  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7812  goto __pyx_L0;
7813 
7814  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
7815  *
7816  * cdef inline tuple PyDataType_SHAPE(dtype d):
7817  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7818  * return <tuple>d.subarray.shape
7819  * else:
7820  */
7821  }
7822 
7823  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":754
7824  * return <tuple>d.subarray.shape
7825  * else:
7826  * return () # <<<<<<<<<<<<<<
7827  *
7828  *
7829  */
7830  /*else*/ {
7831  __Pyx_XDECREF(__pyx_r);
7832  __Pyx_INCREF(__pyx_empty_tuple);
7833  __pyx_r = __pyx_empty_tuple;
7834  goto __pyx_L0;
7835  }
7836 
7837  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
7838  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7839  *
7840  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7841  * if PyDataType_HASSUBARRAY(d):
7842  * return <tuple>d.subarray.shape
7843  */
7844 
7845  /* function exit code */
7846  __pyx_L0:;
7847  __Pyx_XGIVEREF(__pyx_r);
7848  __Pyx_RefNannyFinishContext();
7849  return __pyx_r;
7850 }
7851 
7852 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
7853  * int _import_umath() except -1
7854  *
7855  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7856  * Py_INCREF(base) # important to do this before stealing the reference below!
7857  * PyArray_SetBaseObject(arr, base)
7858  */
7859 
7860 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7861  __Pyx_RefNannyDeclarations
7862  __Pyx_RefNannySetupContext("set_array_base", 0);
7863 
7864  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":930
7865  *
7866  * cdef inline void set_array_base(ndarray arr, object base):
7867  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
7868  * PyArray_SetBaseObject(arr, base)
7869  *
7870  */
7871  Py_INCREF(__pyx_v_base);
7872 
7873  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":931
7874  * cdef inline void set_array_base(ndarray arr, object base):
7875  * Py_INCREF(base) # important to do this before stealing the reference below!
7876  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
7877  *
7878  * cdef inline object get_array_base(ndarray arr):
7879  */
7880  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7881 
7882  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
7883  * int _import_umath() except -1
7884  *
7885  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7886  * Py_INCREF(base) # important to do this before stealing the reference below!
7887  * PyArray_SetBaseObject(arr, base)
7888  */
7889 
7890  /* function exit code */
7891  __Pyx_RefNannyFinishContext();
7892 }
7893 
7894 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
7895  * PyArray_SetBaseObject(arr, base)
7896  *
7897  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7898  * base = PyArray_BASE(arr)
7899  * if base is NULL:
7900  */
7901 
7902 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7903  PyObject *__pyx_v_base;
7904  PyObject *__pyx_r = NULL;
7905  __Pyx_RefNannyDeclarations
7906  int __pyx_t_1;
7907  __Pyx_RefNannySetupContext("get_array_base", 0);
7908 
7909  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":934
7910  *
7911  * cdef inline object get_array_base(ndarray arr):
7912  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
7913  * if base is NULL:
7914  * return None
7915  */
7916  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7917 
7918  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
7919  * cdef inline object get_array_base(ndarray arr):
7920  * base = PyArray_BASE(arr)
7921  * if base is NULL: # <<<<<<<<<<<<<<
7922  * return None
7923  * return <object>base
7924  */
7925  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7926  if (__pyx_t_1) {
7927 
7928  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":936
7929  * base = PyArray_BASE(arr)
7930  * if base is NULL:
7931  * return None # <<<<<<<<<<<<<<
7932  * return <object>base
7933  *
7934  */
7935  __Pyx_XDECREF(__pyx_r);
7936  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7937  goto __pyx_L0;
7938 
7939  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
7940  * cdef inline object get_array_base(ndarray arr):
7941  * base = PyArray_BASE(arr)
7942  * if base is NULL: # <<<<<<<<<<<<<<
7943  * return None
7944  * return <object>base
7945  */
7946  }
7947 
7948  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":937
7949  * if base is NULL:
7950  * return None
7951  * return <object>base # <<<<<<<<<<<<<<
7952  *
7953  * # Versions of the import_* functions which are more suitable for
7954  */
7955  __Pyx_XDECREF(__pyx_r);
7956  __Pyx_INCREF(((PyObject *)__pyx_v_base));
7957  __pyx_r = ((PyObject *)__pyx_v_base);
7958  goto __pyx_L0;
7959 
7960  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
7961  * PyArray_SetBaseObject(arr, base)
7962  *
7963  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7964  * base = PyArray_BASE(arr)
7965  * if base is NULL:
7966  */
7967 
7968  /* function exit code */
7969  __pyx_L0:;
7970  __Pyx_XGIVEREF(__pyx_r);
7971  __Pyx_RefNannyFinishContext();
7972  return __pyx_r;
7973 }
7974 
7975 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
7976  * # Versions of the import_* functions which are more suitable for
7977  * # Cython code.
7978  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7979  * try:
7980  * __pyx_import_array()
7981  */
7982 
7983 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
7984  int __pyx_r;
7985  __Pyx_RefNannyDeclarations
7986  PyObject *__pyx_t_1 = NULL;
7987  PyObject *__pyx_t_2 = NULL;
7988  PyObject *__pyx_t_3 = NULL;
7989  int __pyx_t_4;
7990  PyObject *__pyx_t_5 = NULL;
7991  PyObject *__pyx_t_6 = NULL;
7992  PyObject *__pyx_t_7 = NULL;
7993  PyObject *__pyx_t_8 = NULL;
7994  int __pyx_lineno = 0;
7995  const char *__pyx_filename = NULL;
7996  int __pyx_clineno = 0;
7997  __Pyx_RefNannySetupContext("import_array", 0);
7998 
7999  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
8000  * # Cython code.
8001  * cdef inline int import_array() except -1:
8002  * try: # <<<<<<<<<<<<<<
8003  * __pyx_import_array()
8004  * except Exception:
8005  */
8006  {
8007  __Pyx_PyThreadState_declare
8008  __Pyx_PyThreadState_assign
8009  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8010  __Pyx_XGOTREF(__pyx_t_1);
8011  __Pyx_XGOTREF(__pyx_t_2);
8012  __Pyx_XGOTREF(__pyx_t_3);
8013  /*try:*/ {
8014 
8015  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":943
8016  * cdef inline int import_array() except -1:
8017  * try:
8018  * __pyx_import_array() # <<<<<<<<<<<<<<
8019  * except Exception:
8020  * raise ImportError("numpy.core.multiarray failed to import")
8021  */
8022  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
8023 
8024  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
8025  * # Cython code.
8026  * cdef inline int import_array() except -1:
8027  * try: # <<<<<<<<<<<<<<
8028  * __pyx_import_array()
8029  * except Exception:
8030  */
8031  }
8032  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8033  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8034  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8035  goto __pyx_L8_try_end;
8036  __pyx_L3_error:;
8037 
8038  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":944
8039  * try:
8040  * __pyx_import_array()
8041  * except Exception: # <<<<<<<<<<<<<<
8042  * raise ImportError("numpy.core.multiarray failed to import")
8043  *
8044  */
8045  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8046  if (__pyx_t_4) {
8047  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8048  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
8049  __Pyx_GOTREF(__pyx_t_5);
8050  __Pyx_GOTREF(__pyx_t_6);
8051  __Pyx_GOTREF(__pyx_t_7);
8052 
8053  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
8054  * __pyx_import_array()
8055  * except Exception:
8056  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
8057  *
8058  * cdef inline int import_umath() except -1:
8059  */
8060  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
8061  __Pyx_GOTREF(__pyx_t_8);
8062  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8063  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8064  __PYX_ERR(2, 945, __pyx_L5_except_error)
8065  }
8066  goto __pyx_L5_except_error;
8067  __pyx_L5_except_error:;
8068 
8069  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
8070  * # Cython code.
8071  * cdef inline int import_array() except -1:
8072  * try: # <<<<<<<<<<<<<<
8073  * __pyx_import_array()
8074  * except Exception:
8075  */
8076  __Pyx_XGIVEREF(__pyx_t_1);
8077  __Pyx_XGIVEREF(__pyx_t_2);
8078  __Pyx_XGIVEREF(__pyx_t_3);
8079  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8080  goto __pyx_L1_error;
8081  __pyx_L8_try_end:;
8082  }
8083 
8084  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
8085  * # Versions of the import_* functions which are more suitable for
8086  * # Cython code.
8087  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8088  * try:
8089  * __pyx_import_array()
8090  */
8091 
8092  /* function exit code */
8093  __pyx_r = 0;
8094  goto __pyx_L0;
8095  __pyx_L1_error:;
8096  __Pyx_XDECREF(__pyx_t_5);
8097  __Pyx_XDECREF(__pyx_t_6);
8098  __Pyx_XDECREF(__pyx_t_7);
8099  __Pyx_XDECREF(__pyx_t_8);
8100  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8101  __pyx_r = -1;
8102  __pyx_L0:;
8103  __Pyx_RefNannyFinishContext();
8104  return __pyx_r;
8105 }
8106 
8107 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
8108  * raise ImportError("numpy.core.multiarray failed to import")
8109  *
8110  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8111  * try:
8112  * _import_umath()
8113  */
8114 
8115 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
8116  int __pyx_r;
8117  __Pyx_RefNannyDeclarations
8118  PyObject *__pyx_t_1 = NULL;
8119  PyObject *__pyx_t_2 = NULL;
8120  PyObject *__pyx_t_3 = NULL;
8121  int __pyx_t_4;
8122  PyObject *__pyx_t_5 = NULL;
8123  PyObject *__pyx_t_6 = NULL;
8124  PyObject *__pyx_t_7 = NULL;
8125  PyObject *__pyx_t_8 = NULL;
8126  int __pyx_lineno = 0;
8127  const char *__pyx_filename = NULL;
8128  int __pyx_clineno = 0;
8129  __Pyx_RefNannySetupContext("import_umath", 0);
8130 
8131  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
8132  *
8133  * cdef inline int import_umath() except -1:
8134  * try: # <<<<<<<<<<<<<<
8135  * _import_umath()
8136  * except Exception:
8137  */
8138  {
8139  __Pyx_PyThreadState_declare
8140  __Pyx_PyThreadState_assign
8141  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8142  __Pyx_XGOTREF(__pyx_t_1);
8143  __Pyx_XGOTREF(__pyx_t_2);
8144  __Pyx_XGOTREF(__pyx_t_3);
8145  /*try:*/ {
8146 
8147  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":949
8148  * cdef inline int import_umath() except -1:
8149  * try:
8150  * _import_umath() # <<<<<<<<<<<<<<
8151  * except Exception:
8152  * raise ImportError("numpy.core.umath failed to import")
8153  */
8154  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
8155 
8156  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
8157  *
8158  * cdef inline int import_umath() except -1:
8159  * try: # <<<<<<<<<<<<<<
8160  * _import_umath()
8161  * except Exception:
8162  */
8163  }
8164  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8165  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8166  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8167  goto __pyx_L8_try_end;
8168  __pyx_L3_error:;
8169 
8170  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":950
8171  * try:
8172  * _import_umath()
8173  * except Exception: # <<<<<<<<<<<<<<
8174  * raise ImportError("numpy.core.umath failed to import")
8175  *
8176  */
8177  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8178  if (__pyx_t_4) {
8179  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8180  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
8181  __Pyx_GOTREF(__pyx_t_5);
8182  __Pyx_GOTREF(__pyx_t_6);
8183  __Pyx_GOTREF(__pyx_t_7);
8184 
8185  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
8186  * _import_umath()
8187  * except Exception:
8188  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8189  *
8190  * cdef inline int import_ufunc() except -1:
8191  */
8192  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
8193  __Pyx_GOTREF(__pyx_t_8);
8194  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8195  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8196  __PYX_ERR(2, 951, __pyx_L5_except_error)
8197  }
8198  goto __pyx_L5_except_error;
8199  __pyx_L5_except_error:;
8200 
8201  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
8202  *
8203  * cdef inline int import_umath() except -1:
8204  * try: # <<<<<<<<<<<<<<
8205  * _import_umath()
8206  * except Exception:
8207  */
8208  __Pyx_XGIVEREF(__pyx_t_1);
8209  __Pyx_XGIVEREF(__pyx_t_2);
8210  __Pyx_XGIVEREF(__pyx_t_3);
8211  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8212  goto __pyx_L1_error;
8213  __pyx_L8_try_end:;
8214  }
8215 
8216  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
8217  * raise ImportError("numpy.core.multiarray failed to import")
8218  *
8219  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8220  * try:
8221  * _import_umath()
8222  */
8223 
8224  /* function exit code */
8225  __pyx_r = 0;
8226  goto __pyx_L0;
8227  __pyx_L1_error:;
8228  __Pyx_XDECREF(__pyx_t_5);
8229  __Pyx_XDECREF(__pyx_t_6);
8230  __Pyx_XDECREF(__pyx_t_7);
8231  __Pyx_XDECREF(__pyx_t_8);
8232  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8233  __pyx_r = -1;
8234  __pyx_L0:;
8235  __Pyx_RefNannyFinishContext();
8236  return __pyx_r;
8237 }
8238 
8239 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
8240  * raise ImportError("numpy.core.umath failed to import")
8241  *
8242  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8243  * try:
8244  * _import_umath()
8245  */
8246 
8247 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
8248  int __pyx_r;
8249  __Pyx_RefNannyDeclarations
8250  PyObject *__pyx_t_1 = NULL;
8251  PyObject *__pyx_t_2 = NULL;
8252  PyObject *__pyx_t_3 = NULL;
8253  int __pyx_t_4;
8254  PyObject *__pyx_t_5 = NULL;
8255  PyObject *__pyx_t_6 = NULL;
8256  PyObject *__pyx_t_7 = NULL;
8257  PyObject *__pyx_t_8 = NULL;
8258  int __pyx_lineno = 0;
8259  const char *__pyx_filename = NULL;
8260  int __pyx_clineno = 0;
8261  __Pyx_RefNannySetupContext("import_ufunc", 0);
8262 
8263  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
8264  *
8265  * cdef inline int import_ufunc() except -1:
8266  * try: # <<<<<<<<<<<<<<
8267  * _import_umath()
8268  * except Exception:
8269  */
8270  {
8271  __Pyx_PyThreadState_declare
8272  __Pyx_PyThreadState_assign
8273  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8274  __Pyx_XGOTREF(__pyx_t_1);
8275  __Pyx_XGOTREF(__pyx_t_2);
8276  __Pyx_XGOTREF(__pyx_t_3);
8277  /*try:*/ {
8278 
8279  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":955
8280  * cdef inline int import_ufunc() except -1:
8281  * try:
8282  * _import_umath() # <<<<<<<<<<<<<<
8283  * except Exception:
8284  * raise ImportError("numpy.core.umath failed to import")
8285  */
8286  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
8287 
8288  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
8289  *
8290  * cdef inline int import_ufunc() except -1:
8291  * try: # <<<<<<<<<<<<<<
8292  * _import_umath()
8293  * except Exception:
8294  */
8295  }
8296  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8297  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8298  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8299  goto __pyx_L8_try_end;
8300  __pyx_L3_error:;
8301 
8302  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":956
8303  * try:
8304  * _import_umath()
8305  * except Exception: # <<<<<<<<<<<<<<
8306  * raise ImportError("numpy.core.umath failed to import")
8307  *
8308  */
8309  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8310  if (__pyx_t_4) {
8311  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8312  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
8313  __Pyx_GOTREF(__pyx_t_5);
8314  __Pyx_GOTREF(__pyx_t_6);
8315  __Pyx_GOTREF(__pyx_t_7);
8316 
8317  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":957
8318  * _import_umath()
8319  * except Exception:
8320  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8321  *
8322  * cdef extern from *:
8323  */
8324  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
8325  __Pyx_GOTREF(__pyx_t_8);
8326  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8327  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8328  __PYX_ERR(2, 957, __pyx_L5_except_error)
8329  }
8330  goto __pyx_L5_except_error;
8331  __pyx_L5_except_error:;
8332 
8333  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
8334  *
8335  * cdef inline int import_ufunc() except -1:
8336  * try: # <<<<<<<<<<<<<<
8337  * _import_umath()
8338  * except Exception:
8339  */
8340  __Pyx_XGIVEREF(__pyx_t_1);
8341  __Pyx_XGIVEREF(__pyx_t_2);
8342  __Pyx_XGIVEREF(__pyx_t_3);
8343  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8344  goto __pyx_L1_error;
8345  __pyx_L8_try_end:;
8346  }
8347 
8348  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
8349  * raise ImportError("numpy.core.umath failed to import")
8350  *
8351  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8352  * try:
8353  * _import_umath()
8354  */
8355 
8356  /* function exit code */
8357  __pyx_r = 0;
8358  goto __pyx_L0;
8359  __pyx_L1_error:;
8360  __Pyx_XDECREF(__pyx_t_5);
8361  __Pyx_XDECREF(__pyx_t_6);
8362  __Pyx_XDECREF(__pyx_t_7);
8363  __Pyx_XDECREF(__pyx_t_8);
8364  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8365  __pyx_r = -1;
8366  __pyx_L0:;
8367  __Pyx_RefNannyFinishContext();
8368  return __pyx_r;
8369 }
8370 
8371 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
8372  *
8373  *
8374  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
8375  * """
8376  * Cython equivalent of `isinstance(obj, np.timedelta64)`
8377  */
8378 
8379 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
8380  int __pyx_r;
8381  __Pyx_RefNannyDeclarations
8382  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
8383 
8384  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":979
8385  * bool
8386  * """
8387  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
8388  *
8389  *
8390  */
8391  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
8392  goto __pyx_L0;
8393 
8394  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
8395  *
8396  *
8397  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
8398  * """
8399  * Cython equivalent of `isinstance(obj, np.timedelta64)`
8400  */
8401 
8402  /* function exit code */
8403  __pyx_L0:;
8404  __Pyx_RefNannyFinishContext();
8405  return __pyx_r;
8406 }
8407 
8408 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
8409  *
8410  *
8411  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
8412  * """
8413  * Cython equivalent of `isinstance(obj, np.datetime64)`
8414  */
8415 
8416 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
8417  int __pyx_r;
8418  __Pyx_RefNannyDeclarations
8419  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
8420 
8421  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":994
8422  * bool
8423  * """
8424  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
8425  *
8426  *
8427  */
8428  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
8429  goto __pyx_L0;
8430 
8431  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
8432  *
8433  *
8434  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
8435  * """
8436  * Cython equivalent of `isinstance(obj, np.datetime64)`
8437  */
8438 
8439  /* function exit code */
8440  __pyx_L0:;
8441  __Pyx_RefNannyFinishContext();
8442  return __pyx_r;
8443 }
8444 
8445 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
8446  *
8447  *
8448  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
8449  * """
8450  * returns the int64 value underlying scalar numpy datetime64 object
8451  */
8452 
8453 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
8454  npy_datetime __pyx_r;
8455 
8456  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1004
8457  * also needed. That can be found using `get_datetime64_unit`.
8458  * """
8459  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
8460  *
8461  *
8462  */
8463  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
8464  goto __pyx_L0;
8465 
8466  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
8467  *
8468  *
8469  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
8470  * """
8471  * returns the int64 value underlying scalar numpy datetime64 object
8472  */
8473 
8474  /* function exit code */
8475  __pyx_L0:;
8476  return __pyx_r;
8477 }
8478 
8479 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
8480  *
8481  *
8482  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
8483  * """
8484  * returns the int64 value underlying scalar numpy timedelta64 object
8485  */
8486 
8487 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
8488  npy_timedelta __pyx_r;
8489 
8490  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1011
8491  * returns the int64 value underlying scalar numpy timedelta64 object
8492  * """
8493  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
8494  *
8495  *
8496  */
8497  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
8498  goto __pyx_L0;
8499 
8500  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
8501  *
8502  *
8503  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
8504  * """
8505  * returns the int64 value underlying scalar numpy timedelta64 object
8506  */
8507 
8508  /* function exit code */
8509  __pyx_L0:;
8510  return __pyx_r;
8511 }
8512 
8513 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
8514  *
8515  *
8516  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
8517  * """
8518  * returns the unit part of the dtype for a numpy datetime64 object.
8519  */
8520 
8521 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
8522  NPY_DATETIMEUNIT __pyx_r;
8523 
8524  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1018
8525  * returns the unit part of the dtype for a numpy datetime64 object.
8526  * """
8527  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
8528  */
8529  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
8530  goto __pyx_L0;
8531 
8532  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
8533  *
8534  *
8535  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
8536  * """
8537  * returns the unit part of the dtype for a numpy datetime64 object.
8538  */
8539 
8540  /* function exit code */
8541  __pyx_L0:;
8542  return __pyx_r;
8543 }
8544 
8545 /* "string.to_py":31
8546  *
8547  * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
8548  * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
8549  * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
8550  * cdef extern from *:
8551  */
8552 
8553 static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
8554  PyObject *__pyx_r = NULL;
8555  __Pyx_RefNannyDeclarations
8556  PyObject *__pyx_t_1 = NULL;
8557  int __pyx_lineno = 0;
8558  const char *__pyx_filename = NULL;
8559  int __pyx_clineno = 0;
8560  __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0);
8561 
8562  /* "string.to_py":32
8563  * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
8564  * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):
8565  * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
8566  * cdef extern from *:
8567  * cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
8568  */
8569  __Pyx_XDECREF(__pyx_r);
8570  __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
8571  __Pyx_GOTREF(__pyx_t_1);
8572  __pyx_r = __pyx_t_1;
8573  __pyx_t_1 = 0;
8574  goto __pyx_L0;
8575 
8576  /* "string.to_py":31
8577  *
8578  * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
8579  * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
8580  * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
8581  * cdef extern from *:
8582  */
8583 
8584  /* function exit code */
8585  __pyx_L1_error:;
8586  __Pyx_XDECREF(__pyx_t_1);
8587  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
8588  __pyx_r = 0;
8589  __pyx_L0:;
8590  __Pyx_XGIVEREF(__pyx_r);
8591  __Pyx_RefNannyFinishContext();
8592  return __pyx_r;
8593 }
8594 
8595 /* "string.to_py":37
8596  *
8597  * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
8598  * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
8599  * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
8600  * cdef extern from *:
8601  */
8602 
8603 static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
8604  PyObject *__pyx_r = NULL;
8605  __Pyx_RefNannyDeclarations
8606  PyObject *__pyx_t_1 = NULL;
8607  int __pyx_lineno = 0;
8608  const char *__pyx_filename = NULL;
8609  int __pyx_clineno = 0;
8610  __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);
8611 
8612  /* "string.to_py":38
8613  * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
8614  * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):
8615  * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
8616  * cdef extern from *:
8617  * cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
8618  */
8619  __Pyx_XDECREF(__pyx_r);
8620  __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
8621  __Pyx_GOTREF(__pyx_t_1);
8622  __pyx_r = __pyx_t_1;
8623  __pyx_t_1 = 0;
8624  goto __pyx_L0;
8625 
8626  /* "string.to_py":37
8627  *
8628  * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
8629  * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
8630  * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
8631  * cdef extern from *:
8632  */
8633 
8634  /* function exit code */
8635  __pyx_L1_error:;
8636  __Pyx_XDECREF(__pyx_t_1);
8637  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
8638  __pyx_r = 0;
8639  __pyx_L0:;
8640  __Pyx_XGIVEREF(__pyx_r);
8641  __Pyx_RefNannyFinishContext();
8642  return __pyx_r;
8643 }
8644 
8645 /* "string.to_py":43
8646  *
8647  * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
8648  * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
8649  * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
8650  * cdef extern from *:
8651  */
8652 
8653 static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
8654  PyObject *__pyx_r = NULL;
8655  __Pyx_RefNannyDeclarations
8656  PyObject *__pyx_t_1 = NULL;
8657  int __pyx_lineno = 0;
8658  const char *__pyx_filename = NULL;
8659  int __pyx_clineno = 0;
8660  __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0);
8661 
8662  /* "string.to_py":44
8663  * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
8664  * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):
8665  * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
8666  * cdef extern from *:
8667  * cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
8668  */
8669  __Pyx_XDECREF(__pyx_r);
8670  __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
8671  __Pyx_GOTREF(__pyx_t_1);
8672  __pyx_r = __pyx_t_1;
8673  __pyx_t_1 = 0;
8674  goto __pyx_L0;
8675 
8676  /* "string.to_py":43
8677  *
8678  * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
8679  * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
8680  * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
8681  * cdef extern from *:
8682  */
8683 
8684  /* function exit code */
8685  __pyx_L1_error:;
8686  __Pyx_XDECREF(__pyx_t_1);
8687  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
8688  __pyx_r = 0;
8689  __pyx_L0:;
8690  __Pyx_XGIVEREF(__pyx_r);
8691  __Pyx_RefNannyFinishContext();
8692  return __pyx_r;
8693 }
8694 
8695 /* "string.to_py":49
8696  *
8697  * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
8698  * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
8699  * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
8700  * cdef extern from *:
8701  */
8702 
8703 static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
8704  PyObject *__pyx_r = NULL;
8705  __Pyx_RefNannyDeclarations
8706  PyObject *__pyx_t_1 = NULL;
8707  int __pyx_lineno = 0;
8708  const char *__pyx_filename = NULL;
8709  int __pyx_clineno = 0;
8710  __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0);
8711 
8712  /* "string.to_py":50
8713  * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
8714  * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):
8715  * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
8716  * cdef extern from *:
8717  * cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
8718  */
8719  __Pyx_XDECREF(__pyx_r);
8720  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
8721  __Pyx_GOTREF(__pyx_t_1);
8722  __pyx_r = __pyx_t_1;
8723  __pyx_t_1 = 0;
8724  goto __pyx_L0;
8725 
8726  /* "string.to_py":49
8727  *
8728  * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
8729  * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
8730  * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
8731  * cdef extern from *:
8732  */
8733 
8734  /* function exit code */
8735  __pyx_L1_error:;
8736  __Pyx_XDECREF(__pyx_t_1);
8737  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
8738  __pyx_r = 0;
8739  __pyx_L0:;
8740  __Pyx_XGIVEREF(__pyx_r);
8741  __Pyx_RefNannyFinishContext();
8742  return __pyx_r;
8743 }
8744 
8745 /* "string.to_py":55
8746  *
8747  * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
8748  * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
8749  * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
8750  *
8751  */
8752 
8753 static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
8754  PyObject *__pyx_r = NULL;
8755  __Pyx_RefNannyDeclarations
8756  PyObject *__pyx_t_1 = NULL;
8757  int __pyx_lineno = 0;
8758  const char *__pyx_filename = NULL;
8759  int __pyx_clineno = 0;
8760  __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);
8761 
8762  /* "string.to_py":56
8763  * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
8764  * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):
8765  * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
8766  *
8767  */
8768  __Pyx_XDECREF(__pyx_r);
8769  __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
8770  __Pyx_GOTREF(__pyx_t_1);
8771  __pyx_r = __pyx_t_1;
8772  __pyx_t_1 = 0;
8773  goto __pyx_L0;
8774 
8775  /* "string.to_py":55
8776  *
8777  * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
8778  * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
8779  * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
8780  *
8781  */
8782 
8783  /* function exit code */
8784  __pyx_L1_error:;
8785  __Pyx_XDECREF(__pyx_t_1);
8786  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
8787  __pyx_r = 0;
8788  __pyx_L0:;
8789  __Pyx_XGIVEREF(__pyx_r);
8790  __Pyx_RefNannyFinishContext();
8791  return __pyx_r;
8792 }
8793 
8794 /* "string.from_py":13
8795  *
8796  * @cname("__pyx_convert_string_from_py_std__in_string")
8797  * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
8798  * cdef Py_ssize_t length = 0
8799  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
8800  */
8801 
8802 static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
8803  Py_ssize_t __pyx_v_length;
8804  char const *__pyx_v_data;
8805  std::string __pyx_r;
8806  __Pyx_RefNannyDeclarations
8807  char const *__pyx_t_1;
8808  int __pyx_lineno = 0;
8809  const char *__pyx_filename = NULL;
8810  int __pyx_clineno = 0;
8811  __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);
8812 
8813  /* "string.from_py":14
8814  * @cname("__pyx_convert_string_from_py_std__in_string")
8815  * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
8816  * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<<
8817  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
8818  * return string(data, length)
8819  */
8820  __pyx_v_length = 0;
8821 
8822  /* "string.from_py":15
8823  * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
8824  * cdef Py_ssize_t length = 0
8825  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<<
8826  * return string(data, length)
8827  *
8828  */
8829  __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(0, 15, __pyx_L1_error)
8830  __pyx_v_data = __pyx_t_1;
8831 
8832  /* "string.from_py":16
8833  * cdef Py_ssize_t length = 0
8834  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
8835  * return string(data, length) # <<<<<<<<<<<<<<
8836  *
8837  *
8838  */
8839  __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
8840  goto __pyx_L0;
8841 
8842  /* "string.from_py":13
8843  *
8844  * @cname("__pyx_convert_string_from_py_std__in_string")
8845  * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
8846  * cdef Py_ssize_t length = 0
8847  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
8848  */
8849 
8850  /* function exit code */
8851  __pyx_L1_error:;
8852  __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
8853  __Pyx_pretend_to_initialize(&__pyx_r);
8854  __pyx_L0:;
8855  __Pyx_RefNannyFinishContext();
8856  return __pyx_r;
8857 }
8858 
8859 static PyObject *__pyx_tp_new_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
8860  PyObject *o;
8861  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
8862  o = (*t->tp_alloc)(t, 0);
8863  } else {
8864  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
8865  }
8866  if (unlikely(!o)) return 0;
8867  if (unlikely(__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
8868  return o;
8869  bad:
8870  Py_DECREF(o); o = 0;
8871  return NULL;
8872 }
8873 
8874 static void __pyx_tp_dealloc_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt(PyObject *o) {
8875  #if CYTHON_USE_TP_FINALIZE
8876  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
8877  if (PyObject_CallFinalizerFromDealloc(o)) return;
8878  }
8879  #endif
8880  {
8881  PyObject *etype, *eval, *etb;
8882  PyErr_Fetch(&etype, &eval, &etb);
8883  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
8884  __pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_3__dealloc__(o);
8885  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
8886  PyErr_Restore(etype, eval, etb);
8887  }
8888  (*Py_TYPE(o)->tp_free)(o);
8889 }
8890 
8891 static PyMethodDef __pyx_methods_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt[] = {
8892  {"size_field_config", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_5size_field_config, METH_NOARGS, 0},
8893  {"adapt_type_config", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_7adapt_type_config, METH_NOARGS, 0},
8894  {"numIter", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_9numIter, METH_NOARGS, 0},
8895  {"adaptMesh", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_11adaptMesh, METH_NOARGS, 0},
8896  {"numAdaptSteps", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_13numAdaptSteps, METH_NOARGS, 0},
8897  {"nAdapt", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_15nAdapt, METH_NOARGS, 0},
8898  {"set_nAdapt", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_17set_nAdapt, METH_O, 0},
8899  {"isReconstructed", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_19isReconstructed, METH_NOARGS, 0},
8900  {"loadModelAndMesh", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_21loadModelAndMesh, METH_VARARGS|METH_KEYWORDS, 0},
8901  {"loadMeshForAnalytic", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_23loadMeshForAnalytic, METH_VARARGS|METH_KEYWORDS, 0},
8902  {"updateSphereCoordinates", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_25updateSphereCoordinates, METH_O, 0},
8903  {"reconstructFromProteus", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_27reconstructFromProteus, METH_VARARGS|METH_KEYWORDS, 0},
8904  {"reconstructFromProteus2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_29reconstructFromProteus2, METH_VARARGS|METH_KEYWORDS, 0},
8905  {"constructFromSerialPUMIMesh", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_31constructFromSerialPUMIMesh, METH_O, 0},
8906  {"constructFromParallelPUMIMesh", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_33constructFromParallelPUMIMesh, METH_VARARGS|METH_KEYWORDS, 0},
8907  {"updateMaterialArrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_35updateMaterialArrays, METH_VARARGS|METH_KEYWORDS, 0},
8908  {"updateMaterialArrays2", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_37updateMaterialArrays2, METH_O, 0},
8909  {"transferFieldToPUMI", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_39transferFieldToPUMI, METH_VARARGS|METH_KEYWORDS, 0},
8910  {"transferFieldToProteus", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_41transferFieldToProteus, METH_VARARGS|METH_KEYWORDS, 0},
8911  {"transferElementFieldToProteus", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_43transferElementFieldToProteus, METH_VARARGS|METH_KEYWORDS, 0},
8912  {"transferPropertiesToPUMI", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_45transferPropertiesToPUMI, METH_VARARGS|METH_KEYWORDS, 0},
8913  {"setAdaptProperties", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_47setAdaptProperties, METH_O, 0},
8914  {"transferModelInfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_49transferModelInfo, METH_VARARGS|METH_KEYWORDS, 0},
8915  {"adaptPUMIMesh", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_51adaptPUMIMesh, METH_VARARGS|METH_KEYWORDS, 0},
8916  {"dumpMesh", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_53dumpMesh, METH_O, 0},
8917  {"getERMSizeField", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_55getERMSizeField, METH_O, 0},
8918  {"getMPvalue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_57getMPvalue, METH_VARARGS|METH_KEYWORDS, 0},
8919  {"willAdapt", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_59willAdapt, METH_NOARGS, 0},
8920  {"willInterfaceAdapt", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_61willInterfaceAdapt, METH_NOARGS, 0},
8921  {"get_local_error", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_63get_local_error, METH_NOARGS, 0},
8922  {"get_VMS_error", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_65get_VMS_error, METH_NOARGS, 0},
8923  {"getMinimumQuality", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_67getMinimumQuality, METH_NOARGS, 0},
8924  {"writeMesh", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_69writeMesh, METH_O, 0},
8925  {"cleanMesh", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_71cleanMesh, METH_NOARGS, 0},
8926  {"__reduce_cython__", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_73__reduce_cython__, METH_NOARGS, 0},
8927  {"__setstate_cython__", (PyCFunction)__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_75__setstate_cython__, METH_O, 0},
8928  {0, 0, 0, 0}
8929 };
8930 
8931 static PyTypeObject __pyx_type_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt = {
8932  PyVarObject_HEAD_INIT(0, 0)
8933  "MeshAdaptPUMI.MeshAdapt.MeshAdapt", /*tp_name*/
8934  sizeof(struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt), /*tp_basicsize*/
8935  0, /*tp_itemsize*/
8936  __pyx_tp_dealloc_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt, /*tp_dealloc*/
8937  #if PY_VERSION_HEX < 0x030800b4
8938  0, /*tp_print*/
8939  #endif
8940  #if PY_VERSION_HEX >= 0x030800b4
8941  0, /*tp_vectorcall_offset*/
8942  #endif
8943  0, /*tp_getattr*/
8944  0, /*tp_setattr*/
8945  #if PY_MAJOR_VERSION < 3
8946  0, /*tp_compare*/
8947  #endif
8948  #if PY_MAJOR_VERSION >= 3
8949  0, /*tp_as_async*/
8950  #endif
8951  0, /*tp_repr*/
8952  0, /*tp_as_number*/
8953  0, /*tp_as_sequence*/
8954  0, /*tp_as_mapping*/
8955  0, /*tp_hash*/
8956  0, /*tp_call*/
8957  0, /*tp_str*/
8958  0, /*tp_getattro*/
8959  0, /*tp_setattro*/
8960  0, /*tp_as_buffer*/
8961  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
8962  0, /*tp_doc*/
8963  0, /*tp_traverse*/
8964  0, /*tp_clear*/
8965  0, /*tp_richcompare*/
8966  0, /*tp_weaklistoffset*/
8967  0, /*tp_iter*/
8968  0, /*tp_iternext*/
8969  __pyx_methods_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt, /*tp_methods*/
8970  0, /*tp_members*/
8971  0, /*tp_getset*/
8972  0, /*tp_base*/
8973  0, /*tp_dict*/
8974  0, /*tp_descr_get*/
8975  0, /*tp_descr_set*/
8976  0, /*tp_dictoffset*/
8977  0, /*tp_init*/
8978  0, /*tp_alloc*/
8979  __pyx_tp_new_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt, /*tp_new*/
8980  0, /*tp_free*/
8981  0, /*tp_is_gc*/
8982  0, /*tp_bases*/
8983  0, /*tp_mro*/
8984  0, /*tp_cache*/
8985  0, /*tp_subclasses*/
8986  0, /*tp_weaklist*/
8987  0, /*tp_del*/
8988  0, /*tp_version_tag*/
8989  #if PY_VERSION_HEX >= 0x030400a1
8990  0, /*tp_finalize*/
8991  #endif
8992  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
8993  0, /*tp_vectorcall*/
8994  #endif
8995  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
8996  0, /*tp_print*/
8997  #endif
8998  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
8999  0, /*tp_pypy_flags*/
9000  #endif
9001 };
9002 
9003 static PyMethodDef __pyx_methods[] = {
9004  {0, 0, 0, 0}
9005 };
9006 
9007 #if PY_MAJOR_VERSION >= 3
9008 #if CYTHON_PEP489_MULTI_PHASE_INIT
9009 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
9010 static int __pyx_pymod_exec_MeshAdapt(PyObject* module); /*proto*/
9011 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
9012  {Py_mod_create, (void*)__pyx_pymod_create},
9013  {Py_mod_exec, (void*)__pyx_pymod_exec_MeshAdapt},
9014  {0, NULL}
9015 };
9016 #endif
9017 
9018 static struct PyModuleDef __pyx_moduledef = {
9019  PyModuleDef_HEAD_INIT,
9020  "MeshAdapt",
9021  0, /* m_doc */
9022  #if CYTHON_PEP489_MULTI_PHASE_INIT
9023  0, /* m_size */
9024  #else
9025  -1, /* m_size */
9026  #endif
9027  __pyx_methods /* m_methods */,
9028  #if CYTHON_PEP489_MULTI_PHASE_INIT
9029  __pyx_moduledef_slots, /* m_slots */
9030  #else
9031  NULL, /* m_reload */
9032  #endif
9033  NULL, /* m_traverse */
9034  NULL, /* m_clear */
9035  NULL /* m_free */
9036 };
9037 #endif
9038 #ifndef CYTHON_SMALL_CODE
9039 #if defined(__clang__)
9040  #define CYTHON_SMALL_CODE
9041 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
9042  #define CYTHON_SMALL_CODE __attribute__((cold))
9043 #else
9044  #define CYTHON_SMALL_CODE
9045 #endif
9046 #endif
9047 
9048 static __Pyx_StringTabEntry __pyx_string_tab[] = {
9049  {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
9050  {&__pyx_n_s_AdaptManager, __pyx_k_AdaptManager, sizeof(__pyx_k_AdaptManager), 0, 0, 1, 1},
9051  {&__pyx_n_s_AdaptManager___init, __pyx_k_AdaptManager___init, sizeof(__pyx_k_AdaptManager___init), 0, 0, 1, 1},
9052  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
9053  {&__pyx_n_s_MeshAdapt, __pyx_k_MeshAdapt, sizeof(__pyx_k_MeshAdapt), 0, 0, 1, 1},
9054  {&__pyx_n_s_MeshAdaptPUMI_MeshAdapt, __pyx_k_MeshAdaptPUMI_MeshAdapt, sizeof(__pyx_k_MeshAdaptPUMI_MeshAdapt), 0, 0, 1, 1},
9055  {&__pyx_n_s_PUMIAdapter, __pyx_k_PUMIAdapter, sizeof(__pyx_k_PUMIAdapter), 0, 0, 1, 1},
9056  {&__pyx_n_s_Profiling, __pyx_k_Profiling, sizeof(__pyx_k_Profiling), 0, 0, 1, 1},
9057  {&__pyx_n_s_T_simulation, __pyx_k_T_simulation, sizeof(__pyx_k_T_simulation), 0, 0, 1, 1},
9058  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
9059  {&__pyx_n_s_adapt, __pyx_k_adapt, sizeof(__pyx_k_adapt), 0, 0, 1, 1},
9060  {&__pyx_n_s_adapter, __pyx_k_adapter, sizeof(__pyx_k_adapter), 0, 0, 1, 1},
9061  {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1},
9062  {&__pyx_n_s_bFaces, __pyx_k_bFaces, sizeof(__pyx_k_bFaces), 0, 0, 1, 1},
9063  {&__pyx_n_s_bdryId, __pyx_k_bdryId, sizeof(__pyx_k_bdryId), 0, 0, 1, 1},
9064  {&__pyx_n_s_boxDim, __pyx_k_boxDim, sizeof(__pyx_k_boxDim), 0, 0, 1, 1},
9065  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
9066  {&__pyx_n_s_cmesh, __pyx_k_cmesh, sizeof(__pyx_k_cmesh), 0, 0, 1, 1},
9067  {&__pyx_n_s_deltaT, __pyx_k_deltaT, sizeof(__pyx_k_deltaT), 0, 0, 1, 1},
9068  {&__pyx_n_s_deltaT_next, __pyx_k_deltaT_next, sizeof(__pyx_k_deltaT_next), 0, 0, 1, 1},
9069  {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1},
9070  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
9071  {&__pyx_n_s_edges, __pyx_k_edges, sizeof(__pyx_k_edges), 0, 0, 1, 1},
9072  {&__pyx_n_s_faces, __pyx_k_faces, sizeof(__pyx_k_faces), 0, 0, 1, 1},
9073  {&__pyx_n_s_field_val, __pyx_k_field_val, sizeof(__pyx_k_field_val), 0, 0, 1, 1},
9074  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
9075  {&__pyx_n_s_geomName, __pyx_k_geomName, sizeof(__pyx_k_geomName), 0, 0, 1, 1},
9076  {&__pyx_n_s_geomTag, __pyx_k_geomTag, sizeof(__pyx_k_geomTag), 0, 0, 1, 1},
9077  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
9078  {&__pyx_n_s_global_cmesh, __pyx_k_global_cmesh, sizeof(__pyx_k_global_cmesh), 0, 0, 1, 1},
9079  {&__pyx_n_s_gradingFactor, __pyx_k_gradingFactor, sizeof(__pyx_k_gradingFactor), 0, 0, 1, 1},
9080  {&__pyx_n_s_hasModel, __pyx_k_hasModel, sizeof(__pyx_k_hasModel), 0, 0, 1, 1},
9081  {&__pyx_n_s_hmax, __pyx_k_hmax, sizeof(__pyx_k_hmax), 0, 0, 1, 1},
9082  {&__pyx_n_s_hmin, __pyx_k_hmin, sizeof(__pyx_k_hmin), 0, 0, 1, 1},
9083  {&__pyx_n_s_hphi, __pyx_k_hphi, sizeof(__pyx_k_hphi), 0, 0, 1, 1},
9084  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
9085  {&__pyx_n_s_inArray, __pyx_k_inArray, sizeof(__pyx_k_inArray), 0, 0, 1, 1},
9086  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
9087  {&__pyx_n_s_inputString, __pyx_k_inputString, sizeof(__pyx_k_inputString), 0, 0, 1, 1},
9088  {&__pyx_n_s_interfaceBandSize, __pyx_k_interfaceBandSize, sizeof(__pyx_k_interfaceBandSize), 0, 0, 1, 1},
9089  {&__pyx_n_s_isModelVert, __pyx_k_isModelVert, sizeof(__pyx_k_isModelVert), 0, 0, 1, 1},
9090  {&__pyx_n_s_logEvent, __pyx_k_logEvent, sizeof(__pyx_k_logEvent), 0, 0, 1, 1},
9091  {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
9092  {&__pyx_n_s_maType, __pyx_k_maType, sizeof(__pyx_k_maType), 0, 0, 1, 1},
9093  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
9094  {&__pyx_n_s_maxAspectRatio, __pyx_k_maxAspectRatio, sizeof(__pyx_k_maxAspectRatio), 0, 0, 1, 1},
9095  {&__pyx_n_s_meshBoundary2Model, __pyx_k_meshBoundary2Model, sizeof(__pyx_k_meshBoundary2Model), 0, 0, 1, 1},
9096  {&__pyx_n_s_meshEdge2Model, __pyx_k_meshEdge2Model, sizeof(__pyx_k_meshEdge2Model), 0, 0, 1, 1},
9097  {&__pyx_n_s_meshName, __pyx_k_meshName, sizeof(__pyx_k_meshName), 0, 0, 1, 1},
9098  {&__pyx_n_s_meshVertex2Model, __pyx_k_meshVertex2Model, sizeof(__pyx_k_meshVertex2Model), 0, 0, 1, 1},
9099  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
9100  {&__pyx_n_s_modelDict, __pyx_k_modelDict, sizeof(__pyx_k_modelDict), 0, 0, 1, 1},
9101  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
9102  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
9103  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
9104  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
9105  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
9106  {&__pyx_n_s_nu, __pyx_k_nu, sizeof(__pyx_k_nu), 0, 0, 1, 1},
9107  {&__pyx_n_s_numAdaptSteps, __pyx_k_numAdaptSteps, sizeof(__pyx_k_numAdaptSteps), 0, 0, 1, 1},
9108  {&__pyx_n_s_numIterations, __pyx_k_numIterations, sizeof(__pyx_k_numIterations), 0, 0, 1, 1},
9109  {&__pyx_n_s_numModelEntities, __pyx_k_numModelEntities, sizeof(__pyx_k_numModelEntities), 0, 0, 1, 1},
9110  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
9111  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
9112  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
9113  {&__pyx_n_s_outArray, __pyx_k_outArray, sizeof(__pyx_k_outArray), 0, 0, 1, 1},
9114  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
9115  {&__pyx_kp_s_proteus_MeshAdaptPUMI_MeshAdapt, __pyx_k_proteus_MeshAdaptPUMI_MeshAdapt, sizeof(__pyx_k_proteus_MeshAdaptPUMI_MeshAdapt), 0, 0, 1, 0},
9116  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
9117  {&__pyx_n_s_reconstructedFlag, __pyx_k_reconstructedFlag, sizeof(__pyx_k_reconstructedFlag), 0, 0, 1, 1},
9118  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
9119  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
9120  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
9121  {&__pyx_n_s_rho, __pyx_k_rho, sizeof(__pyx_k_rho), 0, 0, 1, 1},
9122  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
9123  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
9124  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
9125  {&__pyx_n_s_sizeInputs, __pyx_k_sizeInputs, sizeof(__pyx_k_sizeInputs), 0, 0, 1, 1},
9126  {&__pyx_n_s_sphereCenter, __pyx_k_sphereCenter, sizeof(__pyx_k_sphereCenter), 0, 0, 1, 1},
9127  {&__pyx_n_s_sphereRadius, __pyx_k_sphereRadius, sizeof(__pyx_k_sphereRadius), 0, 0, 1, 1},
9128  {&__pyx_n_s_subdomain_cmesh, __pyx_k_subdomain_cmesh, sizeof(__pyx_k_subdomain_cmesh), 0, 0, 1, 1},
9129  {&__pyx_n_s_targetError, __pyx_k_targetError, sizeof(__pyx_k_targetError), 0, 0, 1, 1},
9130  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
9131  {&__pyx_n_s_val_0, __pyx_k_val_0, sizeof(__pyx_k_val_0), 0, 0, 1, 1},
9132  {&__pyx_n_s_val_1, __pyx_k_val_1, sizeof(__pyx_k_val_1), 0, 0, 1, 1},
9133  {0, 0, 0, 0, 0, 0, 0}
9134 };
9135 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
9136  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
9137  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
9138  return 0;
9139  __pyx_L1_error:;
9140  return -1;
9141 }
9142 
9143 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
9144  __Pyx_RefNannyDeclarations
9145  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
9146 
9147  /* "(tree fragment)":2
9148  * def __reduce_cython__(self):
9149  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9150  * def __setstate_cython__(self, __pyx_state):
9151  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9152  */
9153  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 2, __pyx_L1_error)
9154  __Pyx_GOTREF(__pyx_tuple__2);
9155  __Pyx_GIVEREF(__pyx_tuple__2);
9156 
9157  /* "(tree fragment)":4
9158  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9159  * def __setstate_cython__(self, __pyx_state):
9160  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9161  */
9162  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 4, __pyx_L1_error)
9163  __Pyx_GOTREF(__pyx_tuple__3);
9164  __Pyx_GIVEREF(__pyx_tuple__3);
9165 
9166  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
9167  * __pyx_import_array()
9168  * except Exception:
9169  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
9170  *
9171  * cdef inline int import_umath() except -1:
9172  */
9173  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 945, __pyx_L1_error)
9174  __Pyx_GOTREF(__pyx_tuple__4);
9175  __Pyx_GIVEREF(__pyx_tuple__4);
9176 
9177  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
9178  * _import_umath()
9179  * except Exception:
9180  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
9181  *
9182  * cdef inline int import_ufunc() except -1:
9183  */
9184  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 951, __pyx_L1_error)
9185  __Pyx_GOTREF(__pyx_tuple__5);
9186  __Pyx_GIVEREF(__pyx_tuple__5);
9187 
9188  /* "MeshAdaptPUMI/MeshAdapt.pyx":193
9189  *
9190  * class AdaptManager():
9191  * def __init__(self,adapter=MeshAdapt()): # <<<<<<<<<<<<<<
9192  * self.modelDict = {}
9193  * self.sizeInputs = []
9194  */
9195  __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_adapter); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 193, __pyx_L1_error)
9196  __Pyx_GOTREF(__pyx_tuple__6);
9197  __Pyx_GIVEREF(__pyx_tuple__6);
9198  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_MeshAdaptPUMI_MeshAdapt, __pyx_n_s_init, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(1, 193, __pyx_L1_error)
9199  __Pyx_RefNannyFinishContext();
9200  return 0;
9201  __pyx_L1_error:;
9202  __Pyx_RefNannyFinishContext();
9203  return -1;
9204 }
9205 
9206 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
9207  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
9208  __pyx_float_1_5 = PyFloat_FromDouble(1.5); if (unlikely(!__pyx_float_1_5)) __PYX_ERR(1, 1, __pyx_L1_error)
9209  __pyx_float_1eneg_2 = PyFloat_FromDouble(1e-2); if (unlikely(!__pyx_float_1eneg_2)) __PYX_ERR(1, 1, __pyx_L1_error)
9210  __pyx_float_1eneg_8 = PyFloat_FromDouble(1e-8); if (unlikely(!__pyx_float_1eneg_8)) __PYX_ERR(1, 1, __pyx_L1_error)
9211  __pyx_float_100_0 = PyFloat_FromDouble(100.0); if (unlikely(!__pyx_float_100_0)) __PYX_ERR(1, 1, __pyx_L1_error)
9212  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error)
9213  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(1, 1, __pyx_L1_error)
9214  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(1, 1, __pyx_L1_error)
9215  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(1, 1, __pyx_L1_error)
9216  return 0;
9217  __pyx_L1_error:;
9218  return -1;
9219 }
9220 
9221 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
9222 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
9223 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
9224 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
9225 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
9226 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
9227 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
9228 
9229 static int __Pyx_modinit_global_init_code(void) {
9230  __Pyx_RefNannyDeclarations
9231  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
9232  /*--- Global init code ---*/
9233  __Pyx_RefNannyFinishContext();
9234  return 0;
9235 }
9236 
9237 static int __Pyx_modinit_variable_export_code(void) {
9238  __Pyx_RefNannyDeclarations
9239  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
9240  /*--- Variable export code ---*/
9241  __Pyx_RefNannyFinishContext();
9242  return 0;
9243 }
9244 
9245 static int __Pyx_modinit_function_export_code(void) {
9246  __Pyx_RefNannyDeclarations
9247  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
9248  /*--- Function export code ---*/
9249  __Pyx_RefNannyFinishContext();
9250  return 0;
9251 }
9252 
9253 static int __Pyx_modinit_type_init_code(void) {
9254  __Pyx_RefNannyDeclarations
9255  int __pyx_lineno = 0;
9256  const char *__pyx_filename = NULL;
9257  int __pyx_clineno = 0;
9258  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
9259  /*--- Type init code ---*/
9260  if (PyType_Ready(&__pyx_type_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt) < 0) __PYX_ERR(1, 56, __pyx_L1_error)
9261  #if PY_VERSION_HEX < 0x030800B1
9262  __pyx_type_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt.tp_print = 0;
9263  #endif
9264  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt.tp_dictoffset && __pyx_type_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt.tp_getattro == PyObject_GenericGetAttr)) {
9265  __pyx_type_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt.tp_getattro = __Pyx_PyObject_GenericGetAttr;
9266  }
9267  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MeshAdapt, (PyObject *)&__pyx_type_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt) < 0) __PYX_ERR(1, 56, __pyx_L1_error)
9268  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt) < 0) __PYX_ERR(1, 56, __pyx_L1_error)
9269  __pyx_ptype_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt = &__pyx_type_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt;
9270  __Pyx_RefNannyFinishContext();
9271  return 0;
9272  __pyx_L1_error:;
9273  __Pyx_RefNannyFinishContext();
9274  return -1;
9275 }
9276 
9277 static int __Pyx_modinit_type_import_code(void) {
9278  __Pyx_RefNannyDeclarations
9279  PyObject *__pyx_t_1 = NULL;
9280  int __pyx_lineno = 0;
9281  const char *__pyx_filename = NULL;
9282  int __pyx_clineno = 0;
9283  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
9284  /*--- Type import code ---*/
9285  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
9286  __Pyx_GOTREF(__pyx_t_1);
9287  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
9288  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
9289  sizeof(PyTypeObject),
9290  #else
9291  sizeof(PyHeapTypeObject),
9292  #endif
9293  __Pyx_ImportType_CheckSize_Warn);
9294  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
9295  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9296  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
9297  __Pyx_GOTREF(__pyx_t_1);
9298  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
9299  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
9300  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
9301  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
9302  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
9303  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
9304  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
9305  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
9306  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9307  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
9308  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9309  if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
9310  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9311  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
9312  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9313  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
9314  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9315  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
9316  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9317  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
9318  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9319  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
9320  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9321  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
9322  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9323  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
9324  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
9325  if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
9326  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
9327  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
9328  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9329  __pyx_t_1 = PyImport_ImportModule("proteus.cmeshTools"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
9330  __Pyx_GOTREF(__pyx_t_1);
9331  __pyx_ptype_7proteus_10cmeshTools_CMesh = __Pyx_ImportType(__pyx_t_1, "proteus.cmeshTools", "CMesh", sizeof(struct __pyx_obj_7proteus_10cmeshTools_CMesh), __Pyx_ImportType_CheckSize_Warn);
9332  if (!__pyx_ptype_7proteus_10cmeshTools_CMesh) __PYX_ERR(4, 5, __pyx_L1_error)
9333  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9334  __Pyx_RefNannyFinishContext();
9335  return 0;
9336  __pyx_L1_error:;
9337  __Pyx_XDECREF(__pyx_t_1);
9338  __Pyx_RefNannyFinishContext();
9339  return -1;
9340 }
9341 
9342 static int __Pyx_modinit_variable_import_code(void) {
9343  __Pyx_RefNannyDeclarations
9344  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
9345  /*--- Variable import code ---*/
9346  __Pyx_RefNannyFinishContext();
9347  return 0;
9348 }
9349 
9350 static int __Pyx_modinit_function_import_code(void) {
9351  __Pyx_RefNannyDeclarations
9352  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
9353  /*--- Function import code ---*/
9354  __Pyx_RefNannyFinishContext();
9355  return 0;
9356 }
9357 
9358 
9359 #ifndef CYTHON_NO_PYINIT_EXPORT
9360 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
9361 #elif PY_MAJOR_VERSION < 3
9362 #ifdef __cplusplus
9363 #define __Pyx_PyMODINIT_FUNC extern "C" void
9364 #else
9365 #define __Pyx_PyMODINIT_FUNC void
9366 #endif
9367 #else
9368 #ifdef __cplusplus
9369 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
9370 #else
9371 #define __Pyx_PyMODINIT_FUNC PyObject *
9372 #endif
9373 #endif
9374 
9375 
9376 #if PY_MAJOR_VERSION < 3
9377 __Pyx_PyMODINIT_FUNC initMeshAdapt(void) CYTHON_SMALL_CODE; /*proto*/
9378 __Pyx_PyMODINIT_FUNC initMeshAdapt(void)
9379 #else
9380 __Pyx_PyMODINIT_FUNC PyInit_MeshAdapt(void) CYTHON_SMALL_CODE; /*proto*/
9381 __Pyx_PyMODINIT_FUNC PyInit_MeshAdapt(void)
9382 #if CYTHON_PEP489_MULTI_PHASE_INIT
9383 {
9384  return PyModuleDef_Init(&__pyx_moduledef);
9385 }
9386 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
9387  #if PY_VERSION_HEX >= 0x030700A1
9388  static PY_INT64_T main_interpreter_id = -1;
9389  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
9390  if (main_interpreter_id == -1) {
9391  main_interpreter_id = current_id;
9392  return (unlikely(current_id == -1)) ? -1 : 0;
9393  } else if (unlikely(main_interpreter_id != current_id))
9394  #else
9395  static PyInterpreterState *main_interpreter = NULL;
9396  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
9397  if (!main_interpreter) {
9398  main_interpreter = current_interpreter;
9399  } else if (unlikely(main_interpreter != current_interpreter))
9400  #endif
9401  {
9402  PyErr_SetString(
9403  PyExc_ImportError,
9404  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
9405  return -1;
9406  }
9407  return 0;
9408 }
9409 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
9410  PyObject *value = PyObject_GetAttrString(spec, from_name);
9411  int result = 0;
9412  if (likely(value)) {
9413  if (allow_none || value != Py_None) {
9414  result = PyDict_SetItemString(moddict, to_name, value);
9415  }
9416  Py_DECREF(value);
9417  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
9418  PyErr_Clear();
9419  } else {
9420  result = -1;
9421  }
9422  return result;
9423 }
9424 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
9425  PyObject *module = NULL, *moddict, *modname;
9426  if (__Pyx_check_single_interpreter())
9427  return NULL;
9428  if (__pyx_m)
9429  return __Pyx_NewRef(__pyx_m);
9430  modname = PyObject_GetAttrString(spec, "name");
9431  if (unlikely(!modname)) goto bad;
9432  module = PyModule_NewObject(modname);
9433  Py_DECREF(modname);
9434  if (unlikely(!module)) goto bad;
9435  moddict = PyModule_GetDict(module);
9436  if (unlikely(!moddict)) goto bad;
9437  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
9438  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
9439  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
9440  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
9441  return module;
9442 bad:
9443  Py_XDECREF(module);
9444  return NULL;
9445 }
9446 
9447 
9448 static CYTHON_SMALL_CODE int __pyx_pymod_exec_MeshAdapt(PyObject *__pyx_pyinit_module)
9449 #endif
9450 #endif
9451 {
9452  PyObject *__pyx_t_1 = NULL;
9453  PyObject *__pyx_t_2 = NULL;
9454  PyObject *__pyx_t_3 = NULL;
9455  int __pyx_lineno = 0;
9456  const char *__pyx_filename = NULL;
9457  int __pyx_clineno = 0;
9458  __Pyx_RefNannyDeclarations
9459  #if CYTHON_PEP489_MULTI_PHASE_INIT
9460  if (__pyx_m) {
9461  if (__pyx_m == __pyx_pyinit_module) return 0;
9462  PyErr_SetString(PyExc_RuntimeError, "Module 'MeshAdapt' has already been imported. Re-initialisation is not supported.");
9463  return -1;
9464  }
9465  #elif PY_MAJOR_VERSION >= 3
9466  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
9467  #endif
9468  #if CYTHON_REFNANNY
9469 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
9470 if (!__Pyx_RefNanny) {
9471  PyErr_Clear();
9472  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
9473  if (!__Pyx_RefNanny)
9474  Py_FatalError("failed to import 'refnanny' module");
9475 }
9476 #endif
9477  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_MeshAdapt(void)", 0);
9478  if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9479  #ifdef __Pxy_PyFrame_Initialize_Offsets
9480  __Pxy_PyFrame_Initialize_Offsets();
9481  #endif
9482  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
9483  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
9484  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
9485  #ifdef __Pyx_CyFunction_USED
9486  if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9487  #endif
9488  #ifdef __Pyx_FusedFunction_USED
9489  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9490  #endif
9491  #ifdef __Pyx_Coroutine_USED
9492  if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9493  #endif
9494  #ifdef __Pyx_Generator_USED
9495  if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9496  #endif
9497  #ifdef __Pyx_AsyncGen_USED
9498  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9499  #endif
9500  #ifdef __Pyx_StopAsyncIteration_USED
9501  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9502  #endif
9503  /*--- Library function declarations ---*/
9504  /*--- Threads initialization code ---*/
9505  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
9506  PyEval_InitThreads();
9507  #endif
9508  /*--- Module creation code ---*/
9509  #if CYTHON_PEP489_MULTI_PHASE_INIT
9510  __pyx_m = __pyx_pyinit_module;
9511  Py_INCREF(__pyx_m);
9512  #else
9513  #if PY_MAJOR_VERSION < 3
9514  __pyx_m = Py_InitModule4("MeshAdapt", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
9515  #else
9516  __pyx_m = PyModule_Create(&__pyx_moduledef);
9517  #endif
9518  if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
9519  #endif
9520  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
9521  Py_INCREF(__pyx_d);
9522  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
9523  Py_INCREF(__pyx_b);
9524  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
9525  Py_INCREF(__pyx_cython_runtime);
9526  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
9527  /*--- Initialize various global constants etc. ---*/
9528  if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9529  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
9530  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9531  #endif
9532  if (__pyx_module_is_main_MeshAdaptPUMI__MeshAdapt) {
9533  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9534  }
9535  #if PY_MAJOR_VERSION >= 3
9536  {
9537  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
9538  if (!PyDict_GetItemString(modules, "MeshAdaptPUMI.MeshAdapt")) {
9539  if (unlikely(PyDict_SetItemString(modules, "MeshAdaptPUMI.MeshAdapt", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
9540  }
9541  }
9542  #endif
9543  /*--- Builtin init code ---*/
9544  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9545  /*--- Constants init code ---*/
9546  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9547  /*--- Global type/function init code ---*/
9548  (void)__Pyx_modinit_global_init_code();
9549  (void)__Pyx_modinit_variable_export_code();
9550  (void)__Pyx_modinit_function_export_code();
9551  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
9552  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
9553  (void)__Pyx_modinit_variable_import_code();
9554  (void)__Pyx_modinit_function_import_code();
9555  /*--- Execution code ---*/
9556  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
9557  if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9558  #endif
9559 
9560  /* "MeshAdaptPUMI/MeshAdapt.pyx":5
9561  * from cpython.ref cimport PyObject
9562  * cimport numpy as np
9563  * import numpy as np # <<<<<<<<<<<<<<
9564  * from ..Profiling import logEvent
9565  * from proteus cimport cmeshTools
9566  */
9567  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9568  __Pyx_GOTREF(__pyx_t_1);
9569  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 5, __pyx_L1_error)
9570  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9571 
9572  /* "MeshAdaptPUMI/MeshAdapt.pyx":6
9573  * cimport numpy as np
9574  * import numpy as np
9575  * from ..Profiling import logEvent # <<<<<<<<<<<<<<
9576  * from proteus cimport cmeshTools
9577  * from libcpp.string cimport string
9578  */
9579  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9580  __Pyx_GOTREF(__pyx_t_1);
9581  __Pyx_INCREF(__pyx_n_s_logEvent);
9582  __Pyx_GIVEREF(__pyx_n_s_logEvent);
9583  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_logEvent);
9584  __pyx_t_2 = __Pyx_Import(__pyx_n_s_Profiling, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
9585  __Pyx_GOTREF(__pyx_t_2);
9586  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9587  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9588  __Pyx_GOTREF(__pyx_t_1);
9589  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logEvent, __pyx_t_1) < 0) __PYX_ERR(1, 6, __pyx_L1_error)
9590  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9591  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9592 
9593  /* "MeshAdaptPUMI/MeshAdapt.pyx":192
9594  * return self.thisptr.cleanMesh()
9595  *
9596  * class AdaptManager(): # <<<<<<<<<<<<<<
9597  * def __init__(self,adapter=MeshAdapt()):
9598  * self.modelDict = {}
9599  */
9600  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_AdaptManager, __pyx_n_s_AdaptManager, (PyObject *) NULL, __pyx_n_s_MeshAdaptPUMI_MeshAdapt, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 192, __pyx_L1_error)
9601  __Pyx_GOTREF(__pyx_t_2);
9602 
9603  /* "MeshAdaptPUMI/MeshAdapt.pyx":193
9604  *
9605  * class AdaptManager():
9606  * def __init__(self,adapter=MeshAdapt()): # <<<<<<<<<<<<<<
9607  * self.modelDict = {}
9608  * self.sizeInputs = []
9609  */
9610  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_13MeshAdaptPUMI_9MeshAdapt_12AdaptManager_1__init__, 0, __pyx_n_s_AdaptManager___init, NULL, __pyx_n_s_MeshAdaptPUMI_MeshAdapt, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 193, __pyx_L1_error)
9611  __Pyx_GOTREF(__pyx_t_1);
9612  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults), 1)) __PYX_ERR(1, 193, __pyx_L1_error)
9613  __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
9614  __Pyx_GOTREF(__pyx_t_3);
9615  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_adapter = __pyx_t_3;
9616  __Pyx_GIVEREF(__pyx_t_3);
9617  __pyx_t_3 = 0;
9618  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_13MeshAdaptPUMI_9MeshAdapt___defaults__);
9619  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(1, 193, __pyx_L1_error)
9620  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9621 
9622  /* "MeshAdaptPUMI/MeshAdapt.pyx":192
9623  * return self.thisptr.cleanMesh()
9624  *
9625  * class AdaptManager(): # <<<<<<<<<<<<<<
9626  * def __init__(self,adapter=MeshAdapt()):
9627  * self.modelDict = {}
9628  */
9629  __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_AdaptManager, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 192, __pyx_L1_error)
9630  __Pyx_GOTREF(__pyx_t_1);
9631  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AdaptManager, __pyx_t_1) < 0) __PYX_ERR(1, 192, __pyx_L1_error)
9632  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9633  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9634 
9635  /* "MeshAdaptPUMI/MeshAdapt.pyx":1
9636  * # distutils: language = c++ # <<<<<<<<<<<<<<
9637  *
9638  * from cpython.ref cimport PyObject
9639  */
9640  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
9641  __Pyx_GOTREF(__pyx_t_2);
9642  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9643  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9644 
9645  /* "string.from_py":13
9646  *
9647  * @cname("__pyx_convert_string_from_py_std__in_string")
9648  * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
9649  * cdef Py_ssize_t length = 0
9650  * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
9651  */
9652 
9653  /*--- Wrapped vars code ---*/
9654 
9655  goto __pyx_L0;
9656  __pyx_L1_error:;
9657  __Pyx_XDECREF(__pyx_t_1);
9658  __Pyx_XDECREF(__pyx_t_2);
9659  __Pyx_XDECREF(__pyx_t_3);
9660  if (__pyx_m) {
9661  if (__pyx_d) {
9662  __Pyx_AddTraceback("init MeshAdaptPUMI.MeshAdapt", __pyx_clineno, __pyx_lineno, __pyx_filename);
9663  }
9664  Py_CLEAR(__pyx_m);
9665  } else if (!PyErr_Occurred()) {
9666  PyErr_SetString(PyExc_ImportError, "init MeshAdaptPUMI.MeshAdapt");
9667  }
9668  __pyx_L0:;
9669  __Pyx_RefNannyFinishContext();
9670  #if CYTHON_PEP489_MULTI_PHASE_INIT
9671  return (__pyx_m != NULL) ? 0 : -1;
9672  #elif PY_MAJOR_VERSION >= 3
9673  return __pyx_m;
9674  #else
9675  return;
9676  #endif
9677 }
9678 
9679 /* --- Runtime support code --- */
9680 /* Refnanny */
9681 #if CYTHON_REFNANNY
9682 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
9683  PyObject *m = NULL, *p = NULL;
9684  void *r = NULL;
9685  m = PyImport_ImportModule(modname);
9686  if (!m) goto end;
9687  p = PyObject_GetAttrString(m, "RefNannyAPI");
9688  if (!p) goto end;
9689  r = PyLong_AsVoidPtr(p);
9690 end:
9691  Py_XDECREF(p);
9692  Py_XDECREF(m);
9693  return (__Pyx_RefNannyAPIStruct *)r;
9694 }
9695 #endif
9696 
9697 /* PyObjectGetAttrStr */
9698 #if CYTHON_USE_TYPE_SLOTS
9699 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
9700  PyTypeObject* tp = Py_TYPE(obj);
9701  if (likely(tp->tp_getattro))
9702  return tp->tp_getattro(obj, attr_name);
9703 #if PY_MAJOR_VERSION < 3
9704  if (likely(tp->tp_getattr))
9705  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
9706 #endif
9707  return PyObject_GetAttr(obj, attr_name);
9708 }
9709 #endif
9710 
9711 /* GetBuiltinName */
9712 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
9713  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
9714  if (unlikely(!result)) {
9715  PyErr_Format(PyExc_NameError,
9716 #if PY_MAJOR_VERSION >= 3
9717  "name '%U' is not defined", name);
9718 #else
9719  "name '%.200s' is not defined", PyString_AS_STRING(name));
9720 #endif
9721  }
9722  return result;
9723 }
9724 
9725 /* RaiseArgTupleInvalid */
9726 static void __Pyx_RaiseArgtupleInvalid(
9727  const char* func_name,
9728  int exact,
9729  Py_ssize_t num_min,
9730  Py_ssize_t num_max,
9731  Py_ssize_t num_found)
9732 {
9733  Py_ssize_t num_expected;
9734  const char *more_or_less;
9735  if (num_found < num_min) {
9736  num_expected = num_min;
9737  more_or_less = "at least";
9738  } else {
9739  num_expected = num_max;
9740  more_or_less = "at most";
9741  }
9742  if (exact) {
9743  more_or_less = "exactly";
9744  }
9745  PyErr_Format(PyExc_TypeError,
9746  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
9747  func_name, more_or_less, num_expected,
9748  (num_expected == 1) ? "" : "s", num_found);
9749 }
9750 
9751 /* KeywordStringCheck */
9752 static int __Pyx_CheckKeywordStrings(
9753  PyObject *kwdict,
9754  const char* function_name,
9755  int kw_allowed)
9756 {
9757  PyObject* key = 0;
9758  Py_ssize_t pos = 0;
9759 #if CYTHON_COMPILING_IN_PYPY
9760  if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
9761  goto invalid_keyword;
9762  return 1;
9763 #else
9764  while (PyDict_Next(kwdict, &pos, &key, 0)) {
9765  #if PY_MAJOR_VERSION < 3
9766  if (unlikely(!PyString_Check(key)))
9767  #endif
9768  if (unlikely(!PyUnicode_Check(key)))
9769  goto invalid_keyword_type;
9770  }
9771  if ((!kw_allowed) && unlikely(key))
9772  goto invalid_keyword;
9773  return 1;
9774 invalid_keyword_type:
9775  PyErr_Format(PyExc_TypeError,
9776  "%.200s() keywords must be strings", function_name);
9777  return 0;
9778 #endif
9779 invalid_keyword:
9780  PyErr_Format(PyExc_TypeError,
9781  #if PY_MAJOR_VERSION < 3
9782  "%.200s() got an unexpected keyword argument '%.200s'",
9783  function_name, PyString_AsString(key));
9784  #else
9785  "%s() got an unexpected keyword argument '%U'",
9786  function_name, key);
9787  #endif
9788  return 0;
9789 }
9790 
9791 /* RaiseDoubleKeywords */
9792 static void __Pyx_RaiseDoubleKeywordsError(
9793  const char* func_name,
9794  PyObject* kw_name)
9795 {
9796  PyErr_Format(PyExc_TypeError,
9797  #if PY_MAJOR_VERSION >= 3
9798  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
9799  #else
9800  "%s() got multiple values for keyword argument '%s'", func_name,
9801  PyString_AsString(kw_name));
9802  #endif
9803 }
9804 
9805 /* ParseKeywords */
9806 static int __Pyx_ParseOptionalKeywords(
9807  PyObject *kwds,
9808  PyObject **argnames[],
9809  PyObject *kwds2,
9810  PyObject *values[],
9811  Py_ssize_t num_pos_args,
9812  const char* function_name)
9813 {
9814  PyObject *key = 0, *value = 0;
9815  Py_ssize_t pos = 0;
9816  PyObject*** name;
9817  PyObject*** first_kw_arg = argnames + num_pos_args;
9818  while (PyDict_Next(kwds, &pos, &key, &value)) {
9819  name = first_kw_arg;
9820  while (*name && (**name != key)) name++;
9821  if (*name) {
9822  values[name-argnames] = value;
9823  continue;
9824  }
9825  name = first_kw_arg;
9826  #if PY_MAJOR_VERSION < 3
9827  if (likely(PyString_Check(key))) {
9828  while (*name) {
9829  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
9830  && _PyString_Eq(**name, key)) {
9831  values[name-argnames] = value;
9832  break;
9833  }
9834  name++;
9835  }
9836  if (*name) continue;
9837  else {
9838  PyObject*** argname = argnames;
9839  while (argname != first_kw_arg) {
9840  if ((**argname == key) || (
9841  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
9842  && _PyString_Eq(**argname, key))) {
9843  goto arg_passed_twice;
9844  }
9845  argname++;
9846  }
9847  }
9848  } else
9849  #endif
9850  if (likely(PyUnicode_Check(key))) {
9851  while (*name) {
9852  int cmp = (**name == key) ? 0 :
9853  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
9854  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
9855  #endif
9856  PyUnicode_Compare(**name, key);
9857  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
9858  if (cmp == 0) {
9859  values[name-argnames] = value;
9860  break;
9861  }
9862  name++;
9863  }
9864  if (*name) continue;
9865  else {
9866  PyObject*** argname = argnames;
9867  while (argname != first_kw_arg) {
9868  int cmp = (**argname == key) ? 0 :
9869  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
9870  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
9871  #endif
9872  PyUnicode_Compare(**argname, key);
9873  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
9874  if (cmp == 0) goto arg_passed_twice;
9875  argname++;
9876  }
9877  }
9878  } else
9879  goto invalid_keyword_type;
9880  if (kwds2) {
9881  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
9882  } else {
9883  goto invalid_keyword;
9884  }
9885  }
9886  return 0;
9887 arg_passed_twice:
9888  __Pyx_RaiseDoubleKeywordsError(function_name, key);
9889  goto bad;
9890 invalid_keyword_type:
9891  PyErr_Format(PyExc_TypeError,
9892  "%.200s() keywords must be strings", function_name);
9893  goto bad;
9894 invalid_keyword:
9895  PyErr_Format(PyExc_TypeError,
9896  #if PY_MAJOR_VERSION < 3
9897  "%.200s() got an unexpected keyword argument '%.200s'",
9898  function_name, PyString_AsString(key));
9899  #else
9900  "%s() got an unexpected keyword argument '%U'",
9901  function_name, key);
9902  #endif
9903 bad:
9904  return -1;
9905 }
9906 
9907 /* ArgTypeTest */
9908 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
9909 {
9910  if (unlikely(!type)) {
9911  PyErr_SetString(PyExc_SystemError, "Missing type object");
9912  return 0;
9913  }
9914  else if (exact) {
9915  #if PY_MAJOR_VERSION == 2
9916  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
9917  #endif
9918  }
9919  else {
9920  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
9921  }
9922  PyErr_Format(PyExc_TypeError,
9923  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
9924  name, type->tp_name, Py_TYPE(obj)->tp_name);
9925  return 0;
9926 }
9927 
9928 /* IsLittleEndian */
9929 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
9930 {
9931  union {
9932  uint32_t u32;
9933  uint8_t u8[4];
9934  } S;
9935  S.u32 = 0x01020304;
9936  return S.u8[0] == 4;
9937 }
9938 
9939 /* BufferFormatCheck */
9940 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
9941  __Pyx_BufFmt_StackElem* stack,
9942  __Pyx_TypeInfo* type) {
9943  stack[0].field = &ctx->root;
9944  stack[0].parent_offset = 0;
9945  ctx->root.type = type;
9946  ctx->root.name = "buffer dtype";
9947  ctx->root.offset = 0;
9948  ctx->head = stack;
9949  ctx->head->field = &ctx->root;
9950  ctx->fmt_offset = 0;
9951  ctx->head->parent_offset = 0;
9952  ctx->new_packmode = '@';
9953  ctx->enc_packmode = '@';
9954  ctx->new_count = 1;
9955  ctx->enc_count = 0;
9956  ctx->enc_type = 0;
9957  ctx->is_complex = 0;
9958  ctx->is_valid_array = 0;
9959  ctx->struct_alignment = 0;
9960  while (type->typegroup == 'S') {
9961  ++ctx->head;
9962  ctx->head->field = type->fields;
9963  ctx->head->parent_offset = 0;
9964  type = type->fields->type;
9965  }
9966 }
9967 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
9968  int count;
9969  const char* t = *ts;
9970  if (*t < '0' || *t > '9') {
9971  return -1;
9972  } else {
9973  count = *t++ - '0';
9974  while (*t >= '0' && *t <= '9') {
9975  count *= 10;
9976  count += *t++ - '0';
9977  }
9978  }
9979  *ts = t;
9980  return count;
9981 }
9982 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
9983  int number = __Pyx_BufFmt_ParseNumber(ts);
9984  if (number == -1)
9985  PyErr_Format(PyExc_ValueError,\
9986  "Does not understand character buffer dtype format string ('%c')", **ts);
9987  return number;
9988 }
9989 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
9990  PyErr_Format(PyExc_ValueError,
9991  "Unexpected format string character: '%c'", ch);
9992 }
9993 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
9994  switch (ch) {
9995  case '?': return "'bool'";
9996  case 'c': return "'char'";
9997  case 'b': return "'signed char'";
9998  case 'B': return "'unsigned char'";
9999  case 'h': return "'short'";
10000  case 'H': return "'unsigned short'";
10001  case 'i': return "'int'";
10002  case 'I': return "'unsigned int'";
10003  case 'l': return "'long'";
10004  case 'L': return "'unsigned long'";
10005  case 'q': return "'long long'";
10006  case 'Q': return "'unsigned long long'";
10007  case 'f': return (is_complex ? "'complex float'" : "'float'");
10008  case 'd': return (is_complex ? "'complex double'" : "'double'");
10009  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
10010  case 'T': return "a struct";
10011  case 'O': return "Python object";
10012  case 'P': return "a pointer";
10013  case 's': case 'p': return "a string";
10014  case 0: return "end";
10015  default: return "unparseable format string";
10016  }
10017 }
10018 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
10019  switch (ch) {
10020  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
10021  case 'h': case 'H': return 2;
10022  case 'i': case 'I': case 'l': case 'L': return 4;
10023  case 'q': case 'Q': return 8;
10024  case 'f': return (is_complex ? 8 : 4);
10025  case 'd': return (is_complex ? 16 : 8);
10026  case 'g': {
10027  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
10028  return 0;
10029  }
10030  case 'O': case 'P': return sizeof(void*);
10031  default:
10032  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
10033  return 0;
10034  }
10035 }
10036 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
10037  switch (ch) {
10038  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
10039  case 'h': case 'H': return sizeof(short);
10040  case 'i': case 'I': return sizeof(int);
10041  case 'l': case 'L': return sizeof(long);
10042  #ifdef HAVE_LONG_LONG
10043  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
10044  #endif
10045  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
10046  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
10047  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
10048  case 'O': case 'P': return sizeof(void*);
10049  default: {
10050  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
10051  return 0;
10052  }
10053  }
10054 }
10055 typedef struct { char c; short x; } __Pyx_st_short;
10056 typedef struct { char c; int x; } __Pyx_st_int;
10057 typedef struct { char c; long x; } __Pyx_st_long;
10058 typedef struct { char c; float x; } __Pyx_st_float;
10059 typedef struct { char c; double x; } __Pyx_st_double;
10060 typedef struct { char c; long double x; } __Pyx_st_longdouble;
10061 typedef struct { char c; void *x; } __Pyx_st_void_p;
10062 #ifdef HAVE_LONG_LONG
10063 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
10064 #endif
10065 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
10066  switch (ch) {
10067  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
10068  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
10069  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
10070  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
10071 #ifdef HAVE_LONG_LONG
10072  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
10073 #endif
10074  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
10075  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
10076  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
10077  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
10078  default:
10079  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
10080  return 0;
10081  }
10082 }
10083 /* These are for computing the padding at the end of the struct to align
10084  on the first member of the struct. This will probably the same as above,
10085  but we don't have any guarantees.
10086  */
10087 typedef struct { short x; char c; } __Pyx_pad_short;
10088 typedef struct { int x; char c; } __Pyx_pad_int;
10089 typedef struct { long x; char c; } __Pyx_pad_long;
10090 typedef struct { float x; char c; } __Pyx_pad_float;
10091 typedef struct { double x; char c; } __Pyx_pad_double;
10092 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
10093 typedef struct { void *x; char c; } __Pyx_pad_void_p;
10094 #ifdef HAVE_LONG_LONG
10095 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
10096 #endif
10097 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
10098  switch (ch) {
10099  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
10100  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
10101  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
10102  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
10103 #ifdef HAVE_LONG_LONG
10104  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
10105 #endif
10106  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
10107  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
10108  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
10109  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
10110  default:
10111  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
10112  return 0;
10113  }
10114 }
10115 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
10116  switch (ch) {
10117  case 'c':
10118  return 'H';
10119  case 'b': case 'h': case 'i':
10120  case 'l': case 'q': case 's': case 'p':
10121  return 'I';
10122  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
10123  return 'U';
10124  case 'f': case 'd': case 'g':
10125  return (is_complex ? 'C' : 'R');
10126  case 'O':
10127  return 'O';
10128  case 'P':
10129  return 'P';
10130  default: {
10131  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
10132  return 0;
10133  }
10134  }
10135 }
10136 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
10137  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
10138  const char* expected;
10139  const char* quote;
10140  if (ctx->head == NULL) {
10141  expected = "end";
10142  quote = "";
10143  } else {
10144  expected = ctx->head->field->type->name;
10145  quote = "'";
10146  }
10147  PyErr_Format(PyExc_ValueError,
10148  "Buffer dtype mismatch, expected %s%s%s but got %s",
10149  quote, expected, quote,
10150  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
10151  } else {
10152  __Pyx_StructField* field = ctx->head->field;
10153  __Pyx_StructField* parent = (ctx->head - 1)->field;
10154  PyErr_Format(PyExc_ValueError,
10155  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
10156  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
10157  parent->type->name, field->name);
10158  }
10159 }
10160 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
10161  char group;
10162  size_t size, offset, arraysize = 1;
10163  if (ctx->enc_type == 0) return 0;
10164  if (ctx->head->field->type->arraysize[0]) {
10165  int i, ndim = 0;
10166  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
10167  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
10168  ndim = 1;
10169  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
10170  PyErr_Format(PyExc_ValueError,
10171  "Expected a dimension of size %zu, got %zu",
10172  ctx->head->field->type->arraysize[0], ctx->enc_count);
10173  return -1;
10174  }
10175  }
10176  if (!ctx->is_valid_array) {
10177  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
10178  ctx->head->field->type->ndim, ndim);
10179  return -1;
10180  }
10181  for (i = 0; i < ctx->head->field->type->ndim; i++) {
10182  arraysize *= ctx->head->field->type->arraysize[i];
10183  }
10184  ctx->is_valid_array = 0;
10185  ctx->enc_count = 1;
10186  }
10187  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
10188  do {
10189  __Pyx_StructField* field = ctx->head->field;
10190  __Pyx_TypeInfo* type = field->type;
10191  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
10192  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
10193  } else {
10194  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
10195  }
10196  if (ctx->enc_packmode == '@') {
10197  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
10198  size_t align_mod_offset;
10199  if (align_at == 0) return -1;
10200  align_mod_offset = ctx->fmt_offset % align_at;
10201  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
10202  if (ctx->struct_alignment == 0)
10203  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
10204  ctx->is_complex);
10205  }
10206  if (type->size != size || type->typegroup != group) {
10207  if (type->typegroup == 'C' && type->fields != NULL) {
10208  size_t parent_offset = ctx->head->parent_offset + field->offset;
10209  ++ctx->head;
10210  ctx->head->field = type->fields;
10211  ctx->head->parent_offset = parent_offset;
10212  continue;
10213  }
10214  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
10215  } else {
10216  __Pyx_BufFmt_RaiseExpected(ctx);
10217  return -1;
10218  }
10219  }
10220  offset = ctx->head->parent_offset + field->offset;
10221  if (ctx->fmt_offset != offset) {
10222  PyErr_Format(PyExc_ValueError,
10223  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
10224  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
10225  return -1;
10226  }
10227  ctx->fmt_offset += size;
10228  if (arraysize)
10229  ctx->fmt_offset += (arraysize - 1) * size;
10230  --ctx->enc_count;
10231  while (1) {
10232  if (field == &ctx->root) {
10233  ctx->head = NULL;
10234  if (ctx->enc_count != 0) {
10235  __Pyx_BufFmt_RaiseExpected(ctx);
10236  return -1;
10237  }
10238  break;
10239  }
10240  ctx->head->field = ++field;
10241  if (field->type == NULL) {
10242  --ctx->head;
10243  field = ctx->head->field;
10244  continue;
10245  } else if (field->type->typegroup == 'S') {
10246  size_t parent_offset = ctx->head->parent_offset + field->offset;
10247  if (field->type->fields->type == NULL) continue;
10248  field = field->type->fields;
10249  ++ctx->head;
10250  ctx->head->field = field;
10251  ctx->head->parent_offset = parent_offset;
10252  break;
10253  } else {
10254  break;
10255  }
10256  }
10257  } while (ctx->enc_count);
10258  ctx->enc_type = 0;
10259  ctx->is_complex = 0;
10260  return 0;
10261 }
10262 static PyObject *
10263 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
10264 {
10265  const char *ts = *tsp;
10266  int i = 0, number, ndim;
10267  ++ts;
10268  if (ctx->new_count != 1) {
10269  PyErr_SetString(PyExc_ValueError,
10270  "Cannot handle repeated arrays in format string");
10271  return NULL;
10272  }
10273  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
10274  ndim = ctx->head->field->type->ndim;
10275  while (*ts && *ts != ')') {
10276  switch (*ts) {
10277  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
10278  default: break;
10279  }
10280  number = __Pyx_BufFmt_ExpectNumber(&ts);
10281  if (number == -1) return NULL;
10282  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
10283  return PyErr_Format(PyExc_ValueError,
10284  "Expected a dimension of size %zu, got %d",
10285  ctx->head->field->type->arraysize[i], number);
10286  if (*ts != ',' && *ts != ')')
10287  return PyErr_Format(PyExc_ValueError,
10288  "Expected a comma in format string, got '%c'", *ts);
10289  if (*ts == ',') ts++;
10290  i++;
10291  }
10292  if (i != ndim)
10293  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
10294  ctx->head->field->type->ndim, i);
10295  if (!*ts) {
10296  PyErr_SetString(PyExc_ValueError,
10297  "Unexpected end of format string, expected ')'");
10298  return NULL;
10299  }
10300  ctx->is_valid_array = 1;
10301  ctx->new_count = 1;
10302  *tsp = ++ts;
10303  return Py_None;
10304 }
10305 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
10306  int got_Z = 0;
10307  while (1) {
10308  switch(*ts) {
10309  case 0:
10310  if (ctx->enc_type != 0 && ctx->head == NULL) {
10311  __Pyx_BufFmt_RaiseExpected(ctx);
10312  return NULL;
10313  }
10314  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
10315  if (ctx->head != NULL) {
10316  __Pyx_BufFmt_RaiseExpected(ctx);
10317  return NULL;
10318  }
10319  return ts;
10320  case ' ':
10321  case '\r':
10322  case '\n':
10323  ++ts;
10324  break;
10325  case '<':
10326  if (!__Pyx_Is_Little_Endian()) {
10327  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
10328  return NULL;
10329  }
10330  ctx->new_packmode = '=';
10331  ++ts;
10332  break;
10333  case '>':
10334  case '!':
10335  if (__Pyx_Is_Little_Endian()) {
10336  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
10337  return NULL;
10338  }
10339  ctx->new_packmode = '=';
10340  ++ts;
10341  break;
10342  case '=':
10343  case '@':
10344  case '^':
10345  ctx->new_packmode = *ts++;
10346  break;
10347  case 'T':
10348  {
10349  const char* ts_after_sub;
10350  size_t i, struct_count = ctx->new_count;
10351  size_t struct_alignment = ctx->struct_alignment;
10352  ctx->new_count = 1;
10353  ++ts;
10354  if (*ts != '{') {
10355  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
10356  return NULL;
10357  }
10358  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
10359  ctx->enc_type = 0;
10360  ctx->enc_count = 0;
10361  ctx->struct_alignment = 0;
10362  ++ts;
10363  ts_after_sub = ts;
10364  for (i = 0; i != struct_count; ++i) {
10365  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
10366  if (!ts_after_sub) return NULL;
10367  }
10368  ts = ts_after_sub;
10369  if (struct_alignment) ctx->struct_alignment = struct_alignment;
10370  }
10371  break;
10372  case '}':
10373  {
10374  size_t alignment = ctx->struct_alignment;
10375  ++ts;
10376  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
10377  ctx->enc_type = 0;
10378  if (alignment && ctx->fmt_offset % alignment) {
10379  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
10380  }
10381  }
10382  return ts;
10383  case 'x':
10384  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
10385  ctx->fmt_offset += ctx->new_count;
10386  ctx->new_count = 1;
10387  ctx->enc_count = 0;
10388  ctx->enc_type = 0;
10389  ctx->enc_packmode = ctx->new_packmode;
10390  ++ts;
10391  break;
10392  case 'Z':
10393  got_Z = 1;
10394  ++ts;
10395  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
10396  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
10397  return NULL;
10398  }
10399  CYTHON_FALLTHROUGH;
10400  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
10401  case 'l': case 'L': case 'q': case 'Q':
10402  case 'f': case 'd': case 'g':
10403  case 'O': case 'p':
10404  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
10405  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
10406  ctx->enc_count += ctx->new_count;
10407  ctx->new_count = 1;
10408  got_Z = 0;
10409  ++ts;
10410  break;
10411  }
10412  CYTHON_FALLTHROUGH;
10413  case 's':
10414  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
10415  ctx->enc_count = ctx->new_count;
10416  ctx->enc_packmode = ctx->new_packmode;
10417  ctx->enc_type = *ts;
10418  ctx->is_complex = got_Z;
10419  ++ts;
10420  ctx->new_count = 1;
10421  got_Z = 0;
10422  break;
10423  case ':':
10424  ++ts;
10425  while(*ts != ':') ++ts;
10426  ++ts;
10427  break;
10428  case '(':
10429  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
10430  break;
10431  default:
10432  {
10433  int number = __Pyx_BufFmt_ExpectNumber(&ts);
10434  if (number == -1) return NULL;
10435  ctx->new_count = (size_t)number;
10436  }
10437  }
10438  }
10439 }
10440 
10441 /* BufferGetAndValidate */
10442  static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
10443  if (unlikely(info->buf == NULL)) return;
10444  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
10445  __Pyx_ReleaseBuffer(info);
10446 }
10447 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
10448  buf->buf = NULL;
10449  buf->obj = NULL;
10450  buf->strides = __Pyx_zeros;
10451  buf->shape = __Pyx_zeros;
10452  buf->suboffsets = __Pyx_minusones;
10453 }
10454 static int __Pyx__GetBufferAndValidate(
10455  Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
10456  int nd, int cast, __Pyx_BufFmt_StackElem* stack)
10457 {
10458  buf->buf = NULL;
10459  if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
10460  __Pyx_ZeroBuffer(buf);
10461  return -1;
10462  }
10463  if (unlikely(buf->ndim != nd)) {
10464  PyErr_Format(PyExc_ValueError,
10465  "Buffer has wrong number of dimensions (expected %d, got %d)",
10466  nd, buf->ndim);
10467  goto fail;
10468  }
10469  if (!cast) {
10470  __Pyx_BufFmt_Context ctx;
10471  __Pyx_BufFmt_Init(&ctx, stack, dtype);
10472  if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
10473  }
10474  if (unlikely((size_t)buf->itemsize != dtype->size)) {
10475  PyErr_Format(PyExc_ValueError,
10476  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
10477  buf->itemsize, (buf->itemsize > 1) ? "s" : "",
10478  dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
10479  goto fail;
10480  }
10481  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
10482  return 0;
10483 fail:;
10484  __Pyx_SafeReleaseBuffer(buf);
10485  return -1;
10486 }
10487 
10488 /* PyDictVersioning */
10489  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
10490 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
10491  PyObject *dict = Py_TYPE(obj)->tp_dict;
10492  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
10493 }
10494 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
10495  PyObject **dictptr = NULL;
10496  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
10497  if (offset) {
10498 #if CYTHON_COMPILING_IN_CPYTHON
10499  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
10500 #else
10501  dictptr = _PyObject_GetDictPtr(obj);
10502 #endif
10503  }
10504  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
10505 }
10506 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
10507  PyObject *dict = Py_TYPE(obj)->tp_dict;
10508  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
10509  return 0;
10510  return obj_dict_version == __Pyx_get_object_dict_version(obj);
10511 }
10512 #endif
10513 
10514 /* GetModuleGlobalName */
10515  #if CYTHON_USE_DICT_VERSIONS
10516 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
10517 #else
10518 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
10519 #endif
10520 {
10521  PyObject *result;
10522 #if !CYTHON_AVOID_BORROWED_REFS
10523 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
10524  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
10525  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
10526  if (likely(result)) {
10527  return __Pyx_NewRef(result);
10528  } else if (unlikely(PyErr_Occurred())) {
10529  return NULL;
10530  }
10531 #else
10532  result = PyDict_GetItem(__pyx_d, name);
10533  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
10534  if (likely(result)) {
10535  return __Pyx_NewRef(result);
10536  }
10537 #endif
10538 #else
10539  result = PyObject_GetItem(__pyx_d, name);
10540  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
10541  if (likely(result)) {
10542  return __Pyx_NewRef(result);
10543  }
10544  PyErr_Clear();
10545 #endif
10546  return __Pyx_GetBuiltinName(name);
10547 }
10548 
10549 /* PyCFunctionFastCall */
10550  #if CYTHON_FAST_PYCCALL
10551 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
10552  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
10553  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
10554  PyObject *self = PyCFunction_GET_SELF(func);
10555  int flags = PyCFunction_GET_FLAGS(func);
10556  assert(PyCFunction_Check(func));
10557  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
10558  assert(nargs >= 0);
10559  assert(nargs == 0 || args != NULL);
10560  /* _PyCFunction_FastCallDict() must not be called with an exception set,
10561  because it may clear it (directly or indirectly) and so the
10562  caller loses its exception */
10563  assert(!PyErr_Occurred());
10564  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
10565  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
10566  } else {
10567  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
10568  }
10569 }
10570 #endif
10571 
10572 /* PyFunctionFastCall */
10573  #if CYTHON_FAST_PYCALL
10574 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
10575  PyObject *globals) {
10576  PyFrameObject *f;
10577  PyThreadState *tstate = __Pyx_PyThreadState_Current;
10578  PyObject **fastlocals;
10579  Py_ssize_t i;
10580  PyObject *result;
10581  assert(globals != NULL);
10582  /* XXX Perhaps we should create a specialized
10583  PyFrame_New() that doesn't take locals, but does
10584  take builtins without sanity checking them.
10585  */
10586  assert(tstate != NULL);
10587  f = PyFrame_New(tstate, co, globals, NULL);
10588  if (f == NULL) {
10589  return NULL;
10590  }
10591  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
10592  for (i = 0; i < na; i++) {
10593  Py_INCREF(*args);
10594  fastlocals[i] = *args++;
10595  }
10596  result = PyEval_EvalFrameEx(f,0);
10597  ++tstate->recursion_depth;
10598  Py_DECREF(f);
10599  --tstate->recursion_depth;
10600  return result;
10601 }
10602 #if 1 || PY_VERSION_HEX < 0x030600B1
10603 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
10604  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
10605  PyObject *globals = PyFunction_GET_GLOBALS(func);
10606  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
10607  PyObject *closure;
10608 #if PY_MAJOR_VERSION >= 3
10609  PyObject *kwdefs;
10610 #endif
10611  PyObject *kwtuple, **k;
10612  PyObject **d;
10613  Py_ssize_t nd;
10614  Py_ssize_t nk;
10615  PyObject *result;
10616  assert(kwargs == NULL || PyDict_Check(kwargs));
10617  nk = kwargs ? PyDict_Size(kwargs) : 0;
10618  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
10619  return NULL;
10620  }
10621  if (
10622 #if PY_MAJOR_VERSION >= 3
10623  co->co_kwonlyargcount == 0 &&
10624 #endif
10625  likely(kwargs == NULL || nk == 0) &&
10626  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
10627  if (argdefs == NULL && co->co_argcount == nargs) {
10628  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
10629  goto done;
10630  }
10631  else if (nargs == 0 && argdefs != NULL
10632  && co->co_argcount == Py_SIZE(argdefs)) {
10633  /* function called with no arguments, but all parameters have
10634  a default value: use default values as arguments .*/
10635  args = &PyTuple_GET_ITEM(argdefs, 0);
10636  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
10637  goto done;
10638  }
10639  }
10640  if (kwargs != NULL) {
10641  Py_ssize_t pos, i;
10642  kwtuple = PyTuple_New(2 * nk);
10643  if (kwtuple == NULL) {
10644  result = NULL;
10645  goto done;
10646  }
10647  k = &PyTuple_GET_ITEM(kwtuple, 0);
10648  pos = i = 0;
10649  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
10650  Py_INCREF(k[i]);
10651  Py_INCREF(k[i+1]);
10652  i += 2;
10653  }
10654  nk = i / 2;
10655  }
10656  else {
10657  kwtuple = NULL;
10658  k = NULL;
10659  }
10660  closure = PyFunction_GET_CLOSURE(func);
10661 #if PY_MAJOR_VERSION >= 3
10662  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
10663 #endif
10664  if (argdefs != NULL) {
10665  d = &PyTuple_GET_ITEM(argdefs, 0);
10666  nd = Py_SIZE(argdefs);
10667  }
10668  else {
10669  d = NULL;
10670  nd = 0;
10671  }
10672 #if PY_MAJOR_VERSION >= 3
10673  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
10674  args, (int)nargs,
10675  k, (int)nk,
10676  d, (int)nd, kwdefs, closure);
10677 #else
10678  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
10679  args, (int)nargs,
10680  k, (int)nk,
10681  d, (int)nd, closure);
10682 #endif
10683  Py_XDECREF(kwtuple);
10684 done:
10685  Py_LeaveRecursiveCall();
10686  return result;
10687 }
10688 #endif
10689 #endif
10690 
10691 /* PyObjectCall */
10692  #if CYTHON_COMPILING_IN_CPYTHON
10693 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
10694  PyObject *result;
10695  ternaryfunc call = Py_TYPE(func)->tp_call;
10696  if (unlikely(!call))
10697  return PyObject_Call(func, arg, kw);
10698  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
10699  return NULL;
10700  result = (*call)(func, arg, kw);
10701  Py_LeaveRecursiveCall();
10702  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
10703  PyErr_SetString(
10704  PyExc_SystemError,
10705  "NULL result without error in PyObject_Call");
10706  }
10707  return result;
10708 }
10709 #endif
10710 
10711 /* PyObjectCall2Args */
10712  static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
10713  PyObject *args, *result = NULL;
10714  #if CYTHON_FAST_PYCALL
10715  if (PyFunction_Check(function)) {
10716  PyObject *args[2] = {arg1, arg2};
10717  return __Pyx_PyFunction_FastCall(function, args, 2);
10718  }
10719  #endif
10720  #if CYTHON_FAST_PYCCALL
10721  if (__Pyx_PyFastCFunction_Check(function)) {
10722  PyObject *args[2] = {arg1, arg2};
10723  return __Pyx_PyCFunction_FastCall(function, args, 2);
10724  }
10725  #endif
10726  args = PyTuple_New(2);
10727  if (unlikely(!args)) goto done;
10728  Py_INCREF(arg1);
10729  PyTuple_SET_ITEM(args, 0, arg1);
10730  Py_INCREF(arg2);
10731  PyTuple_SET_ITEM(args, 1, arg2);
10732  Py_INCREF(function);
10733  result = __Pyx_PyObject_Call(function, args, NULL);
10734  Py_DECREF(args);
10735  Py_DECREF(function);
10736 done:
10737  return result;
10738 }
10739 
10740 /* PyObjectCallMethO */
10741  #if CYTHON_COMPILING_IN_CPYTHON
10742 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
10743  PyObject *self, *result;
10744  PyCFunction cfunc;
10745  cfunc = PyCFunction_GET_FUNCTION(func);
10746  self = PyCFunction_GET_SELF(func);
10747  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
10748  return NULL;
10749  result = cfunc(self, arg);
10750  Py_LeaveRecursiveCall();
10751  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
10752  PyErr_SetString(
10753  PyExc_SystemError,
10754  "NULL result without error in PyObject_Call");
10755  }
10756  return result;
10757 }
10758 #endif
10759 
10760 /* PyObjectCallOneArg */
10761  #if CYTHON_COMPILING_IN_CPYTHON
10762 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10763  PyObject *result;
10764  PyObject *args = PyTuple_New(1);
10765  if (unlikely(!args)) return NULL;
10766  Py_INCREF(arg);
10767  PyTuple_SET_ITEM(args, 0, arg);
10768  result = __Pyx_PyObject_Call(func, args, NULL);
10769  Py_DECREF(args);
10770  return result;
10771 }
10772 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10773 #if CYTHON_FAST_PYCALL
10774  if (PyFunction_Check(func)) {
10775  return __Pyx_PyFunction_FastCall(func, &arg, 1);
10776  }
10777 #endif
10778  if (likely(PyCFunction_Check(func))) {
10779  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
10780  return __Pyx_PyObject_CallMethO(func, arg);
10781 #if CYTHON_FAST_PYCCALL
10782  } else if (__Pyx_PyFastCFunction_Check(func)) {
10783  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
10784 #endif
10785  }
10786  }
10787  return __Pyx__PyObject_CallOneArg(func, arg);
10788 }
10789 #else
10790 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10791  PyObject *result;
10792  PyObject *args = PyTuple_Pack(1, arg);
10793  if (unlikely(!args)) return NULL;
10794  result = __Pyx_PyObject_Call(func, args, NULL);
10795  Py_DECREF(args);
10796  return result;
10797 }
10798 #endif
10799 
10800 /* ExtTypeTest */
10801  static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
10802  if (unlikely(!type)) {
10803  PyErr_SetString(PyExc_SystemError, "Missing type object");
10804  return 0;
10805  }
10806  if (likely(__Pyx_TypeCheck(obj, type)))
10807  return 1;
10808  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
10809  Py_TYPE(obj)->tp_name, type->tp_name);
10810  return 0;
10811 }
10812 
10813 /* BufferFallbackError */
10814  static void __Pyx_RaiseBufferFallbackError(void) {
10815  PyErr_SetString(PyExc_ValueError,
10816  "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
10817 }
10818 
10819 /* BufferIndexError */
10820  static void __Pyx_RaiseBufferIndexError(int axis) {
10821  PyErr_Format(PyExc_IndexError,
10822  "Out of bounds on buffer access (axis %d)", axis);
10823 }
10824 
10825 /* PyErrFetchRestore */
10826  #if CYTHON_FAST_THREAD_STATE
10827 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
10828  PyObject *tmp_type, *tmp_value, *tmp_tb;
10829  tmp_type = tstate->curexc_type;
10830  tmp_value = tstate->curexc_value;
10831  tmp_tb = tstate->curexc_traceback;
10832  tstate->curexc_type = type;
10833  tstate->curexc_value = value;
10834  tstate->curexc_traceback = tb;
10835  Py_XDECREF(tmp_type);
10836  Py_XDECREF(tmp_value);
10837  Py_XDECREF(tmp_tb);
10838 }
10839 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
10840  *type = tstate->curexc_type;
10841  *value = tstate->curexc_value;
10842  *tb = tstate->curexc_traceback;
10843  tstate->curexc_type = 0;
10844  tstate->curexc_value = 0;
10845  tstate->curexc_traceback = 0;
10846 }
10847 #endif
10848 
10849 /* RaiseException */
10850  #if PY_MAJOR_VERSION < 3
10851 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
10852  CYTHON_UNUSED PyObject *cause) {
10853  __Pyx_PyThreadState_declare
10854  Py_XINCREF(type);
10855  if (!value || value == Py_None)
10856  value = NULL;
10857  else
10858  Py_INCREF(value);
10859  if (!tb || tb == Py_None)
10860  tb = NULL;
10861  else {
10862  Py_INCREF(tb);
10863  if (!PyTraceBack_Check(tb)) {
10864  PyErr_SetString(PyExc_TypeError,
10865  "raise: arg 3 must be a traceback or None");
10866  goto raise_error;
10867  }
10868  }
10869  if (PyType_Check(type)) {
10870 #if CYTHON_COMPILING_IN_PYPY
10871  if (!value) {
10872  Py_INCREF(Py_None);
10873  value = Py_None;
10874  }
10875 #endif
10876  PyErr_NormalizeException(&type, &value, &tb);
10877  } else {
10878  if (value) {
10879  PyErr_SetString(PyExc_TypeError,
10880  "instance exception may not have a separate value");
10881  goto raise_error;
10882  }
10883  value = type;
10884  type = (PyObject*) Py_TYPE(type);
10885  Py_INCREF(type);
10886  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
10887  PyErr_SetString(PyExc_TypeError,
10888  "raise: exception class must be a subclass of BaseException");
10889  goto raise_error;
10890  }
10891  }
10892  __Pyx_PyThreadState_assign
10893  __Pyx_ErrRestore(type, value, tb);
10894  return;
10895 raise_error:
10896  Py_XDECREF(value);
10897  Py_XDECREF(type);
10898  Py_XDECREF(tb);
10899  return;
10900 }
10901 #else
10902 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
10903  PyObject* owned_instance = NULL;
10904  if (tb == Py_None) {
10905  tb = 0;
10906  } else if (tb && !PyTraceBack_Check(tb)) {
10907  PyErr_SetString(PyExc_TypeError,
10908  "raise: arg 3 must be a traceback or None");
10909  goto bad;
10910  }
10911  if (value == Py_None)
10912  value = 0;
10913  if (PyExceptionInstance_Check(type)) {
10914  if (value) {
10915  PyErr_SetString(PyExc_TypeError,
10916  "instance exception may not have a separate value");
10917  goto bad;
10918  }
10919  value = type;
10920  type = (PyObject*) Py_TYPE(value);
10921  } else if (PyExceptionClass_Check(type)) {
10922  PyObject *instance_class = NULL;
10923  if (value && PyExceptionInstance_Check(value)) {
10924  instance_class = (PyObject*) Py_TYPE(value);
10925  if (instance_class != type) {
10926  int is_subclass = PyObject_IsSubclass(instance_class, type);
10927  if (!is_subclass) {
10928  instance_class = NULL;
10929  } else if (unlikely(is_subclass == -1)) {
10930  goto bad;
10931  } else {
10932  type = instance_class;
10933  }
10934  }
10935  }
10936  if (!instance_class) {
10937  PyObject *args;
10938  if (!value)
10939  args = PyTuple_New(0);
10940  else if (PyTuple_Check(value)) {
10941  Py_INCREF(value);
10942  args = value;
10943  } else
10944  args = PyTuple_Pack(1, value);
10945  if (!args)
10946  goto bad;
10947  owned_instance = PyObject_Call(type, args, NULL);
10948  Py_DECREF(args);
10949  if (!owned_instance)
10950  goto bad;
10951  value = owned_instance;
10952  if (!PyExceptionInstance_Check(value)) {
10953  PyErr_Format(PyExc_TypeError,
10954  "calling %R should have returned an instance of "
10955  "BaseException, not %R",
10956  type, Py_TYPE(value));
10957  goto bad;
10958  }
10959  }
10960  } else {
10961  PyErr_SetString(PyExc_TypeError,
10962  "raise: exception class must be a subclass of BaseException");
10963  goto bad;
10964  }
10965  if (cause) {
10966  PyObject *fixed_cause;
10967  if (cause == Py_None) {
10968  fixed_cause = NULL;
10969  } else if (PyExceptionClass_Check(cause)) {
10970  fixed_cause = PyObject_CallObject(cause, NULL);
10971  if (fixed_cause == NULL)
10972  goto bad;
10973  } else if (PyExceptionInstance_Check(cause)) {
10974  fixed_cause = cause;
10975  Py_INCREF(fixed_cause);
10976  } else {
10977  PyErr_SetString(PyExc_TypeError,
10978  "exception causes must derive from "
10979  "BaseException");
10980  goto bad;
10981  }
10982  PyException_SetCause(value, fixed_cause);
10983  }
10984  PyErr_SetObject(type, value);
10985  if (tb) {
10986 #if CYTHON_COMPILING_IN_PYPY
10987  PyObject *tmp_type, *tmp_value, *tmp_tb;
10988  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
10989  Py_INCREF(tb);
10990  PyErr_Restore(tmp_type, tmp_value, tb);
10991  Py_XDECREF(tmp_tb);
10992 #else
10993  PyThreadState *tstate = __Pyx_PyThreadState_Current;
10994  PyObject* tmp_tb = tstate->curexc_traceback;
10995  if (tb != tmp_tb) {
10996  Py_INCREF(tb);
10997  tstate->curexc_traceback = tb;
10998  Py_XDECREF(tmp_tb);
10999  }
11000 #endif
11001  }
11002 bad:
11003  Py_XDECREF(owned_instance);
11004  return;
11005 }
11006 #endif
11007 
11008 /* PyObjectSetAttrStr */
11009  #if CYTHON_USE_TYPE_SLOTS
11010 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
11011  PyTypeObject* tp = Py_TYPE(obj);
11012  if (likely(tp->tp_setattro))
11013  return tp->tp_setattro(obj, attr_name, value);
11014 #if PY_MAJOR_VERSION < 3
11015  if (likely(tp->tp_setattr))
11016  return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
11017 #endif
11018  return PyObject_SetAttr(obj, attr_name, value);
11019 }
11020 #endif
11021 
11022 /* GetTopmostException */
11023  #if CYTHON_USE_EXC_INFO_STACK
11024 static _PyErr_StackItem *
11025 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
11026 {
11027  _PyErr_StackItem *exc_info = tstate->exc_info;
11028  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
11029  exc_info->previous_item != NULL)
11030  {
11031  exc_info = exc_info->previous_item;
11032  }
11033  return exc_info;
11034 }
11035 #endif
11036 
11037 /* SaveResetException */
11038  #if CYTHON_FAST_THREAD_STATE
11039 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
11040  #if CYTHON_USE_EXC_INFO_STACK
11041  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
11042  *type = exc_info->exc_type;
11043  *value = exc_info->exc_value;
11044  *tb = exc_info->exc_traceback;
11045  #else
11046  *type = tstate->exc_type;
11047  *value = tstate->exc_value;
11048  *tb = tstate->exc_traceback;
11049  #endif
11050  Py_XINCREF(*type);
11051  Py_XINCREF(*value);
11052  Py_XINCREF(*tb);
11053 }
11054 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
11055  PyObject *tmp_type, *tmp_value, *tmp_tb;
11056  #if CYTHON_USE_EXC_INFO_STACK
11057  _PyErr_StackItem *exc_info = tstate->exc_info;
11058  tmp_type = exc_info->exc_type;
11059  tmp_value = exc_info->exc_value;
11060  tmp_tb = exc_info->exc_traceback;
11061  exc_info->exc_type = type;
11062  exc_info->exc_value = value;
11063  exc_info->exc_traceback = tb;
11064  #else
11065  tmp_type = tstate->exc_type;
11066  tmp_value = tstate->exc_value;
11067  tmp_tb = tstate->exc_traceback;
11068  tstate->exc_type = type;
11069  tstate->exc_value = value;
11070  tstate->exc_traceback = tb;
11071  #endif
11072  Py_XDECREF(tmp_type);
11073  Py_XDECREF(tmp_value);
11074  Py_XDECREF(tmp_tb);
11075 }
11076 #endif
11077 
11078 /* PyErrExceptionMatches */
11079  #if CYTHON_FAST_THREAD_STATE
11080 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
11081  Py_ssize_t i, n;
11082  n = PyTuple_GET_SIZE(tuple);
11083 #if PY_MAJOR_VERSION >= 3
11084  for (i=0; i<n; i++) {
11085  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
11086  }
11087 #endif
11088  for (i=0; i<n; i++) {
11089  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
11090  }
11091  return 0;
11092 }
11093 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
11094  PyObject *exc_type = tstate->curexc_type;
11095  if (exc_type == err) return 1;
11096  if (unlikely(!exc_type)) return 0;
11097  if (unlikely(PyTuple_Check(err)))
11098  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
11099  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
11100 }
11101 #endif
11102 
11103 /* GetException */
11104  #if CYTHON_FAST_THREAD_STATE
11105 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
11106 #else
11107 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
11108 #endif
11109 {
11110  PyObject *local_type, *local_value, *local_tb;
11111 #if CYTHON_FAST_THREAD_STATE
11112  PyObject *tmp_type, *tmp_value, *tmp_tb;
11113  local_type = tstate->curexc_type;
11114  local_value = tstate->curexc_value;
11115  local_tb = tstate->curexc_traceback;
11116  tstate->curexc_type = 0;
11117  tstate->curexc_value = 0;
11118  tstate->curexc_traceback = 0;
11119 #else
11120  PyErr_Fetch(&local_type, &local_value, &local_tb);
11121 #endif
11122  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
11123 #if CYTHON_FAST_THREAD_STATE
11124  if (unlikely(tstate->curexc_type))
11125 #else
11126  if (unlikely(PyErr_Occurred()))
11127 #endif
11128  goto bad;
11129  #if PY_MAJOR_VERSION >= 3
11130  if (local_tb) {
11131  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
11132  goto bad;
11133  }
11134  #endif
11135  Py_XINCREF(local_tb);
11136  Py_XINCREF(local_type);
11137  Py_XINCREF(local_value);
11138  *type = local_type;
11139  *value = local_value;
11140  *tb = local_tb;
11141 #if CYTHON_FAST_THREAD_STATE
11142  #if CYTHON_USE_EXC_INFO_STACK
11143  {
11144  _PyErr_StackItem *exc_info = tstate->exc_info;
11145  tmp_type = exc_info->exc_type;
11146  tmp_value = exc_info->exc_value;
11147  tmp_tb = exc_info->exc_traceback;
11148  exc_info->exc_type = local_type;
11149  exc_info->exc_value = local_value;
11150  exc_info->exc_traceback = local_tb;
11151  }
11152  #else
11153  tmp_type = tstate->exc_type;
11154  tmp_value = tstate->exc_value;
11155  tmp_tb = tstate->exc_traceback;
11156  tstate->exc_type = local_type;
11157  tstate->exc_value = local_value;
11158  tstate->exc_traceback = local_tb;
11159  #endif
11160  Py_XDECREF(tmp_type);
11161  Py_XDECREF(tmp_value);
11162  Py_XDECREF(tmp_tb);
11163 #else
11164  PyErr_SetExcInfo(local_type, local_value, local_tb);
11165 #endif
11166  return 0;
11167 bad:
11168  *type = 0;
11169  *value = 0;
11170  *tb = 0;
11171  Py_XDECREF(local_type);
11172  Py_XDECREF(local_value);
11173  Py_XDECREF(local_tb);
11174  return -1;
11175 }
11176 
11177 /* PyObject_GenericGetAttrNoDict */
11178  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
11179 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
11180  PyErr_Format(PyExc_AttributeError,
11181 #if PY_MAJOR_VERSION >= 3
11182  "'%.50s' object has no attribute '%U'",
11183  tp->tp_name, attr_name);
11184 #else
11185  "'%.50s' object has no attribute '%.400s'",
11186  tp->tp_name, PyString_AS_STRING(attr_name));
11187 #endif
11188  return NULL;
11189 }
11190 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
11191  PyObject *descr;
11192  PyTypeObject *tp = Py_TYPE(obj);
11193  if (unlikely(!PyString_Check(attr_name))) {
11194  return PyObject_GenericGetAttr(obj, attr_name);
11195  }
11196  assert(!tp->tp_dictoffset);
11197  descr = _PyType_Lookup(tp, attr_name);
11198  if (unlikely(!descr)) {
11199  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
11200  }
11201  Py_INCREF(descr);
11202  #if PY_MAJOR_VERSION < 3
11203  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
11204  #endif
11205  {
11206  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
11207  if (unlikely(f)) {
11208  PyObject *res = f(descr, obj, (PyObject *)tp);
11209  Py_DECREF(descr);
11210  return res;
11211  }
11212  }
11213  return descr;
11214 }
11215 #endif
11216 
11217 /* PyObject_GenericGetAttr */
11218  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
11219 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
11220  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
11221  return PyObject_GenericGetAttr(obj, attr_name);
11222  }
11223  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
11224 }
11225 #endif
11226 
11227 /* PyObjectGetAttrStrNoError */
11228  static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
11229  __Pyx_PyThreadState_declare
11230  __Pyx_PyThreadState_assign
11231  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
11232  __Pyx_PyErr_Clear();
11233 }
11234 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
11235  PyObject *result;
11236 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
11237  PyTypeObject* tp = Py_TYPE(obj);
11238  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
11239  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
11240  }
11241 #endif
11242  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
11243  if (unlikely(!result)) {
11244  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
11245  }
11246  return result;
11247 }
11248 
11249 /* SetupReduce */
11250  static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
11251  int ret;
11252  PyObject *name_attr;
11253  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
11254  if (likely(name_attr)) {
11255  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
11256  } else {
11257  ret = -1;
11258  }
11259  if (unlikely(ret < 0)) {
11260  PyErr_Clear();
11261  ret = 0;
11262  }
11263  Py_XDECREF(name_attr);
11264  return ret;
11265 }
11266 static int __Pyx_setup_reduce(PyObject* type_obj) {
11267  int ret = 0;
11268  PyObject *object_reduce = NULL;
11269  PyObject *object_getstate = NULL;
11270  PyObject *object_reduce_ex = NULL;
11271  PyObject *reduce = NULL;
11272  PyObject *reduce_ex = NULL;
11273  PyObject *reduce_cython = NULL;
11274  PyObject *setstate = NULL;
11275  PyObject *setstate_cython = NULL;
11276  PyObject *getstate = NULL;
11277 #if CYTHON_USE_PYTYPE_LOOKUP
11278  getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
11279 #else
11280  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
11281  if (!getstate && PyErr_Occurred()) {
11282  goto __PYX_BAD;
11283  }
11284 #endif
11285  if (getstate) {
11286 #if CYTHON_USE_PYTYPE_LOOKUP
11287  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
11288 #else
11289  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
11290  if (!object_getstate && PyErr_Occurred()) {
11291  goto __PYX_BAD;
11292  }
11293 #endif
11294  if (object_getstate != getstate) {
11295  goto __PYX_GOOD;
11296  }
11297  }
11298 #if CYTHON_USE_PYTYPE_LOOKUP
11299  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
11300 #else
11301  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
11302 #endif
11303  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
11304  if (reduce_ex == object_reduce_ex) {
11305 #if CYTHON_USE_PYTYPE_LOOKUP
11306  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
11307 #else
11308  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
11309 #endif
11310  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
11311  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
11312  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
11313  if (likely(reduce_cython)) {
11314  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
11315  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
11316  } else if (reduce == object_reduce || PyErr_Occurred()) {
11317  goto __PYX_BAD;
11318  }
11319  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
11320  if (!setstate) PyErr_Clear();
11321  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
11322  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
11323  if (likely(setstate_cython)) {
11324  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
11325  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
11326  } else if (!setstate || PyErr_Occurred()) {
11327  goto __PYX_BAD;
11328  }
11329  }
11330  PyType_Modified((PyTypeObject*)type_obj);
11331  }
11332  }
11333  goto __PYX_GOOD;
11334 __PYX_BAD:
11335  if (!PyErr_Occurred())
11336  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
11337  ret = -1;
11338 __PYX_GOOD:
11339 #if !CYTHON_USE_PYTYPE_LOOKUP
11340  Py_XDECREF(object_reduce);
11341  Py_XDECREF(object_reduce_ex);
11342  Py_XDECREF(object_getstate);
11343  Py_XDECREF(getstate);
11344 #endif
11345  Py_XDECREF(reduce);
11346  Py_XDECREF(reduce_ex);
11347  Py_XDECREF(reduce_cython);
11348  Py_XDECREF(setstate);
11349  Py_XDECREF(setstate_cython);
11350  return ret;
11351 }
11352 
11353 /* TypeImport */
11354  #ifndef __PYX_HAVE_RT_ImportType
11355 #define __PYX_HAVE_RT_ImportType
11356 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
11357  size_t size, enum __Pyx_ImportType_CheckSize check_size)
11358 {
11359  PyObject *result = 0;
11360  char warning[200];
11361  Py_ssize_t basicsize;
11362 #ifdef Py_LIMITED_API
11363  PyObject *py_basicsize;
11364 #endif
11365  result = PyObject_GetAttrString(module, class_name);
11366  if (!result)
11367  goto bad;
11368  if (!PyType_Check(result)) {
11369  PyErr_Format(PyExc_TypeError,
11370  "%.200s.%.200s is not a type object",
11371  module_name, class_name);
11372  goto bad;
11373  }
11374 #ifndef Py_LIMITED_API
11375  basicsize = ((PyTypeObject *)result)->tp_basicsize;
11376 #else
11377  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
11378  if (!py_basicsize)
11379  goto bad;
11380  basicsize = PyLong_AsSsize_t(py_basicsize);
11381  Py_DECREF(py_basicsize);
11382  py_basicsize = 0;
11383  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
11384  goto bad;
11385 #endif
11386  if ((size_t)basicsize < size) {
11387  PyErr_Format(PyExc_ValueError,
11388  "%.200s.%.200s size changed, may indicate binary incompatibility. "
11389  "Expected %zd from C header, got %zd from PyObject",
11390  module_name, class_name, size, basicsize);
11391  goto bad;
11392  }
11393  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
11394  PyErr_Format(PyExc_ValueError,
11395  "%.200s.%.200s size changed, may indicate binary incompatibility. "
11396  "Expected %zd from C header, got %zd from PyObject",
11397  module_name, class_name, size, basicsize);
11398  goto bad;
11399  }
11400  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
11401  PyOS_snprintf(warning, sizeof(warning),
11402  "%s.%s size changed, may indicate binary incompatibility. "
11403  "Expected %zd from C header, got %zd from PyObject",
11404  module_name, class_name, size, basicsize);
11405  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
11406  }
11407  return (PyTypeObject *)result;
11408 bad:
11409  Py_XDECREF(result);
11410  return NULL;
11411 }
11412 #endif
11413 
11414 /* Import */
11415  static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
11416  PyObject *empty_list = 0;
11417  PyObject *module = 0;
11418  PyObject *global_dict = 0;
11419  PyObject *empty_dict = 0;
11420  PyObject *list;
11421  #if PY_MAJOR_VERSION < 3
11422  PyObject *py_import;
11423  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
11424  if (!py_import)
11425  goto bad;
11426  #endif
11427  if (from_list)
11428  list = from_list;
11429  else {
11430  empty_list = PyList_New(0);
11431  if (!empty_list)
11432  goto bad;
11433  list = empty_list;
11434  }
11435  global_dict = PyModule_GetDict(__pyx_m);
11436  if (!global_dict)
11437  goto bad;
11438  empty_dict = PyDict_New();
11439  if (!empty_dict)
11440  goto bad;
11441  {
11442  #if PY_MAJOR_VERSION >= 3
11443  if (level == -1) {
11444  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
11445  module = PyImport_ImportModuleLevelObject(
11446  name, global_dict, empty_dict, list, 1);
11447  if (!module) {
11448  if (!PyErr_ExceptionMatches(PyExc_ImportError))
11449  goto bad;
11450  PyErr_Clear();
11451  }
11452  }
11453  level = 0;
11454  }
11455  #endif
11456  if (!module) {
11457  #if PY_MAJOR_VERSION < 3
11458  PyObject *py_level = PyInt_FromLong(level);
11459  if (!py_level)
11460  goto bad;
11461  module = PyObject_CallFunctionObjArgs(py_import,
11462  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
11463  Py_DECREF(py_level);
11464  #else
11465  module = PyImport_ImportModuleLevelObject(
11466  name, global_dict, empty_dict, list, level);
11467  #endif
11468  }
11469  }
11470 bad:
11471  #if PY_MAJOR_VERSION < 3
11472  Py_XDECREF(py_import);
11473  #endif
11474  Py_XDECREF(empty_list);
11475  Py_XDECREF(empty_dict);
11476  return module;
11477 }
11478 
11479 /* ImportFrom */
11480  static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
11481  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
11482  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
11483  PyErr_Format(PyExc_ImportError,
11484  #if PY_MAJOR_VERSION < 3
11485  "cannot import name %.230s", PyString_AS_STRING(name));
11486  #else
11487  "cannot import name %S", name);
11488  #endif
11489  }
11490  return value;
11491 }
11492 
11493 /* FetchCommonType */
11494  static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
11495  PyObject* fake_module;
11496  PyTypeObject* cached_type = NULL;
11497  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
11498  if (!fake_module) return NULL;
11499  Py_INCREF(fake_module);
11500  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
11501  if (cached_type) {
11502  if (!PyType_Check((PyObject*)cached_type)) {
11503  PyErr_Format(PyExc_TypeError,
11504  "Shared Cython type %.200s is not a type object",
11505  type->tp_name);
11506  goto bad;
11507  }
11508  if (cached_type->tp_basicsize != type->tp_basicsize) {
11509  PyErr_Format(PyExc_TypeError,
11510  "Shared Cython type %.200s has the wrong size, try recompiling",
11511  type->tp_name);
11512  goto bad;
11513  }
11514  } else {
11515  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
11516  PyErr_Clear();
11517  if (PyType_Ready(type) < 0) goto bad;
11518  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
11519  goto bad;
11520  Py_INCREF(type);
11521  cached_type = type;
11522  }
11523 done:
11524  Py_DECREF(fake_module);
11525  return cached_type;
11526 bad:
11527  Py_XDECREF(cached_type);
11528  cached_type = NULL;
11529  goto done;
11530 }
11531 
11532 /* CythonFunctionShared */
11533  #include <structmember.h>
11534 static PyObject *
11535 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
11536 {
11537  if (unlikely(op->func_doc == NULL)) {
11538  if (op->func.m_ml->ml_doc) {
11539 #if PY_MAJOR_VERSION >= 3
11540  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
11541 #else
11542  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
11543 #endif
11544  if (unlikely(op->func_doc == NULL))
11545  return NULL;
11546  } else {
11547  Py_INCREF(Py_None);
11548  return Py_None;
11549  }
11550  }
11551  Py_INCREF(op->func_doc);
11552  return op->func_doc;
11553 }
11554 static int
11555 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
11556 {
11557  PyObject *tmp = op->func_doc;
11558  if (value == NULL) {
11559  value = Py_None;
11560  }
11561  Py_INCREF(value);
11562  op->func_doc = value;
11563  Py_XDECREF(tmp);
11564  return 0;
11565 }
11566 static PyObject *
11567 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
11568 {
11569  if (unlikely(op->func_name == NULL)) {
11570 #if PY_MAJOR_VERSION >= 3
11571  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
11572 #else
11573  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
11574 #endif
11575  if (unlikely(op->func_name == NULL))
11576  return NULL;
11577  }
11578  Py_INCREF(op->func_name);
11579  return op->func_name;
11580 }
11581 static int
11582 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
11583 {
11584  PyObject *tmp;
11585 #if PY_MAJOR_VERSION >= 3
11586  if (unlikely(value == NULL || !PyUnicode_Check(value)))
11587 #else
11588  if (unlikely(value == NULL || !PyString_Check(value)))
11589 #endif
11590  {
11591  PyErr_SetString(PyExc_TypeError,
11592  "__name__ must be set to a string object");
11593  return -1;
11594  }
11595  tmp = op->func_name;
11596  Py_INCREF(value);
11597  op->func_name = value;
11598  Py_XDECREF(tmp);
11599  return 0;
11600 }
11601 static PyObject *
11602 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
11603 {
11604  Py_INCREF(op->func_qualname);
11605  return op->func_qualname;
11606 }
11607 static int
11608 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
11609 {
11610  PyObject *tmp;
11611 #if PY_MAJOR_VERSION >= 3
11612  if (unlikely(value == NULL || !PyUnicode_Check(value)))
11613 #else
11614  if (unlikely(value == NULL || !PyString_Check(value)))
11615 #endif
11616  {
11617  PyErr_SetString(PyExc_TypeError,
11618  "__qualname__ must be set to a string object");
11619  return -1;
11620  }
11621  tmp = op->func_qualname;
11622  Py_INCREF(value);
11623  op->func_qualname = value;
11624  Py_XDECREF(tmp);
11625  return 0;
11626 }
11627 static PyObject *
11628 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
11629 {
11630  PyObject *self;
11631  self = m->func_closure;
11632  if (self == NULL)
11633  self = Py_None;
11634  Py_INCREF(self);
11635  return self;
11636 }
11637 static PyObject *
11638 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
11639 {
11640  if (unlikely(op->func_dict == NULL)) {
11641  op->func_dict = PyDict_New();
11642  if (unlikely(op->func_dict == NULL))
11643  return NULL;
11644  }
11645  Py_INCREF(op->func_dict);
11646  return op->func_dict;
11647 }
11648 static int
11649 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
11650 {
11651  PyObject *tmp;
11652  if (unlikely(value == NULL)) {
11653  PyErr_SetString(PyExc_TypeError,
11654  "function's dictionary may not be deleted");
11655  return -1;
11656  }
11657  if (unlikely(!PyDict_Check(value))) {
11658  PyErr_SetString(PyExc_TypeError,
11659  "setting function's dictionary to a non-dict");
11660  return -1;
11661  }
11662  tmp = op->func_dict;
11663  Py_INCREF(value);
11664  op->func_dict = value;
11665  Py_XDECREF(tmp);
11666  return 0;
11667 }
11668 static PyObject *
11669 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
11670 {
11671  Py_INCREF(op->func_globals);
11672  return op->func_globals;
11673 }
11674 static PyObject *
11675 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
11676 {
11677  Py_INCREF(Py_None);
11678  return Py_None;
11679 }
11680 static PyObject *
11681 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
11682 {
11683  PyObject* result = (op->func_code) ? op->func_code : Py_None;
11684  Py_INCREF(result);
11685  return result;
11686 }
11687 static int
11688 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
11689  int result = 0;
11690  PyObject *res = op->defaults_getter((PyObject *) op);
11691  if (unlikely(!res))
11692  return -1;
11693  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11694  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
11695  Py_INCREF(op->defaults_tuple);
11696  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
11697  Py_INCREF(op->defaults_kwdict);
11698  #else
11699  op->defaults_tuple = PySequence_ITEM(res, 0);
11700  if (unlikely(!op->defaults_tuple)) result = -1;
11701  else {
11702  op->defaults_kwdict = PySequence_ITEM(res, 1);
11703  if (unlikely(!op->defaults_kwdict)) result = -1;
11704  }
11705  #endif
11706  Py_DECREF(res);
11707  return result;
11708 }
11709 static int
11710 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
11711  PyObject* tmp;
11712  if (!value) {
11713  value = Py_None;
11714  } else if (value != Py_None && !PyTuple_Check(value)) {
11715  PyErr_SetString(PyExc_TypeError,
11716  "__defaults__ must be set to a tuple object");
11717  return -1;
11718  }
11719  Py_INCREF(value);
11720  tmp = op->defaults_tuple;
11721  op->defaults_tuple = value;
11722  Py_XDECREF(tmp);
11723  return 0;
11724 }
11725 static PyObject *
11726 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
11727  PyObject* result = op->defaults_tuple;
11728  if (unlikely(!result)) {
11729  if (op->defaults_getter) {
11730  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
11731  result = op->defaults_tuple;
11732  } else {
11733  result = Py_None;
11734  }
11735  }
11736  Py_INCREF(result);
11737  return result;
11738 }
11739 static int
11740 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
11741  PyObject* tmp;
11742  if (!value) {
11743  value = Py_None;
11744  } else if (value != Py_None && !PyDict_Check(value)) {
11745  PyErr_SetString(PyExc_TypeError,
11746  "__kwdefaults__ must be set to a dict object");
11747  return -1;
11748  }
11749  Py_INCREF(value);
11750  tmp = op->defaults_kwdict;
11751  op->defaults_kwdict = value;
11752  Py_XDECREF(tmp);
11753  return 0;
11754 }
11755 static PyObject *
11756 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
11757  PyObject* result = op->defaults_kwdict;
11758  if (unlikely(!result)) {
11759  if (op->defaults_getter) {
11760  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
11761  result = op->defaults_kwdict;
11762  } else {
11763  result = Py_None;
11764  }
11765  }
11766  Py_INCREF(result);
11767  return result;
11768 }
11769 static int
11770 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
11771  PyObject* tmp;
11772  if (!value || value == Py_None) {
11773  value = NULL;
11774  } else if (!PyDict_Check(value)) {
11775  PyErr_SetString(PyExc_TypeError,
11776  "__annotations__ must be set to a dict object");
11777  return -1;
11778  }
11779  Py_XINCREF(value);
11780  tmp = op->func_annotations;
11781  op->func_annotations = value;
11782  Py_XDECREF(tmp);
11783  return 0;
11784 }
11785 static PyObject *
11786 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
11787  PyObject* result = op->func_annotations;
11788  if (unlikely(!result)) {
11789  result = PyDict_New();
11790  if (unlikely(!result)) return NULL;
11791  op->func_annotations = result;
11792  }
11793  Py_INCREF(result);
11794  return result;
11795 }
11796 static PyGetSetDef __pyx_CyFunction_getsets[] = {
11797  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
11798  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
11799  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
11800  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
11801  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
11802  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
11803  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
11804  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
11805  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
11806  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
11807  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
11808  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
11809  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
11810  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
11811  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
11812  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
11813  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
11814  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
11815  {0, 0, 0, 0, 0}
11816 };
11817 static PyMemberDef __pyx_CyFunction_members[] = {
11818  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
11819  {0, 0, 0, 0, 0}
11820 };
11821 static PyObject *
11822 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
11823 {
11824 #if PY_MAJOR_VERSION >= 3
11825  Py_INCREF(m->func_qualname);
11826  return m->func_qualname;
11827 #else
11828  return PyString_FromString(m->func.m_ml->ml_name);
11829 #endif
11830 }
11831 static PyMethodDef __pyx_CyFunction_methods[] = {
11832  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
11833  {0, 0, 0, 0}
11834 };
11835 #if PY_VERSION_HEX < 0x030500A0
11836 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
11837 #else
11838 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
11839 #endif
11840 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
11841  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
11842  if (unlikely(op == NULL))
11843  return NULL;
11844  op->flags = flags;
11845  __Pyx_CyFunction_weakreflist(op) = NULL;
11846  op->func.m_ml = ml;
11847  op->func.m_self = (PyObject *) op;
11848  Py_XINCREF(closure);
11849  op->func_closure = closure;
11850  Py_XINCREF(module);
11851  op->func.m_module = module;
11852  op->func_dict = NULL;
11853  op->func_name = NULL;
11854  Py_INCREF(qualname);
11855  op->func_qualname = qualname;
11856  op->func_doc = NULL;
11857  op->func_classobj = NULL;
11858  op->func_globals = globals;
11859  Py_INCREF(op->func_globals);
11860  Py_XINCREF(code);
11861  op->func_code = code;
11862  op->defaults_pyobjects = 0;
11863  op->defaults_size = 0;
11864  op->defaults = NULL;
11865  op->defaults_tuple = NULL;
11866  op->defaults_kwdict = NULL;
11867  op->defaults_getter = NULL;
11868  op->func_annotations = NULL;
11869  return (PyObject *) op;
11870 }
11871 static int
11872 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
11873 {
11874  Py_CLEAR(m->func_closure);
11875  Py_CLEAR(m->func.m_module);
11876  Py_CLEAR(m->func_dict);
11877  Py_CLEAR(m->func_name);
11878  Py_CLEAR(m->func_qualname);
11879  Py_CLEAR(m->func_doc);
11880  Py_CLEAR(m->func_globals);
11881  Py_CLEAR(m->func_code);
11882  Py_CLEAR(m->func_classobj);
11883  Py_CLEAR(m->defaults_tuple);
11884  Py_CLEAR(m->defaults_kwdict);
11885  Py_CLEAR(m->func_annotations);
11886  if (m->defaults) {
11887  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
11888  int i;
11889  for (i = 0; i < m->defaults_pyobjects; i++)
11890  Py_XDECREF(pydefaults[i]);
11891  PyObject_Free(m->defaults);
11892  m->defaults = NULL;
11893  }
11894  return 0;
11895 }
11896 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
11897 {
11898  if (__Pyx_CyFunction_weakreflist(m) != NULL)
11899  PyObject_ClearWeakRefs((PyObject *) m);
11900  __Pyx_CyFunction_clear(m);
11901  PyObject_GC_Del(m);
11902 }
11903 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
11904 {
11905  PyObject_GC_UnTrack(m);
11906  __Pyx__CyFunction_dealloc(m);
11907 }
11908 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
11909 {
11910  Py_VISIT(m->func_closure);
11911  Py_VISIT(m->func.m_module);
11912  Py_VISIT(m->func_dict);
11913  Py_VISIT(m->func_name);
11914  Py_VISIT(m->func_qualname);
11915  Py_VISIT(m->func_doc);
11916  Py_VISIT(m->func_globals);
11917  Py_VISIT(m->func_code);
11918  Py_VISIT(m->func_classobj);
11919  Py_VISIT(m->defaults_tuple);
11920  Py_VISIT(m->defaults_kwdict);
11921  if (m->defaults) {
11922  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
11923  int i;
11924  for (i = 0; i < m->defaults_pyobjects; i++)
11925  Py_VISIT(pydefaults[i]);
11926  }
11927  return 0;
11928 }
11929 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
11930 {
11931 #if PY_MAJOR_VERSION < 3
11932  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
11933  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
11934  Py_INCREF(func);
11935  return func;
11936  }
11937  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
11938  if (type == NULL)
11939  type = (PyObject *)(Py_TYPE(obj));
11940  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
11941  }
11942  if (obj == Py_None)
11943  obj = NULL;
11944 #endif
11945  return __Pyx_PyMethod_New(func, obj, type);
11946 }
11947 static PyObject*
11948 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
11949 {
11950 #if PY_MAJOR_VERSION >= 3
11951  return PyUnicode_FromFormat("<cyfunction %U at %p>",
11952  op->func_qualname, (void *)op);
11953 #else
11954  return PyString_FromFormat("<cyfunction %s at %p>",
11955  PyString_AsString(op->func_qualname), (void *)op);
11956 #endif
11957 }
11958 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
11959  PyCFunctionObject* f = (PyCFunctionObject*)func;
11960  PyCFunction meth = f->m_ml->ml_meth;
11961  Py_ssize_t size;
11962  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
11963  case METH_VARARGS:
11964  if (likely(kw == NULL || PyDict_Size(kw) == 0))
11965  return (*meth)(self, arg);
11966  break;
11967  case METH_VARARGS | METH_KEYWORDS:
11968  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
11969  case METH_NOARGS:
11970  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
11971  size = PyTuple_GET_SIZE(arg);
11972  if (likely(size == 0))
11973  return (*meth)(self, NULL);
11974  PyErr_Format(PyExc_TypeError,
11975  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
11976  f->m_ml->ml_name, size);
11977  return NULL;
11978  }
11979  break;
11980  case METH_O:
11981  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
11982  size = PyTuple_GET_SIZE(arg);
11983  if (likely(size == 1)) {
11984  PyObject *result, *arg0;
11985  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11986  arg0 = PyTuple_GET_ITEM(arg, 0);
11987  #else
11988  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
11989  #endif
11990  result = (*meth)(self, arg0);
11991  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
11992  Py_DECREF(arg0);
11993  #endif
11994  return result;
11995  }
11996  PyErr_Format(PyExc_TypeError,
11997  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
11998  f->m_ml->ml_name, size);
11999  return NULL;
12000  }
12001  break;
12002  default:
12003  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
12004  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
12005  "longer supported!");
12006  return NULL;
12007  }
12008  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
12009  f->m_ml->ml_name);
12010  return NULL;
12011 }
12012 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
12013  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
12014 }
12015 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
12016  PyObject *result;
12017  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
12018  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
12019  Py_ssize_t argc;
12020  PyObject *new_args;
12021  PyObject *self;
12022  argc = PyTuple_GET_SIZE(args);
12023  new_args = PyTuple_GetSlice(args, 1, argc);
12024  if (unlikely(!new_args))
12025  return NULL;
12026  self = PyTuple_GetItem(args, 0);
12027  if (unlikely(!self)) {
12028  Py_DECREF(new_args);
12029  PyErr_Format(PyExc_TypeError,
12030  "unbound method %.200S() needs an argument",
12031  cyfunc->func_qualname);
12032  return NULL;
12033  }
12034  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
12035  Py_DECREF(new_args);
12036  } else {
12037  result = __Pyx_CyFunction_Call(func, args, kw);
12038  }
12039  return result;
12040 }
12041 static PyTypeObject __pyx_CyFunctionType_type = {
12042  PyVarObject_HEAD_INIT(0, 0)
12043  "cython_function_or_method",
12044  sizeof(__pyx_CyFunctionObject),
12045  0,
12046  (destructor) __Pyx_CyFunction_dealloc,
12047  0,
12048  0,
12049  0,
12050 #if PY_MAJOR_VERSION < 3
12051  0,
12052 #else
12053  0,
12054 #endif
12055  (reprfunc) __Pyx_CyFunction_repr,
12056  0,
12057  0,
12058  0,
12059  0,
12060  __Pyx_CyFunction_CallAsMethod,
12061  0,
12062  0,
12063  0,
12064  0,
12065  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
12066  0,
12067  (traverseproc) __Pyx_CyFunction_traverse,
12068  (inquiry) __Pyx_CyFunction_clear,
12069  0,
12070 #if PY_VERSION_HEX < 0x030500A0
12071  offsetof(__pyx_CyFunctionObject, func_weakreflist),
12072 #else
12073  offsetof(PyCFunctionObject, m_weakreflist),
12074 #endif
12075  0,
12076  0,
12077  __pyx_CyFunction_methods,
12078  __pyx_CyFunction_members,
12079  __pyx_CyFunction_getsets,
12080  0,
12081  0,
12082  __Pyx_CyFunction_descr_get,
12083  0,
12084  offsetof(__pyx_CyFunctionObject, func_dict),
12085  0,
12086  0,
12087  0,
12088  0,
12089  0,
12090  0,
12091  0,
12092  0,
12093  0,
12094  0,
12095  0,
12096  0,
12097 #if PY_VERSION_HEX >= 0x030400a1
12098  0,
12099 #endif
12100 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
12101  0,
12102 #endif
12103 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
12104  0,
12105 #endif
12106 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
12107  0,
12108 #endif
12109 };
12110 static int __pyx_CyFunction_init(void) {
12111  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
12112  if (unlikely(__pyx_CyFunctionType == NULL)) {
12113  return -1;
12114  }
12115  return 0;
12116 }
12117 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
12118  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12119  m->defaults = PyObject_Malloc(size);
12120  if (unlikely(!m->defaults))
12121  return PyErr_NoMemory();
12122  memset(m->defaults, 0, size);
12123  m->defaults_pyobjects = pyobjects;
12124  m->defaults_size = size;
12125  return m->defaults;
12126 }
12127 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
12128  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12129  m->defaults_tuple = tuple;
12130  Py_INCREF(tuple);
12131 }
12132 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
12133  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12134  m->defaults_kwdict = dict;
12135  Py_INCREF(dict);
12136 }
12137 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
12138  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12139  m->func_annotations = dict;
12140  Py_INCREF(dict);
12141 }
12142 
12143 /* CythonFunction */
12144  static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
12145  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
12146  PyObject *op = __Pyx_CyFunction_Init(
12147  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
12148  ml, flags, qualname, closure, module, globals, code
12149  );
12150  if (likely(op)) {
12151  PyObject_GC_Track(op);
12152  }
12153  return op;
12154 }
12155 
12156 /* PyObjectCallNoArg */
12157  #if CYTHON_COMPILING_IN_CPYTHON
12158 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
12159 #if CYTHON_FAST_PYCALL
12160  if (PyFunction_Check(func)) {
12161  return __Pyx_PyFunction_FastCall(func, NULL, 0);
12162  }
12163 #endif
12164 #ifdef __Pyx_CyFunction_USED
12165  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
12166 #else
12167  if (likely(PyCFunction_Check(func)))
12168 #endif
12169  {
12170  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
12171  return __Pyx_PyObject_CallMethO(func, NULL);
12172  }
12173  }
12174  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
12175 }
12176 #endif
12177 
12178 /* CalculateMetaclass */
12179  static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
12180  Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
12181  for (i=0; i < nbases; i++) {
12182  PyTypeObject *tmptype;
12183  PyObject *tmp = PyTuple_GET_ITEM(bases, i);
12184  tmptype = Py_TYPE(tmp);
12185 #if PY_MAJOR_VERSION < 3
12186  if (tmptype == &PyClass_Type)
12187  continue;
12188 #endif
12189  if (!metaclass) {
12190  metaclass = tmptype;
12191  continue;
12192  }
12193  if (PyType_IsSubtype(metaclass, tmptype))
12194  continue;
12195  if (PyType_IsSubtype(tmptype, metaclass)) {
12196  metaclass = tmptype;
12197  continue;
12198  }
12199  PyErr_SetString(PyExc_TypeError,
12200  "metaclass conflict: "
12201  "the metaclass of a derived class "
12202  "must be a (non-strict) subclass "
12203  "of the metaclasses of all its bases");
12204  return NULL;
12205  }
12206  if (!metaclass) {
12207 #if PY_MAJOR_VERSION < 3
12208  metaclass = &PyClass_Type;
12209 #else
12210  metaclass = &PyType_Type;
12211 #endif
12212  }
12213  Py_INCREF((PyObject*) metaclass);
12214  return (PyObject*) metaclass;
12215 }
12216 
12217 /* Py3ClassCreate */
12218  static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
12219  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
12220  PyObject *ns;
12221  if (metaclass) {
12222  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
12223  if (prep) {
12224  PyObject *pargs = PyTuple_Pack(2, name, bases);
12225  if (unlikely(!pargs)) {
12226  Py_DECREF(prep);
12227  return NULL;
12228  }
12229  ns = PyObject_Call(prep, pargs, mkw);
12230  Py_DECREF(prep);
12231  Py_DECREF(pargs);
12232  } else {
12233  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
12234  return NULL;
12235  PyErr_Clear();
12236  ns = PyDict_New();
12237  }
12238  } else {
12239  ns = PyDict_New();
12240  }
12241  if (unlikely(!ns))
12242  return NULL;
12243  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
12244  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
12245  if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
12246  return ns;
12247 bad:
12248  Py_DECREF(ns);
12249  return NULL;
12250 }
12251 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
12252  PyObject *dict, PyObject *mkw,
12253  int calculate_metaclass, int allow_py2_metaclass) {
12254  PyObject *result, *margs;
12255  PyObject *owned_metaclass = NULL;
12256  if (allow_py2_metaclass) {
12257  owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
12258  if (owned_metaclass) {
12259  metaclass = owned_metaclass;
12260  } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
12261  PyErr_Clear();
12262  } else {
12263  return NULL;
12264  }
12265  }
12266  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
12267  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
12268  Py_XDECREF(owned_metaclass);
12269  if (unlikely(!metaclass))
12270  return NULL;
12271  owned_metaclass = metaclass;
12272  }
12273  margs = PyTuple_Pack(3, name, bases, dict);
12274  if (unlikely(!margs)) {
12275  result = NULL;
12276  } else {
12277  result = PyObject_Call(metaclass, margs, mkw);
12278  Py_DECREF(margs);
12279  }
12280  Py_XDECREF(owned_metaclass);
12281  return result;
12282 }
12283 
12284 /* CLineInTraceback */
12285  #ifndef CYTHON_CLINE_IN_TRACEBACK
12286 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
12287  PyObject *use_cline;
12288  PyObject *ptype, *pvalue, *ptraceback;
12289 #if CYTHON_COMPILING_IN_CPYTHON
12290  PyObject **cython_runtime_dict;
12291 #endif
12292  if (unlikely(!__pyx_cython_runtime)) {
12293  return c_line;
12294  }
12295  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
12296 #if CYTHON_COMPILING_IN_CPYTHON
12297  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
12298  if (likely(cython_runtime_dict)) {
12299  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
12300  use_cline, *cython_runtime_dict,
12301  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
12302  } else
12303 #endif
12304  {
12305  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
12306  if (use_cline_obj) {
12307  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
12308  Py_DECREF(use_cline_obj);
12309  } else {
12310  PyErr_Clear();
12311  use_cline = NULL;
12312  }
12313  }
12314  if (!use_cline) {
12315  c_line = 0;
12316  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
12317  }
12318  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
12319  c_line = 0;
12320  }
12321  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
12322  return c_line;
12323 }
12324 #endif
12325 
12326 /* CodeObjectCache */
12327  static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
12328  int start = 0, mid = 0, end = count - 1;
12329  if (end >= 0 && code_line > entries[end].code_line) {
12330  return count;
12331  }
12332  while (start < end) {
12333  mid = start + (end - start) / 2;
12334  if (code_line < entries[mid].code_line) {
12335  end = mid;
12336  } else if (code_line > entries[mid].code_line) {
12337  start = mid + 1;
12338  } else {
12339  return mid;
12340  }
12341  }
12342  if (code_line <= entries[mid].code_line) {
12343  return mid;
12344  } else {
12345  return mid + 1;
12346  }
12347 }
12348 static PyCodeObject *__pyx_find_code_object(int code_line) {
12349  PyCodeObject* code_object;
12350  int pos;
12351  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
12352  return NULL;
12353  }
12354  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
12355  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
12356  return NULL;
12357  }
12358  code_object = __pyx_code_cache.entries[pos].code_object;
12359  Py_INCREF(code_object);
12360  return code_object;
12361 }
12362 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
12363  int pos, i;
12364  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
12365  if (unlikely(!code_line)) {
12366  return;
12367  }
12368  if (unlikely(!entries)) {
12369  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
12370  if (likely(entries)) {
12371  __pyx_code_cache.entries = entries;
12372  __pyx_code_cache.max_count = 64;
12373  __pyx_code_cache.count = 1;
12374  entries[0].code_line = code_line;
12375  entries[0].code_object = code_object;
12376  Py_INCREF(code_object);
12377  }
12378  return;
12379  }
12380  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
12381  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
12382  PyCodeObject* tmp = entries[pos].code_object;
12383  entries[pos].code_object = code_object;
12384  Py_DECREF(tmp);
12385  return;
12386  }
12387  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
12388  int new_max = __pyx_code_cache.max_count + 64;
12389  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
12390  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
12391  if (unlikely(!entries)) {
12392  return;
12393  }
12394  __pyx_code_cache.entries = entries;
12395  __pyx_code_cache.max_count = new_max;
12396  }
12397  for (i=__pyx_code_cache.count; i>pos; i--) {
12398  entries[i] = entries[i-1];
12399  }
12400  entries[pos].code_line = code_line;
12401  entries[pos].code_object = code_object;
12402  __pyx_code_cache.count++;
12403  Py_INCREF(code_object);
12404 }
12405 
12406 /* AddTraceback */
12407  #include "compile.h"
12408 #include "frameobject.h"
12409 #include "traceback.h"
12410 #if PY_VERSION_HEX >= 0x030b00a6
12411  #ifndef Py_BUILD_CORE
12412  #define Py_BUILD_CORE 1
12413  #endif
12414  #include "internal/pycore_frame.h"
12415 #endif
12416 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
12417  const char *funcname, int c_line,
12418  int py_line, const char *filename) {
12419  PyCodeObject *py_code = NULL;
12420  PyObject *py_funcname = NULL;
12421  #if PY_MAJOR_VERSION < 3
12422  PyObject *py_srcfile = NULL;
12423  py_srcfile = PyString_FromString(filename);
12424  if (!py_srcfile) goto bad;
12425  #endif
12426  if (c_line) {
12427  #if PY_MAJOR_VERSION < 3
12428  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
12429  if (!py_funcname) goto bad;
12430  #else
12431  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
12432  if (!py_funcname) goto bad;
12433  funcname = PyUnicode_AsUTF8(py_funcname);
12434  if (!funcname) goto bad;
12435  #endif
12436  }
12437  else {
12438  #if PY_MAJOR_VERSION < 3
12439  py_funcname = PyString_FromString(funcname);
12440  if (!py_funcname) goto bad;
12441  #endif
12442  }
12443  #if PY_MAJOR_VERSION < 3
12444  py_code = __Pyx_PyCode_New(
12445  0,
12446  0,
12447  0,
12448  0,
12449  0,
12450  __pyx_empty_bytes, /*PyObject *code,*/
12451  __pyx_empty_tuple, /*PyObject *consts,*/
12452  __pyx_empty_tuple, /*PyObject *names,*/
12453  __pyx_empty_tuple, /*PyObject *varnames,*/
12454  __pyx_empty_tuple, /*PyObject *freevars,*/
12455  __pyx_empty_tuple, /*PyObject *cellvars,*/
12456  py_srcfile, /*PyObject *filename,*/
12457  py_funcname, /*PyObject *name,*/
12458  py_line,
12459  __pyx_empty_bytes /*PyObject *lnotab*/
12460  );
12461  Py_DECREF(py_srcfile);
12462  #else
12463  py_code = PyCode_NewEmpty(filename, funcname, py_line);
12464  #endif
12465  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
12466  return py_code;
12467 bad:
12468  Py_XDECREF(py_funcname);
12469  #if PY_MAJOR_VERSION < 3
12470  Py_XDECREF(py_srcfile);
12471  #endif
12472  return NULL;
12473 }
12474 static void __Pyx_AddTraceback(const char *funcname, int c_line,
12475  int py_line, const char *filename) {
12476  PyCodeObject *py_code = 0;
12477  PyFrameObject *py_frame = 0;
12478  PyThreadState *tstate = __Pyx_PyThreadState_Current;
12479  PyObject *ptype, *pvalue, *ptraceback;
12480  if (c_line) {
12481  c_line = __Pyx_CLineForTraceback(tstate, c_line);
12482  }
12483  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
12484  if (!py_code) {
12485  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
12486  py_code = __Pyx_CreateCodeObjectForTraceback(
12487  funcname, c_line, py_line, filename);
12488  if (!py_code) {
12489  /* If the code object creation fails, then we should clear the
12490  fetched exception references and propagate the new exception */
12491  Py_XDECREF(ptype);
12492  Py_XDECREF(pvalue);
12493  Py_XDECREF(ptraceback);
12494  goto bad;
12495  }
12496  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
12497  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
12498  }
12499  py_frame = PyFrame_New(
12500  tstate, /*PyThreadState *tstate,*/
12501  py_code, /*PyCodeObject *code,*/
12502  __pyx_d, /*PyObject *globals,*/
12503  0 /*PyObject *locals*/
12504  );
12505  if (!py_frame) goto bad;
12506  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
12507  PyTraceBack_Here(py_frame);
12508 bad:
12509  Py_XDECREF(py_code);
12510  Py_XDECREF(py_frame);
12511 }
12512 
12513 #if PY_MAJOR_VERSION < 3
12514 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
12515  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
12516  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
12517  return -1;
12518 }
12519 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
12520  PyObject *obj = view->obj;
12521  if (!obj) return;
12522  if (PyObject_CheckBuffer(obj)) {
12523  PyBuffer_Release(view);
12524  return;
12525  }
12526  if ((0)) {}
12527  view->obj = NULL;
12528  Py_DECREF(obj);
12529 }
12530 #endif
12531 
12532 
12533  /* CIntFromPyVerify */
12534  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
12535  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
12536 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
12537  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
12538 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
12539  {\
12540  func_type value = func_value;\
12541  if (sizeof(target_type) < sizeof(func_type)) {\
12542  if (unlikely(value != (func_type) (target_type) value)) {\
12543  func_type zero = 0;\
12544  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
12545  return (target_type) -1;\
12546  if (is_unsigned && unlikely(value < zero))\
12547  goto raise_neg_overflow;\
12548  else\
12549  goto raise_overflow;\
12550  }\
12551  }\
12552  return (target_type) value;\
12553  }
12554 
12555 /* Declarations */
12556  #if CYTHON_CCOMPLEX
12557  #ifdef __cplusplus
12558  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
12559  return ::std::complex< float >(x, y);
12560  }
12561  #else
12562  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
12563  return x + y*(__pyx_t_float_complex)_Complex_I;
12564  }
12565  #endif
12566 #else
12567  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
12568  __pyx_t_float_complex z;
12569  z.real = x;
12570  z.imag = y;
12571  return z;
12572  }
12573 #endif
12574 
12575 /* Arithmetic */
12576  #if CYTHON_CCOMPLEX
12577 #else
12578  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12579  return (a.real == b.real) && (a.imag == b.imag);
12580  }
12581  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12582  __pyx_t_float_complex z;
12583  z.real = a.real + b.real;
12584  z.imag = a.imag + b.imag;
12585  return z;
12586  }
12587  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12588  __pyx_t_float_complex z;
12589  z.real = a.real - b.real;
12590  z.imag = a.imag - b.imag;
12591  return z;
12592  }
12593  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12594  __pyx_t_float_complex z;
12595  z.real = a.real * b.real - a.imag * b.imag;
12596  z.imag = a.real * b.imag + a.imag * b.real;
12597  return z;
12598  }
12599  #if 1
12600  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12601  if (b.imag == 0) {
12602  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
12603  } else if (fabsf(b.real) >= fabsf(b.imag)) {
12604  if (b.real == 0 && b.imag == 0) {
12605  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
12606  } else {
12607  float r = b.imag / b.real;
12608  float s = (float)(1.0) / (b.real + b.imag * r);
12609  return __pyx_t_float_complex_from_parts(
12610  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
12611  }
12612  } else {
12613  float r = b.real / b.imag;
12614  float s = (float)(1.0) / (b.imag + b.real * r);
12615  return __pyx_t_float_complex_from_parts(
12616  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
12617  }
12618  }
12619  #else
12620  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12621  if (b.imag == 0) {
12622  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
12623  } else {
12624  float denom = b.real * b.real + b.imag * b.imag;
12625  return __pyx_t_float_complex_from_parts(
12626  (a.real * b.real + a.imag * b.imag) / denom,
12627  (a.imag * b.real - a.real * b.imag) / denom);
12628  }
12629  }
12630  #endif
12631  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
12632  __pyx_t_float_complex z;
12633  z.real = -a.real;
12634  z.imag = -a.imag;
12635  return z;
12636  }
12637  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
12638  return (a.real == 0) && (a.imag == 0);
12639  }
12640  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
12641  __pyx_t_float_complex z;
12642  z.real = a.real;
12643  z.imag = -a.imag;
12644  return z;
12645  }
12646  #if 1
12647  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
12648  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
12649  return sqrtf(z.real*z.real + z.imag*z.imag);
12650  #else
12651  return hypotf(z.real, z.imag);
12652  #endif
12653  }
12654  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12655  __pyx_t_float_complex z;
12656  float r, lnr, theta, z_r, z_theta;
12657  if (b.imag == 0 && b.real == (int)b.real) {
12658  if (b.real < 0) {
12659  float denom = a.real * a.real + a.imag * a.imag;
12660  a.real = a.real / denom;
12661  a.imag = -a.imag / denom;
12662  b.real = -b.real;
12663  }
12664  switch ((int)b.real) {
12665  case 0:
12666  z.real = 1;
12667  z.imag = 0;
12668  return z;
12669  case 1:
12670  return a;
12671  case 2:
12672  return __Pyx_c_prod_float(a, a);
12673  case 3:
12674  z = __Pyx_c_prod_float(a, a);
12675  return __Pyx_c_prod_float(z, a);
12676  case 4:
12677  z = __Pyx_c_prod_float(a, a);
12678  return __Pyx_c_prod_float(z, z);
12679  }
12680  }
12681  if (a.imag == 0) {
12682  if (a.real == 0) {
12683  return a;
12684  } else if (b.imag == 0) {
12685  z.real = powf(a.real, b.real);
12686  z.imag = 0;
12687  return z;
12688  } else if (a.real > 0) {
12689  r = a.real;
12690  theta = 0;
12691  } else {
12692  r = -a.real;
12693  theta = atan2f(0.0, -1.0);
12694  }
12695  } else {
12696  r = __Pyx_c_abs_float(a);
12697  theta = atan2f(a.imag, a.real);
12698  }
12699  lnr = logf(r);
12700  z_r = expf(lnr * b.real - theta * b.imag);
12701  z_theta = theta * b.real + lnr * b.imag;
12702  z.real = z_r * cosf(z_theta);
12703  z.imag = z_r * sinf(z_theta);
12704  return z;
12705  }
12706  #endif
12707 #endif
12708 
12709 /* Declarations */
12710  #if CYTHON_CCOMPLEX
12711  #ifdef __cplusplus
12712  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
12713  return ::std::complex< double >(x, y);
12714  }
12715  #else
12716  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
12717  return x + y*(__pyx_t_double_complex)_Complex_I;
12718  }
12719  #endif
12720 #else
12721  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
12722  __pyx_t_double_complex z;
12723  z.real = x;
12724  z.imag = y;
12725  return z;
12726  }
12727 #endif
12728 
12729 /* Arithmetic */
12730  #if CYTHON_CCOMPLEX
12731 #else
12732  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12733  return (a.real == b.real) && (a.imag == b.imag);
12734  }
12735  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12736  __pyx_t_double_complex z;
12737  z.real = a.real + b.real;
12738  z.imag = a.imag + b.imag;
12739  return z;
12740  }
12741  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12742  __pyx_t_double_complex z;
12743  z.real = a.real - b.real;
12744  z.imag = a.imag - b.imag;
12745  return z;
12746  }
12747  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12748  __pyx_t_double_complex z;
12749  z.real = a.real * b.real - a.imag * b.imag;
12750  z.imag = a.real * b.imag + a.imag * b.real;
12751  return z;
12752  }
12753  #if 1
12754  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12755  if (b.imag == 0) {
12756  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
12757  } else if (fabs(b.real) >= fabs(b.imag)) {
12758  if (b.real == 0 && b.imag == 0) {
12759  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
12760  } else {
12761  double r = b.imag / b.real;
12762  double s = (double)(1.0) / (b.real + b.imag * r);
12763  return __pyx_t_double_complex_from_parts(
12764  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
12765  }
12766  } else {
12767  double r = b.real / b.imag;
12768  double s = (double)(1.0) / (b.imag + b.real * r);
12769  return __pyx_t_double_complex_from_parts(
12770  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
12771  }
12772  }
12773  #else
12774  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12775  if (b.imag == 0) {
12776  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
12777  } else {
12778  double denom = b.real * b.real + b.imag * b.imag;
12779  return __pyx_t_double_complex_from_parts(
12780  (a.real * b.real + a.imag * b.imag) / denom,
12781  (a.imag * b.real - a.real * b.imag) / denom);
12782  }
12783  }
12784  #endif
12785  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
12786  __pyx_t_double_complex z;
12787  z.real = -a.real;
12788  z.imag = -a.imag;
12789  return z;
12790  }
12791  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
12792  return (a.real == 0) && (a.imag == 0);
12793  }
12794  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
12795  __pyx_t_double_complex z;
12796  z.real = a.real;
12797  z.imag = -a.imag;
12798  return z;
12799  }
12800  #if 1
12801  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
12802  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
12803  return sqrt(z.real*z.real + z.imag*z.imag);
12804  #else
12805  return hypot(z.real, z.imag);
12806  #endif
12807  }
12808  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12809  __pyx_t_double_complex z;
12810  double r, lnr, theta, z_r, z_theta;
12811  if (b.imag == 0 && b.real == (int)b.real) {
12812  if (b.real < 0) {
12813  double denom = a.real * a.real + a.imag * a.imag;
12814  a.real = a.real / denom;
12815  a.imag = -a.imag / denom;
12816  b.real = -b.real;
12817  }
12818  switch ((int)b.real) {
12819  case 0:
12820  z.real = 1;
12821  z.imag = 0;
12822  return z;
12823  case 1:
12824  return a;
12825  case 2:
12826  return __Pyx_c_prod_double(a, a);
12827  case 3:
12828  z = __Pyx_c_prod_double(a, a);
12829  return __Pyx_c_prod_double(z, a);
12830  case 4:
12831  z = __Pyx_c_prod_double(a, a);
12832  return __Pyx_c_prod_double(z, z);
12833  }
12834  }
12835  if (a.imag == 0) {
12836  if (a.real == 0) {
12837  return a;
12838  } else if (b.imag == 0) {
12839  z.real = pow(a.real, b.real);
12840  z.imag = 0;
12841  return z;
12842  } else if (a.real > 0) {
12843  r = a.real;
12844  theta = 0;
12845  } else {
12846  r = -a.real;
12847  theta = atan2(0.0, -1.0);
12848  }
12849  } else {
12850  r = __Pyx_c_abs_double(a);
12851  theta = atan2(a.imag, a.real);
12852  }
12853  lnr = log(r);
12854  z_r = exp(lnr * b.real - theta * b.imag);
12855  z_theta = theta * b.real + lnr * b.imag;
12856  z.real = z_r * cos(z_theta);
12857  z.imag = z_r * sin(z_theta);
12858  return z;
12859  }
12860  #endif
12861 #endif
12862 
12863 /* CIntToPy */
12864  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
12865 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12866 #pragma GCC diagnostic push
12867 #pragma GCC diagnostic ignored "-Wconversion"
12868 #endif
12869  const int neg_one = (int) -1, const_zero = (int) 0;
12870 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12871 #pragma GCC diagnostic pop
12872 #endif
12873  const int is_unsigned = neg_one > const_zero;
12874  if (is_unsigned) {
12875  if (sizeof(int) < sizeof(long)) {
12876  return PyInt_FromLong((long) value);
12877  } else if (sizeof(int) <= sizeof(unsigned long)) {
12878  return PyLong_FromUnsignedLong((unsigned long) value);
12879 #ifdef HAVE_LONG_LONG
12880  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
12881  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
12882 #endif
12883  }
12884  } else {
12885  if (sizeof(int) <= sizeof(long)) {
12886  return PyInt_FromLong((long) value);
12887 #ifdef HAVE_LONG_LONG
12888  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
12889  return PyLong_FromLongLong((PY_LONG_LONG) value);
12890 #endif
12891  }
12892  }
12893  {
12894  int one = 1; int little = (int)*(unsigned char *)&one;
12895  unsigned char *bytes = (unsigned char *)&value;
12896  return _PyLong_FromByteArray(bytes, sizeof(int),
12897  little, !is_unsigned);
12898  }
12899 }
12900 
12901 /* CIntFromPy */
12902  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
12903 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12904 #pragma GCC diagnostic push
12905 #pragma GCC diagnostic ignored "-Wconversion"
12906 #endif
12907  const int neg_one = (int) -1, const_zero = (int) 0;
12908 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12909 #pragma GCC diagnostic pop
12910 #endif
12911  const int is_unsigned = neg_one > const_zero;
12912 #if PY_MAJOR_VERSION < 3
12913  if (likely(PyInt_Check(x))) {
12914  if (sizeof(int) < sizeof(long)) {
12915  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
12916  } else {
12917  long val = PyInt_AS_LONG(x);
12918  if (is_unsigned && unlikely(val < 0)) {
12919  goto raise_neg_overflow;
12920  }
12921  return (int) val;
12922  }
12923  } else
12924 #endif
12925  if (likely(PyLong_Check(x))) {
12926  if (is_unsigned) {
12927 #if CYTHON_USE_PYLONG_INTERNALS
12928  const digit* digits = ((PyLongObject*)x)->ob_digit;
12929  switch (Py_SIZE(x)) {
12930  case 0: return (int) 0;
12931  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
12932  case 2:
12933  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
12934  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12935  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12936  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
12937  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12938  }
12939  }
12940  break;
12941  case 3:
12942  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
12943  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12944  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12945  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
12946  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12947  }
12948  }
12949  break;
12950  case 4:
12951  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
12952  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12953  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12954  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
12955  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
12956  }
12957  }
12958  break;
12959  }
12960 #endif
12961 #if CYTHON_COMPILING_IN_CPYTHON
12962  if (unlikely(Py_SIZE(x) < 0)) {
12963  goto raise_neg_overflow;
12964  }
12965 #else
12966  {
12967  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12968  if (unlikely(result < 0))
12969  return (int) -1;
12970  if (unlikely(result == 1))
12971  goto raise_neg_overflow;
12972  }
12973 #endif
12974  if (sizeof(int) <= sizeof(unsigned long)) {
12975  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
12976 #ifdef HAVE_LONG_LONG
12977  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
12978  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
12979 #endif
12980  }
12981  } else {
12982 #if CYTHON_USE_PYLONG_INTERNALS
12983  const digit* digits = ((PyLongObject*)x)->ob_digit;
12984  switch (Py_SIZE(x)) {
12985  case 0: return (int) 0;
12986  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
12987  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
12988  case -2:
12989  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
12990  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
12991  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12992  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
12993  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
12994  }
12995  }
12996  break;
12997  case 2:
12998  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
12999  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13000  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13001  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
13002  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13003  }
13004  }
13005  break;
13006  case -3:
13007  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
13008  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13009  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13010  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
13011  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13012  }
13013  }
13014  break;
13015  case 3:
13016  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
13017  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13018  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13019  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
13020  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13021  }
13022  }
13023  break;
13024  case -4:
13025  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
13026  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13027  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13028  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
13029  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13030  }
13031  }
13032  break;
13033  case 4:
13034  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
13035  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13036  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13037  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
13038  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13039  }
13040  }
13041  break;
13042  }
13043 #endif
13044  if (sizeof(int) <= sizeof(long)) {
13045  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
13046 #ifdef HAVE_LONG_LONG
13047  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
13048  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
13049 #endif
13050  }
13051  }
13052  {
13053 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
13054  PyErr_SetString(PyExc_RuntimeError,
13055  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
13056 #else
13057  int val;
13058  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
13059  #if PY_MAJOR_VERSION < 3
13060  if (likely(v) && !PyLong_Check(v)) {
13061  PyObject *tmp = v;
13062  v = PyNumber_Long(tmp);
13063  Py_DECREF(tmp);
13064  }
13065  #endif
13066  if (likely(v)) {
13067  int one = 1; int is_little = (int)*(unsigned char *)&one;
13068  unsigned char *bytes = (unsigned char *)&val;
13069  int ret = _PyLong_AsByteArray((PyLongObject *)v,
13070  bytes, sizeof(val),
13071  is_little, !is_unsigned);
13072  Py_DECREF(v);
13073  if (likely(!ret))
13074  return val;
13075  }
13076 #endif
13077  return (int) -1;
13078  }
13079  } else {
13080  int val;
13081  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
13082  if (!tmp) return (int) -1;
13083  val = __Pyx_PyInt_As_int(tmp);
13084  Py_DECREF(tmp);
13085  return val;
13086  }
13087 raise_overflow:
13088  PyErr_SetString(PyExc_OverflowError,
13089  "value too large to convert to int");
13090  return (int) -1;
13091 raise_neg_overflow:
13092  PyErr_SetString(PyExc_OverflowError,
13093  "can't convert negative value to int");
13094  return (int) -1;
13095 }
13096 
13097 /* CIntToPy */
13098  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
13099 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13100 #pragma GCC diagnostic push
13101 #pragma GCC diagnostic ignored "-Wconversion"
13102 #endif
13103  const long neg_one = (long) -1, const_zero = (long) 0;
13104 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13105 #pragma GCC diagnostic pop
13106 #endif
13107  const int is_unsigned = neg_one > const_zero;
13108  if (is_unsigned) {
13109  if (sizeof(long) < sizeof(long)) {
13110  return PyInt_FromLong((long) value);
13111  } else if (sizeof(long) <= sizeof(unsigned long)) {
13112  return PyLong_FromUnsignedLong((unsigned long) value);
13113 #ifdef HAVE_LONG_LONG
13114  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
13115  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
13116 #endif
13117  }
13118  } else {
13119  if (sizeof(long) <= sizeof(long)) {
13120  return PyInt_FromLong((long) value);
13121 #ifdef HAVE_LONG_LONG
13122  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
13123  return PyLong_FromLongLong((PY_LONG_LONG) value);
13124 #endif
13125  }
13126  }
13127  {
13128  int one = 1; int little = (int)*(unsigned char *)&one;
13129  unsigned char *bytes = (unsigned char *)&value;
13130  return _PyLong_FromByteArray(bytes, sizeof(long),
13131  little, !is_unsigned);
13132  }
13133 }
13134 
13135 /* CIntFromPy */
13136  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
13137 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13138 #pragma GCC diagnostic push
13139 #pragma GCC diagnostic ignored "-Wconversion"
13140 #endif
13141  const long neg_one = (long) -1, const_zero = (long) 0;
13142 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13143 #pragma GCC diagnostic pop
13144 #endif
13145  const int is_unsigned = neg_one > const_zero;
13146 #if PY_MAJOR_VERSION < 3
13147  if (likely(PyInt_Check(x))) {
13148  if (sizeof(long) < sizeof(long)) {
13149  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
13150  } else {
13151  long val = PyInt_AS_LONG(x);
13152  if (is_unsigned && unlikely(val < 0)) {
13153  goto raise_neg_overflow;
13154  }
13155  return (long) val;
13156  }
13157  } else
13158 #endif
13159  if (likely(PyLong_Check(x))) {
13160  if (is_unsigned) {
13161 #if CYTHON_USE_PYLONG_INTERNALS
13162  const digit* digits = ((PyLongObject*)x)->ob_digit;
13163  switch (Py_SIZE(x)) {
13164  case 0: return (long) 0;
13165  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
13166  case 2:
13167  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
13168  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13169  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13170  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
13171  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13172  }
13173  }
13174  break;
13175  case 3:
13176  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
13177  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13178  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13179  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
13180  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13181  }
13182  }
13183  break;
13184  case 4:
13185  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
13186  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13187  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13188  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
13189  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13190  }
13191  }
13192  break;
13193  }
13194 #endif
13195 #if CYTHON_COMPILING_IN_CPYTHON
13196  if (unlikely(Py_SIZE(x) < 0)) {
13197  goto raise_neg_overflow;
13198  }
13199 #else
13200  {
13201  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
13202  if (unlikely(result < 0))
13203  return (long) -1;
13204  if (unlikely(result == 1))
13205  goto raise_neg_overflow;
13206  }
13207 #endif
13208  if (sizeof(long) <= sizeof(unsigned long)) {
13209  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
13210 #ifdef HAVE_LONG_LONG
13211  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
13212  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
13213 #endif
13214  }
13215  } else {
13216 #if CYTHON_USE_PYLONG_INTERNALS
13217  const digit* digits = ((PyLongObject*)x)->ob_digit;
13218  switch (Py_SIZE(x)) {
13219  case 0: return (long) 0;
13220  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
13221  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
13222  case -2:
13223  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
13224  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13225  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13226  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
13227  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13228  }
13229  }
13230  break;
13231  case 2:
13232  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
13233  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13234  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13235  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
13236  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13237  }
13238  }
13239  break;
13240  case -3:
13241  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
13242  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13243  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13244  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
13245  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13246  }
13247  }
13248  break;
13249  case 3:
13250  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
13251  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13252  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13253  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
13254  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13255  }
13256  }
13257  break;
13258  case -4:
13259  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
13260  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13261  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13262  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
13263  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13264  }
13265  }
13266  break;
13267  case 4:
13268  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
13269  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13270  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13271  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
13272  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13273  }
13274  }
13275  break;
13276  }
13277 #endif
13278  if (sizeof(long) <= sizeof(long)) {
13279  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
13280 #ifdef HAVE_LONG_LONG
13281  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
13282  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
13283 #endif
13284  }
13285  }
13286  {
13287 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
13288  PyErr_SetString(PyExc_RuntimeError,
13289  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
13290 #else
13291  long val;
13292  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
13293  #if PY_MAJOR_VERSION < 3
13294  if (likely(v) && !PyLong_Check(v)) {
13295  PyObject *tmp = v;
13296  v = PyNumber_Long(tmp);
13297  Py_DECREF(tmp);
13298  }
13299  #endif
13300  if (likely(v)) {
13301  int one = 1; int is_little = (int)*(unsigned char *)&one;
13302  unsigned char *bytes = (unsigned char *)&val;
13303  int ret = _PyLong_AsByteArray((PyLongObject *)v,
13304  bytes, sizeof(val),
13305  is_little, !is_unsigned);
13306  Py_DECREF(v);
13307  if (likely(!ret))
13308  return val;
13309  }
13310 #endif
13311  return (long) -1;
13312  }
13313  } else {
13314  long val;
13315  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
13316  if (!tmp) return (long) -1;
13317  val = __Pyx_PyInt_As_long(tmp);
13318  Py_DECREF(tmp);
13319  return val;
13320  }
13321 raise_overflow:
13322  PyErr_SetString(PyExc_OverflowError,
13323  "value too large to convert to long");
13324  return (long) -1;
13325 raise_neg_overflow:
13326  PyErr_SetString(PyExc_OverflowError,
13327  "can't convert negative value to long");
13328  return (long) -1;
13329 }
13330 
13331 /* FastTypeChecks */
13332  #if CYTHON_COMPILING_IN_CPYTHON
13333 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
13334  while (a) {
13335  a = a->tp_base;
13336  if (a == b)
13337  return 1;
13338  }
13339  return b == &PyBaseObject_Type;
13340 }
13341 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
13342  PyObject *mro;
13343  if (a == b) return 1;
13344  mro = a->tp_mro;
13345  if (likely(mro)) {
13346  Py_ssize_t i, n;
13347  n = PyTuple_GET_SIZE(mro);
13348  for (i = 0; i < n; i++) {
13349  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
13350  return 1;
13351  }
13352  return 0;
13353  }
13354  return __Pyx_InBases(a, b);
13355 }
13356 #if PY_MAJOR_VERSION == 2
13357 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
13358  PyObject *exception, *value, *tb;
13359  int res;
13360  __Pyx_PyThreadState_declare
13361  __Pyx_PyThreadState_assign
13362  __Pyx_ErrFetch(&exception, &value, &tb);
13363  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
13364  if (unlikely(res == -1)) {
13365  PyErr_WriteUnraisable(err);
13366  res = 0;
13367  }
13368  if (!res) {
13369  res = PyObject_IsSubclass(err, exc_type2);
13370  if (unlikely(res == -1)) {
13371  PyErr_WriteUnraisable(err);
13372  res = 0;
13373  }
13374  }
13375  __Pyx_ErrRestore(exception, value, tb);
13376  return res;
13377 }
13378 #else
13379 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
13380  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
13381  if (!res) {
13382  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
13383  }
13384  return res;
13385 }
13386 #endif
13387 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
13388  Py_ssize_t i, n;
13389  assert(PyExceptionClass_Check(exc_type));
13390  n = PyTuple_GET_SIZE(tuple);
13391 #if PY_MAJOR_VERSION >= 3
13392  for (i=0; i<n; i++) {
13393  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
13394  }
13395 #endif
13396  for (i=0; i<n; i++) {
13397  PyObject *t = PyTuple_GET_ITEM(tuple, i);
13398  #if PY_MAJOR_VERSION < 3
13399  if (likely(exc_type == t)) return 1;
13400  #endif
13401  if (likely(PyExceptionClass_Check(t))) {
13402  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
13403  } else {
13404  }
13405  }
13406  return 0;
13407 }
13408 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
13409  if (likely(err == exc_type)) return 1;
13410  if (likely(PyExceptionClass_Check(err))) {
13411  if (likely(PyExceptionClass_Check(exc_type))) {
13412  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
13413  } else if (likely(PyTuple_Check(exc_type))) {
13414  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
13415  } else {
13416  }
13417  }
13418  return PyErr_GivenExceptionMatches(err, exc_type);
13419 }
13420 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
13421  assert(PyExceptionClass_Check(exc_type1));
13422  assert(PyExceptionClass_Check(exc_type2));
13423  if (likely(err == exc_type1 || err == exc_type2)) return 1;
13424  if (likely(PyExceptionClass_Check(err))) {
13425  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
13426  }
13427  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
13428 }
13429 #endif
13430 
13431 /* CheckBinaryVersion */
13432  static int __Pyx_check_binary_version(void) {
13433  char ctversion[5];
13434  int same=1, i, found_dot;
13435  const char* rt_from_call = Py_GetVersion();
13436  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
13437  found_dot = 0;
13438  for (i = 0; i < 4; i++) {
13439  if (!ctversion[i]) {
13440  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
13441  break;
13442  }
13443  if (rt_from_call[i] != ctversion[i]) {
13444  same = 0;
13445  break;
13446  }
13447  }
13448  if (!same) {
13449  char rtversion[5] = {'\0'};
13450  char message[200];
13451  for (i=0; i<4; ++i) {
13452  if (rt_from_call[i] == '.') {
13453  if (found_dot) break;
13454  found_dot = 1;
13455  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
13456  break;
13457  }
13458  rtversion[i] = rt_from_call[i];
13459  }
13460  PyOS_snprintf(message, sizeof(message),
13461  "compiletime version %s of module '%.100s' "
13462  "does not match runtime version %s",
13463  ctversion, __Pyx_MODULE_NAME, rtversion);
13464  return PyErr_WarnEx(NULL, message, 1);
13465  }
13466  return 0;
13467 }
13468 
13469 /* InitStrings */
13470  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
13471  while (t->p) {
13472  #if PY_MAJOR_VERSION < 3
13473  if (t->is_unicode) {
13474  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
13475  } else if (t->intern) {
13476  *t->p = PyString_InternFromString(t->s);
13477  } else {
13478  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
13479  }
13480  #else
13481  if (t->is_unicode | t->is_str) {
13482  if (t->intern) {
13483  *t->p = PyUnicode_InternFromString(t->s);
13484  } else if (t->encoding) {
13485  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
13486  } else {
13487  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
13488  }
13489  } else {
13490  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
13491  }
13492  #endif
13493  if (!*t->p)
13494  return -1;
13495  if (PyObject_Hash(*t->p) == -1)
13496  return -1;
13497  ++t;
13498  }
13499  return 0;
13500 }
13501 
13502 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
13503  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
13504 }
13505 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
13506  Py_ssize_t ignore;
13507  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
13508 }
13509 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
13510 #if !CYTHON_PEP393_ENABLED
13511 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13512  char* defenc_c;
13513  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
13514  if (!defenc) return NULL;
13515  defenc_c = PyBytes_AS_STRING(defenc);
13516 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13517  {
13518  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
13519  char* c;
13520  for (c = defenc_c; c < end; c++) {
13521  if ((unsigned char) (*c) >= 128) {
13522  PyUnicode_AsASCIIString(o);
13523  return NULL;
13524  }
13525  }
13526  }
13527 #endif
13528  *length = PyBytes_GET_SIZE(defenc);
13529  return defenc_c;
13530 }
13531 #else
13532 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13533  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
13534 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13535  if (likely(PyUnicode_IS_ASCII(o))) {
13536  *length = PyUnicode_GET_LENGTH(o);
13537  return PyUnicode_AsUTF8(o);
13538  } else {
13539  PyUnicode_AsASCIIString(o);
13540  return NULL;
13541  }
13542 #else
13543  return PyUnicode_AsUTF8AndSize(o, length);
13544 #endif
13545 }
13546 #endif
13547 #endif
13548 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13549 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
13550  if (
13551 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13552  __Pyx_sys_getdefaultencoding_not_ascii &&
13553 #endif
13554  PyUnicode_Check(o)) {
13555  return __Pyx_PyUnicode_AsStringAndSize(o, length);
13556  } else
13557 #endif
13558 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
13559  if (PyByteArray_Check(o)) {
13560  *length = PyByteArray_GET_SIZE(o);
13561  return PyByteArray_AS_STRING(o);
13562  } else
13563 #endif
13564  {
13565  char* result;
13566  int r = PyBytes_AsStringAndSize(o, &result, length);
13567  if (unlikely(r < 0)) {
13568  return NULL;
13569  } else {
13570  return result;
13571  }
13572  }
13573 }
13574 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
13575  int is_true = x == Py_True;
13576  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
13577  else return PyObject_IsTrue(x);
13578 }
13579 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
13580  int retval;
13581  if (unlikely(!x)) return -1;
13582  retval = __Pyx_PyObject_IsTrue(x);
13583  Py_DECREF(x);
13584  return retval;
13585 }
13586 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
13587 #if PY_MAJOR_VERSION >= 3
13588  if (PyLong_Check(result)) {
13589  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
13590  "__int__ returned non-int (type %.200s). "
13591  "The ability to return an instance of a strict subclass of int "
13592  "is deprecated, and may be removed in a future version of Python.",
13593  Py_TYPE(result)->tp_name)) {
13594  Py_DECREF(result);
13595  return NULL;
13596  }
13597  return result;
13598  }
13599 #endif
13600  PyErr_Format(PyExc_TypeError,
13601  "__%.4s__ returned non-%.4s (type %.200s)",
13602  type_name, type_name, Py_TYPE(result)->tp_name);
13603  Py_DECREF(result);
13604  return NULL;
13605 }
13606 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
13607 #if CYTHON_USE_TYPE_SLOTS
13608  PyNumberMethods *m;
13609 #endif
13610  const char *name = NULL;
13611  PyObject *res = NULL;
13612 #if PY_MAJOR_VERSION < 3
13613  if (likely(PyInt_Check(x) || PyLong_Check(x)))
13614 #else
13615  if (likely(PyLong_Check(x)))
13616 #endif
13617  return __Pyx_NewRef(x);
13618 #if CYTHON_USE_TYPE_SLOTS
13619  m = Py_TYPE(x)->tp_as_number;
13620  #if PY_MAJOR_VERSION < 3
13621  if (m && m->nb_int) {
13622  name = "int";
13623  res = m->nb_int(x);
13624  }
13625  else if (m && m->nb_long) {
13626  name = "long";
13627  res = m->nb_long(x);
13628  }
13629  #else
13630  if (likely(m && m->nb_int)) {
13631  name = "int";
13632  res = m->nb_int(x);
13633  }
13634  #endif
13635 #else
13636  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
13637  res = PyNumber_Int(x);
13638  }
13639 #endif
13640  if (likely(res)) {
13641 #if PY_MAJOR_VERSION < 3
13642  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
13643 #else
13644  if (unlikely(!PyLong_CheckExact(res))) {
13645 #endif
13646  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
13647  }
13648  }
13649  else if (!PyErr_Occurred()) {
13650  PyErr_SetString(PyExc_TypeError,
13651  "an integer is required");
13652  }
13653  return res;
13654 }
13655 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
13656  Py_ssize_t ival;
13657  PyObject *x;
13658 #if PY_MAJOR_VERSION < 3
13659  if (likely(PyInt_CheckExact(b))) {
13660  if (sizeof(Py_ssize_t) >= sizeof(long))
13661  return PyInt_AS_LONG(b);
13662  else
13663  return PyInt_AsSsize_t(b);
13664  }
13665 #endif
13666  if (likely(PyLong_CheckExact(b))) {
13667  #if CYTHON_USE_PYLONG_INTERNALS
13668  const digit* digits = ((PyLongObject*)b)->ob_digit;
13669  const Py_ssize_t size = Py_SIZE(b);
13670  if (likely(__Pyx_sst_abs(size) <= 1)) {
13671  ival = likely(size) ? digits[0] : 0;
13672  if (size == -1) ival = -ival;
13673  return ival;
13674  } else {
13675  switch (size) {
13676  case 2:
13677  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
13678  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13679  }
13680  break;
13681  case -2:
13682  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
13683  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13684  }
13685  break;
13686  case 3:
13687  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
13688  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13689  }
13690  break;
13691  case -3:
13692  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
13693  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13694  }
13695  break;
13696  case 4:
13697  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
13698  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13699  }
13700  break;
13701  case -4:
13702  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
13703  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13704  }
13705  break;
13706  }
13707  }
13708  #endif
13709  return PyLong_AsSsize_t(b);
13710  }
13711  x = PyNumber_Index(b);
13712  if (!x) return -1;
13713  ival = PyInt_AsSsize_t(x);
13714  Py_DECREF(x);
13715  return ival;
13716 }
13717 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
13718  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
13719  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
13720 #if PY_MAJOR_VERSION < 3
13721  } else if (likely(PyInt_CheckExact(o))) {
13722  return PyInt_AS_LONG(o);
13723 #endif
13724  } else {
13725  Py_ssize_t ival;
13726  PyObject *x;
13727  x = PyNumber_Index(o);
13728  if (!x) return -1;
13729  ival = PyInt_AsLong(x);
13730  Py_DECREF(x);
13731  return ival;
13732  }
13733 }
13734 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
13735  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
13736 }
13737 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
13738  return PyInt_FromSize_t(ival);
13739 }
13740 
13741 
13742 #endif /* Py_PYTHON_H */
Mesh::nodeDiametersArray
double * nodeDiametersArray
Definition: mesh.h:69
Mesh::interiorElementBoundariesArray
int * interiorElementBoundariesArray
Definition: mesh.h:50
Mesh::elementBoundaryNodesArray
int * elementBoundaryNodesArray
Definition: mesh.h:47
MeshAdaptPUMI.h
Mesh::nodeArray
double * nodeArray
Definition: mesh.h:67
Mesh::nodeElementsArray
int * nodeElementsArray
Definition: mesh.h:43
Mesh::max_nElements_node
int max_nElements_node
Definition: mesh.h:38
Mesh::pz
int pz
Definition: mesh.h:64
Mesh::nodeElementOffsets
int * nodeElementOffsets
Definition: mesh.h:44
Mesh
Definition: mesh.h:28
Mesh::nEdges_global
int nEdges_global
Definition: mesh.h:39
Mesh::exteriorElementBoundariesArray
int * exteriorElementBoundariesArray
Definition: mesh.h:51
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
MeshAdaptPUMIDrvr
Class that handles the interface between SCOREC tools and Proteus.
Definition: MeshAdaptPUMI.h:19
s
Double s
Definition: Headers.h:84
Mesh::nodeStarOffsets
int * nodeStarOffsets
Definition: mesh.h:54
Mesh::volume
double volume
Definition: mesh.h:70
Mesh::nNodes_elementBoundary
int nNodes_elementBoundary
Definition: mesh.h:33
Mesh::nElementBoundaries_global
int nElementBoundaries_global
Definition: mesh.h:35
Mesh::hMin
double hMin
Definition: mesh.h:70
n
Int n
Definition: Headers.h:28
Mesh::nInteriorElementBoundaries_global
int nInteriorElementBoundaries_global
Definition: mesh.h:36
Mesh::ny
int ny
Definition: mesh.h:63
Mesh::nodeStarArray
int * nodeStarArray
Definition: mesh.h:53
Mesh::h
double h
Definition: mesh.h:70
Mesh::nNodes_element
int nNodes_element
Definition: mesh.h:32
Mesh::elementBoundaryLocalElementBoundariesArray
int * elementBoundaryLocalElementBoundariesArray
Definition: mesh.h:49
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
Mesh::elementBoundaryMaterialTypes
int * elementBoundaryMaterialTypes
Definition: mesh.h:56
Mesh::elementInnerDiametersArray
double * elementInnerDiametersArray
Definition: mesh.h:67
T
Double T
Definition: Headers.h:87
Mesh::V_KNOT
double * V_KNOT
Definition: mesh.h:62
z
Double * z
Definition: Headers.h:49
Mesh::elementNodesArray
int * elementNodesArray
Definition: mesh.h:42
u
Double u
Definition: Headers.h:89
Mesh::elementBoundaryBarycentersArray
double * elementBoundaryBarycentersArray
Definition: mesh.h:68
Mesh::py
int py
Definition: mesh.h:64
ns
Int ns
Definition: Headers.h:30
Mesh::nz
int nz
Definition: mesh.h:63
Mesh::elementBoundariesArray
int * elementBoundariesArray
Definition: mesh.h:46
Mesh::elementBarycentersArray
double * elementBarycentersArray
Definition: mesh.h:68
c
Double c
Definition: Headers.h:54
Mesh::nElements_global
int nElements_global
Definition: mesh.h:30
mesh.h
Mesh::nodeMaterialTypes
int * nodeMaterialTypes
Definition: mesh.h:57
Mesh::nElementBoundaries_element
int nElementBoundaries_element
Definition: mesh.h:34
Mesh::elementMaterialTypes
int * elementMaterialTypes
Definition: mesh.h:55
Mesh::elementDiametersArray
double * elementDiametersArray
Definition: mesh.h:67
Mesh::nNodes_global
int nNodes_global
Definition: mesh.h:31
Mesh::nExteriorElementBoundaries_global
int nExteriorElementBoundaries_global
Definition: mesh.h:37
Mesh::px
int px
Definition: mesh.h:64
Mesh::W_KNOT
double * W_KNOT
Definition: mesh.h:62
Mesh::elementIJK
int * elementIJK
Definition: mesh.h:60
Mesh::max_nNodeNeighbors_node
int max_nNodeNeighbors_node
Definition: mesh.h:40
Mesh::sigmaMax
double sigmaMax
Definition: mesh.h:70
Mesh::nodeSupportArray
double * nodeSupportArray
Definition: mesh.h:69
r
Double r
Definition: Headers.h:83
Mesh::weights
double * weights
Definition: mesh.h:61
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
Mesh::edgeNodesArray
int * edgeNodesArray
Definition: mesh.h:52
Mesh::nx
int nx
Definition: mesh.h:63
Mesh::elementBoundaryDiametersArray
double * elementBoundaryDiametersArray
Definition: mesh.h:67
Mesh::elementBoundaryElementsArray
int * elementBoundaryElementsArray
Definition: mesh.h:48
Mesh::elementNeighborsArray
int * elementNeighborsArray
Definition: mesh.h:45
Mesh::U_KNOT
double * U_KNOT
Definition: mesh.h:62