3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
8 #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10 #error Cython requires Python 2.6+ or Python 3.3+.
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
49 #define CYTHON_COMPILING_IN_PYPY 1
50 #define CYTHON_COMPILING_IN_PYSTON 0
51 #define CYTHON_COMPILING_IN_CPYTHON 0
52 #undef CYTHON_USE_TYPE_SLOTS
53 #define CYTHON_USE_TYPE_SLOTS 0
54 #undef CYTHON_USE_PYTYPE_LOOKUP
55 #define CYTHON_USE_PYTYPE_LOOKUP 0
56 #if PY_VERSION_HEX < 0x03050000
57 #undef CYTHON_USE_ASYNC_SLOTS
58 #define CYTHON_USE_ASYNC_SLOTS 0
59 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60 #define CYTHON_USE_ASYNC_SLOTS 1
62 #undef CYTHON_USE_PYLIST_INTERNALS
63 #define CYTHON_USE_PYLIST_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_INTERNALS
65 #define CYTHON_USE_UNICODE_INTERNALS 0
66 #undef CYTHON_USE_UNICODE_WRITER
67 #define CYTHON_USE_UNICODE_WRITER 0
68 #undef CYTHON_USE_PYLONG_INTERNALS
69 #define CYTHON_USE_PYLONG_INTERNALS 0
70 #undef CYTHON_AVOID_BORROWED_REFS
71 #define CYTHON_AVOID_BORROWED_REFS 1
72 #undef CYTHON_ASSUME_SAFE_MACROS
73 #define CYTHON_ASSUME_SAFE_MACROS 0
74 #undef CYTHON_UNPACK_METHODS
75 #define CYTHON_UNPACK_METHODS 0
76 #undef CYTHON_FAST_THREAD_STATE
77 #define CYTHON_FAST_THREAD_STATE 0
78 #undef CYTHON_FAST_PYCALL
79 #define CYTHON_FAST_PYCALL 0
80 #undef CYTHON_PEP489_MULTI_PHASE_INIT
81 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82 #undef CYTHON_USE_TP_FINALIZE
83 #define CYTHON_USE_TP_FINALIZE 0
84 #undef CYTHON_USE_DICT_VERSIONS
85 #define CYTHON_USE_DICT_VERSIONS 0
86 #undef CYTHON_USE_EXC_INFO_STACK
87 #define CYTHON_USE_EXC_INFO_STACK 0
88 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
91 #elif defined(PYSTON_VERSION)
92 #define CYTHON_COMPILING_IN_PYPY 0
93 #define CYTHON_COMPILING_IN_PYSTON 1
94 #define CYTHON_COMPILING_IN_CPYTHON 0
95 #ifndef CYTHON_USE_TYPE_SLOTS
96 #define CYTHON_USE_TYPE_SLOTS 1
98 #undef CYTHON_USE_PYTYPE_LOOKUP
99 #define CYTHON_USE_PYTYPE_LOOKUP 0
100 #undef CYTHON_USE_ASYNC_SLOTS
101 #define CYTHON_USE_ASYNC_SLOTS 0
102 #undef CYTHON_USE_PYLIST_INTERNALS
103 #define CYTHON_USE_PYLIST_INTERNALS 0
104 #ifndef CYTHON_USE_UNICODE_INTERNALS
105 #define CYTHON_USE_UNICODE_INTERNALS 1
107 #undef CYTHON_USE_UNICODE_WRITER
108 #define CYTHON_USE_UNICODE_WRITER 0
109 #undef CYTHON_USE_PYLONG_INTERNALS
110 #define CYTHON_USE_PYLONG_INTERNALS 0
111 #ifndef CYTHON_AVOID_BORROWED_REFS
112 #define CYTHON_AVOID_BORROWED_REFS 0
114 #ifndef CYTHON_ASSUME_SAFE_MACROS
115 #define CYTHON_ASSUME_SAFE_MACROS 1
117 #ifndef CYTHON_UNPACK_METHODS
118 #define CYTHON_UNPACK_METHODS 1
120 #undef CYTHON_FAST_THREAD_STATE
121 #define CYTHON_FAST_THREAD_STATE 0
122 #undef CYTHON_FAST_PYCALL
123 #define CYTHON_FAST_PYCALL 0
124 #undef CYTHON_PEP489_MULTI_PHASE_INIT
125 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126 #undef CYTHON_USE_TP_FINALIZE
127 #define CYTHON_USE_TP_FINALIZE 0
128 #undef CYTHON_USE_DICT_VERSIONS
129 #define CYTHON_USE_DICT_VERSIONS 0
130 #undef CYTHON_USE_EXC_INFO_STACK
131 #define CYTHON_USE_EXC_INFO_STACK 0
132 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
136 #define CYTHON_COMPILING_IN_PYPY 0
137 #define CYTHON_COMPILING_IN_PYSTON 0
138 #define CYTHON_COMPILING_IN_CPYTHON 1
139 #ifndef CYTHON_USE_TYPE_SLOTS
140 #define CYTHON_USE_TYPE_SLOTS 1
142 #if PY_VERSION_HEX < 0x02070000
143 #undef CYTHON_USE_PYTYPE_LOOKUP
144 #define CYTHON_USE_PYTYPE_LOOKUP 0
145 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146 #define CYTHON_USE_PYTYPE_LOOKUP 1
148 #if PY_MAJOR_VERSION < 3
149 #undef CYTHON_USE_ASYNC_SLOTS
150 #define CYTHON_USE_ASYNC_SLOTS 0
151 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152 #define CYTHON_USE_ASYNC_SLOTS 1
154 #if PY_VERSION_HEX < 0x02070000
155 #undef CYTHON_USE_PYLONG_INTERNALS
156 #define CYTHON_USE_PYLONG_INTERNALS 0
157 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158 #define CYTHON_USE_PYLONG_INTERNALS 1
160 #ifndef CYTHON_USE_PYLIST_INTERNALS
161 #define CYTHON_USE_PYLIST_INTERNALS 1
163 #ifndef CYTHON_USE_UNICODE_INTERNALS
164 #define CYTHON_USE_UNICODE_INTERNALS 1
166 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167 #undef CYTHON_USE_UNICODE_WRITER
168 #define CYTHON_USE_UNICODE_WRITER 0
169 #elif !defined(CYTHON_USE_UNICODE_WRITER)
170 #define CYTHON_USE_UNICODE_WRITER 1
172 #ifndef CYTHON_AVOID_BORROWED_REFS
173 #define CYTHON_AVOID_BORROWED_REFS 0
175 #ifndef CYTHON_ASSUME_SAFE_MACROS
176 #define CYTHON_ASSUME_SAFE_MACROS 1
178 #ifndef CYTHON_UNPACK_METHODS
179 #define CYTHON_UNPACK_METHODS 1
181 #if PY_VERSION_HEX >= 0x030B00A4
182 #undef CYTHON_FAST_THREAD_STATE
183 #define CYTHON_FAST_THREAD_STATE 0
184 #elif !defined(CYTHON_FAST_THREAD_STATE)
185 #define CYTHON_FAST_THREAD_STATE 1
187 #ifndef CYTHON_FAST_PYCALL
188 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
190 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
193 #ifndef CYTHON_USE_TP_FINALIZE
194 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
196 #ifndef CYTHON_USE_DICT_VERSIONS
197 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
199 #if PY_VERSION_HEX >= 0x030B00A4
200 #undef CYTHON_USE_EXC_INFO_STACK
201 #define CYTHON_USE_EXC_INFO_STACK 0
202 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
212 #if CYTHON_USE_PYLONG_INTERNALS
213 #if PY_MAJOR_VERSION < 3
214 #include "longintrepr.h"
220 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
223 #ifndef __has_attribute
224 #define __has_attribute(x) 0
226 #ifndef __has_cpp_attribute
227 #define __has_cpp_attribute(x) 0
229 #ifndef CYTHON_RESTRICT
230 #if defined(__GNUC__)
231 #define CYTHON_RESTRICT __restrict__
232 #elif defined(_MSC_VER) && _MSC_VER >= 1400
233 #define CYTHON_RESTRICT __restrict
234 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235 #define CYTHON_RESTRICT restrict
237 #define CYTHON_RESTRICT
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
245 # define CYTHON_UNUSED
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
250 # define CYTHON_UNUSED
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
269 #ifndef _MSC_STDINT_H_
271 typedef unsigned char uint8_t;
272 typedef unsigned int uint32_t;
274 typedef unsigned __int8 uint8_t;
275 typedef unsigned __int32 uint32_t;
281 #ifndef CYTHON_FALLTHROUGH
282 #if defined(__cplusplus) && __cplusplus >= 201103L
283 #if __has_cpp_attribute(fallthrough)
284 #define CYTHON_FALLTHROUGH [[fallthrough]]
285 #elif __has_cpp_attribute(clang::fallthrough)
286 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287 #elif __has_cpp_attribute(gnu::fallthrough)
288 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
291 #ifndef CYTHON_FALLTHROUGH
292 #if __has_attribute(fallthrough)
293 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
295 #define CYTHON_FALLTHROUGH
298 #if defined(__clang__ ) && defined(__apple_build_version__)
299 #if __apple_build_version__ < 7000000
300 #undef CYTHON_FALLTHROUGH
301 #define CYTHON_FALLTHROUGH
307 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
309 #ifndef CYTHON_INLINE
310 #if defined(__clang__)
311 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
313 #define CYTHON_INLINE inline
317 void __Pyx_call_destructor(
T& x) {
321 class __Pyx_FakeReference {
323 __Pyx_FakeReference() : ptr(NULL) { }
324 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<
T*>(&ref)) { }
325 T *operator->() {
return ptr; }
326 T *operator&() {
return ptr; }
327 operator T&() {
return *ptr; }
328 template<
typename U>
bool operator ==(
U other) {
return *ptr == other; }
329 template<
typename U>
bool operator !=(
U other) {
return *ptr != other; }
334 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
335 #define Py_OptimizeFlag 0
337 #define __PYX_BUILD_PY_SSIZE_T "n"
338 #define CYTHON_FORMAT_SSIZE_T "z"
339 #if PY_MAJOR_VERSION < 3
340 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
341 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
342 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
343 #define __Pyx_DefaultClassType PyClass_Type
345 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
346 #define __Pyx_DefaultClassType PyType_Type
347 #if PY_VERSION_HEX >= 0x030B00A1
348 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
349 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
350 PyObject *fv, PyObject *cell, PyObject* fn,
351 PyObject *name,
int fline, PyObject *lnos) {
352 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
353 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
354 const char *fn_cstr=NULL;
355 const char *name_cstr=NULL;
356 PyCodeObject* co=NULL;
357 PyObject *type, *value, *traceback;
358 PyErr_Fetch(&type, &value, &traceback);
359 if (!(kwds=PyDict_New()))
goto end;
360 if (!(argcount=PyLong_FromLong(a)))
goto end;
361 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
362 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
363 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
364 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
365 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
366 if (!(nlocals=PyLong_FromLong(l)))
goto end;
367 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
368 if (!(stacksize=PyLong_FromLong(
s)))
goto end;
369 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
370 if (!(flags=PyLong_FromLong(
f)))
goto end;
371 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
372 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
373 if (PyDict_SetItemString(kwds,
"co_consts",
c) != 0)
goto end;
374 if (PyDict_SetItemString(kwds,
"co_names",
n) != 0)
goto end;
375 if (PyDict_SetItemString(kwds,
"co_varnames",
v) != 0)
goto end;
376 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
377 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
378 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
379 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
380 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
381 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
382 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
383 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
384 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
385 Py_XDECREF((PyObject*)co);
386 co = (PyCodeObject*)call_result;
390 Py_XDECREF((PyObject*)co);
395 Py_XDECREF(argcount);
396 Py_XDECREF(posonlyargcount);
397 Py_XDECREF(kwonlyargcount);
399 Py_XDECREF(stacksize);
401 Py_XDECREF(call_result);
404 PyErr_Restore(type, value, traceback);
409 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
410 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
412 #define __Pyx_DefaultClassType PyType_Type
414 #ifndef Py_TPFLAGS_CHECKTYPES
415 #define Py_TPFLAGS_CHECKTYPES 0
417 #ifndef Py_TPFLAGS_HAVE_INDEX
418 #define Py_TPFLAGS_HAVE_INDEX 0
420 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
421 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
423 #ifndef Py_TPFLAGS_HAVE_FINALIZE
424 #define Py_TPFLAGS_HAVE_FINALIZE 0
426 #ifndef METH_STACKLESS
427 #define METH_STACKLESS 0
429 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
430 #ifndef METH_FASTCALL
431 #define METH_FASTCALL 0x80
433 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
434 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
435 Py_ssize_t nargs, PyObject *kwnames);
437 #define __Pyx_PyCFunctionFast _PyCFunctionFast
438 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
440 #if CYTHON_FAST_PYCCALL
441 #define __Pyx_PyFastCFunction_Check(func)\
442 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
444 #define __Pyx_PyFastCFunction_Check(func) 0
446 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
447 #define PyObject_Malloc(s) PyMem_Malloc(s)
448 #define PyObject_Free(p) PyMem_Free(p)
449 #define PyObject_Realloc(p) PyMem_Realloc(p)
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
452 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
453 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
454 #define PyMem_RawFree(p) PyMem_Free(p)
456 #if CYTHON_COMPILING_IN_PYSTON
457 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
458 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
460 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
461 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
463 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
464 #define __Pyx_PyThreadState_Current PyThreadState_GET()
465 #elif PY_VERSION_HEX >= 0x03060000
466 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
467 #elif PY_VERSION_HEX >= 0x03000000
468 #define __Pyx_PyThreadState_Current PyThreadState_GET()
470 #define __Pyx_PyThreadState_Current _PyThreadState_Current
472 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
473 #include "pythread.h"
474 #define Py_tss_NEEDS_INIT 0
475 typedef int Py_tss_t;
476 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
477 *key = PyThread_create_key();
480 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
481 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
482 *key = Py_tss_NEEDS_INIT;
485 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
488 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
489 return *key != Py_tss_NEEDS_INIT;
491 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
492 PyThread_delete_key(*key);
493 *key = Py_tss_NEEDS_INIT;
495 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
496 return PyThread_set_key_value(*key, value);
498 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
499 return PyThread_get_key_value(*key);
502 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
503 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
505 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
507 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
508 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
509 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
511 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
512 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
514 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
515 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
517 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
519 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
520 #define CYTHON_PEP393_ENABLED 1
521 #if defined(PyUnicode_IS_READY)
522 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
523 0 : _PyUnicode_Ready((PyObject *)(op)))
525 #define __Pyx_PyUnicode_READY(op) (0)
527 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
528 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
529 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
530 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
531 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
532 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
533 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
534 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
535 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
536 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
538 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
541 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
544 #define CYTHON_PEP393_ENABLED 0
545 #define PyUnicode_1BYTE_KIND 1
546 #define PyUnicode_2BYTE_KIND 2
547 #define PyUnicode_4BYTE_KIND 4
548 #define __Pyx_PyUnicode_READY(op) (0)
549 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
550 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
551 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
552 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
553 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
554 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
555 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
556 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
558 #if CYTHON_COMPILING_IN_PYPY
559 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
560 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
562 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
563 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
564 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
566 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
567 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
569 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
570 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
572 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
573 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
575 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
576 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
577 #if PY_MAJOR_VERSION >= 3
578 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
580 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
582 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
583 #define PyObject_ASCII(o) PyObject_Repr(o)
585 #if PY_MAJOR_VERSION >= 3
586 #define PyBaseString_Type PyUnicode_Type
587 #define PyStringObject PyUnicodeObject
588 #define PyString_Type PyUnicode_Type
589 #define PyString_Check PyUnicode_Check
590 #define PyString_CheckExact PyUnicode_CheckExact
591 #ifndef PyObject_Unicode
592 #define PyObject_Unicode PyObject_Str
595 #if PY_MAJOR_VERSION >= 3
596 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
597 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
599 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
600 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
602 #ifndef PySet_CheckExact
603 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
605 #if PY_VERSION_HEX >= 0x030900A4
606 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
607 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
609 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
610 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
612 #if CYTHON_ASSUME_SAFE_MACROS
613 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
615 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
617 #if PY_MAJOR_VERSION >= 3
618 #define PyIntObject PyLongObject
619 #define PyInt_Type PyLong_Type
620 #define PyInt_Check(op) PyLong_Check(op)
621 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
622 #define PyInt_FromString PyLong_FromString
623 #define PyInt_FromUnicode PyLong_FromUnicode
624 #define PyInt_FromLong PyLong_FromLong
625 #define PyInt_FromSize_t PyLong_FromSize_t
626 #define PyInt_FromSsize_t PyLong_FromSsize_t
627 #define PyInt_AsLong PyLong_AsLong
628 #define PyInt_AS_LONG PyLong_AS_LONG
629 #define PyInt_AsSsize_t PyLong_AsSsize_t
630 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
631 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
632 #define PyNumber_Int PyNumber_Long
634 #if PY_MAJOR_VERSION >= 3
635 #define PyBoolObject PyLongObject
637 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
638 #ifndef PyUnicode_InternFromString
639 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
642 #if PY_VERSION_HEX < 0x030200A4
643 typedef long Py_hash_t;
644 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
645 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
647 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
648 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
650 #if PY_MAJOR_VERSION >= 3
651 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
653 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
655 #if CYTHON_USE_ASYNC_SLOTS
656 #if PY_VERSION_HEX >= 0x030500B1
657 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
658 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
660 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
663 #define __Pyx_PyType_AsAsync(obj) NULL
665 #ifndef __Pyx_PyAsyncMethodsStruct
670 } __Pyx_PyAsyncMethodsStruct;
673 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
674 #if !defined(_USE_MATH_DEFINES)
675 #define _USE_MATH_DEFINES
680 #define __PYX_NAN() ((float) NAN)
682 static CYTHON_INLINE
float __PYX_NAN() {
684 memset(&value, 0xFF,
sizeof(value));
688 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
689 #define __Pyx_truncl trunc
691 #define __Pyx_truncl truncl
694 #define __PYX_MARK_ERR_POS(f_index, lineno) \
695 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
696 #define __PYX_ERR(f_index, lineno, Ln_error) \
697 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
699 #ifndef __PYX_EXTERN_C
701 #define __PYX_EXTERN_C extern "C"
703 #define __PYX_EXTERN_C extern
707 #define __PYX_HAVE__MeshAdaptPUMI__MeshAdapt
708 #define __PYX_HAVE_API__MeshAdaptPUMI__MeshAdapt
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"
732 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
733 #define CYTHON_WITHOUT_ASSERTIONS
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;
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;
760 #if defined (__cplusplus) && __cplusplus >= 201103L
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)
774 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
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
787 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
788 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
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;
809 return (
size_t)(u_end -
u - 1);
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))
828 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
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))
834 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
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) {
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");
847 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
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;
855 char ascii_chars[128];
857 for (
c = 0;
c < 128;
c++) {
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) {
867 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
871 Py_DECREF(ascii_chars_u);
872 Py_DECREF(ascii_chars_b);
874 Py_DECREF(default_encoding);
877 Py_XDECREF(default_encoding);
878 Py_XDECREF(ascii_chars_u);
879 Py_XDECREF(ascii_chars_b);
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)
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) {
891 PyObject* default_encoding = NULL;
892 char* default_encoding_c;
893 sys = PyImport_ImportModule(
"sys");
895 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
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);
906 Py_XDECREF(default_encoding);
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)
918 #define likely(x) (x)
919 #define unlikely(x) (x)
921 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
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;
936 #if !defined(CYTHON_CCOMPLEX)
937 #if defined(__cplusplus)
938 #define CYTHON_CCOMPLEX 1
939 #elif defined(_Complex_I)
940 #define CYTHON_CCOMPLEX 1
942 #define CYTHON_CCOMPLEX 0
952 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
954 #define _Complex_I 1.0fj
958 static const char *__pyx_f[] = {
960 "proteus/MeshAdaptPUMI/MeshAdapt.pyx",
963 "proteus/cmeshTools.pxd",
966 #define IS_UNSIGNED(type) (((type) -1) > 0)
967 struct __Pyx_StructField_;
968 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
971 struct __Pyx_StructField_* fields;
979 typedef struct __Pyx_StructField_ {
980 __Pyx_TypeInfo* type;
985 __Pyx_StructField* field;
986 size_t parent_offset;
987 } __Pyx_BufFmt_StackElem;
989 __Pyx_StructField root;
990 __Pyx_BufFmt_StackElem* head;
992 size_t new_count, enc_count;
993 size_t struct_alignment;
999 } __Pyx_BufFmt_Context;
1009 typedef npy_int8 __pyx_t_5numpy_int8_t;
1018 typedef npy_int16 __pyx_t_5numpy_int16_t;
1027 typedef npy_int32 __pyx_t_5numpy_int32_t;
1036 typedef npy_int64 __pyx_t_5numpy_int64_t;
1045 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1054 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1063 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1072 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1081 typedef npy_float32 __pyx_t_5numpy_float32_t;
1090 typedef npy_float64 __pyx_t_5numpy_float64_t;
1099 typedef npy_long __pyx_t_5numpy_int_t;
1108 typedef npy_longlong __pyx_t_5numpy_long_t;
1117 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1126 typedef npy_ulong __pyx_t_5numpy_uint_t;
1135 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1144 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1153 typedef npy_intp __pyx_t_5numpy_intp_t;
1162 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1171 typedef npy_double __pyx_t_5numpy_float_t;
1180 typedef npy_double __pyx_t_5numpy_double_t;
1189 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1193 typedef ::std::complex< float > __pyx_t_float_complex;
1195 typedef float _Complex __pyx_t_float_complex;
1198 typedef struct {
float real, imag; } __pyx_t_float_complex;
1200 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1205 typedef ::std::complex< double > __pyx_t_double_complex;
1207 typedef double _Complex __pyx_t_double_complex;
1210 typedef struct {
double real, imag; } __pyx_t_double_complex;
1212 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1216 struct __pyx_obj_7proteus_10cmeshTools_CMesh;
1217 struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt;
1226 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1235 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1244 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
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;
1267 struct __pyx_obj_7proteus_10cmeshTools_CMesh {
1330 struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt {
1338 int isReconstructed;
1345 #ifndef CYTHON_REFNANNY
1346 #define CYTHON_REFNANNY 0
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;
1361 #define __Pyx_RefNannySetupContext(name, 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);\
1367 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1370 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1371 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
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)
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)
1396 #define __Pyx_XDECREF_SET(r, v) do {\
1397 PyObject *tmp = (PyObject *) r;\
1398 r = v; __Pyx_XDECREF(tmp);\
1400 #define __Pyx_DECREF_SET(r, v) do {\
1401 PyObject *tmp = (PyObject *) r;\
1402 r = v; __Pyx_DECREF(tmp);\
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)
1408 #if CYTHON_USE_TYPE_SLOTS
1409 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1411 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1415 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
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);
1422 static int __Pyx_CheckKeywordStrings(PyObject *kwdict,
const char* function_name,
int kw_allowed);
1425 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
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);
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);
1439 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
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);
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 };
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;\
1472 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1473 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
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);
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);
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);\
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);\
1499 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
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);
1507 #if CYTHON_FAST_PYCCALL
1508 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1510 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
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);
1520 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
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)
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
1534 #include "internal/pycore_frame.h"
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
1545 #if CYTHON_COMPILING_IN_CPYTHON
1546 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1548 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1552 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1555 #if CYTHON_COMPILING_IN_CPYTHON
1556 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1560 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1563 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1566 static void __Pyx_RaiseBufferFallbackError(
void);
1569 static void __Pyx_RaiseBufferIndexError(
int axis);
1571 #define __Pyx_BufPtrCContig1d(type, buf, i0, s0) ((type)buf + i0)
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
1578 #define __Pyx_PyThreadState_declare
1579 #define __Pyx_PyThreadState_assign
1580 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
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))
1595 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
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)
1608 #define __Pyx_BufPtrCContig2d(type, buf, i0, s0, i1, s1) ((type)((char*)buf + i0 * s0) + i1)
1610 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
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);
1617 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1618 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1622 #if CYTHON_USE_EXC_INFO_STACK
1623 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
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);
1633 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1634 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
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);
1642 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
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);
1650 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
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);
1657 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
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);
1664 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1668 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1671 static int __Pyx_setup_reduce(PyObject* type_obj);
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
1681 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
1685 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1688 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1691 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
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)
1707 PyCFunctionObject func;
1708 #if PY_VERSION_HEX < 0x030500A0
1709 PyObject *func_weakreflist;
1711 PyObject *func_dict;
1712 PyObject *func_name;
1713 PyObject *func_qualname;
1715 PyObject *func_globals;
1716 PyObject *func_code;
1717 PyObject *func_closure;
1718 PyObject *func_classobj;
1720 int defaults_pyobjects;
1721 size_t defaults_size;
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,
1733 PyObject *module, PyObject *globals,
1735 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1738 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1740 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1742 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1744 static int __pyx_CyFunction_init(
void);
1747 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
1748 int flags, PyObject* qualname,
1750 PyObject *module, PyObject *globals,
1754 #if CYTHON_COMPILING_IN_CPYTHON
1755 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1757 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
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))
1768 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1772 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
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);
1781 #ifdef CYTHON_CLINE_IN_TRACEBACK
1782 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1784 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1789 PyCodeObject* code_object;
1791 } __Pyx_CodeObjectCacheEntry;
1792 struct __Pyx_CodeObjectCache {
1795 __Pyx_CodeObjectCacheEntry* entries;
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);
1803 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1804 int py_line,
const char *filename);
1808 Py_ssize_t shape, strides, suboffsets;
1809 } __Pyx_Buf_DimInfo;
1815 __Pyx_Buffer *rcbuffer;
1817 __Pyx_Buf_DimInfo diminfo[8];
1818 } __Pyx_LocalBuf_ND;
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);
1824 #define __Pyx_GetBuffer PyObject_GetBuffer
1825 #define __Pyx_ReleaseBuffer PyBuffer_Release
1830 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1831 #define __Pyx_HAS_GCC_DIAGNOSTIC
1835 #ifndef __Pyx_CppExn2PyErr
1838 #include <stdexcept>
1840 static void __Pyx_CppExn2PyErr() {
1842 if (PyErr_Occurred())
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());
1871 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1879 #define __Pyx_CREAL(z) ((z).real())
1880 #define __Pyx_CIMAG(z) ((z).imag())
1882 #define __Pyx_CREAL(z) (__real__(z))
1883 #define __Pyx_CIMAG(z) (__imag__(z))
1886 #define __Pyx_CREAL(z) ((z).real)
1887 #define __Pyx_CIMAG(z) ((z).imag)
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))
1894 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1895 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
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))
1907 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1908 #define __Pyx_c_conj_float(z) (::std::conj(z))
1910 #define __Pyx_c_abs_float(z) (::std::abs(z))
1911 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1914 #define __Pyx_c_is_zero_float(z) ((z)==0)
1915 #define __Pyx_c_conj_float(z) (conjf(z))
1917 #define __Pyx_c_abs_float(z) (cabsf(z))
1918 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
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);
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);
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))
1945 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1946 #define __Pyx_c_conj_double(z) (::std::conj(z))
1948 #define __Pyx_c_abs_double(z) (::std::abs(z))
1949 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1952 #define __Pyx_c_is_zero_double(z) ((z)==0)
1953 #define __Pyx_c_conj_double(z) (conj(z))
1955 #define __Pyx_c_abs_double(z) (cabs(z))
1956 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
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);
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);
1975 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1978 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1981 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1984 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
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);
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))
1997 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2000 static int __Pyx_check_binary_version(
void);
2003 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2013 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
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;
2051 static PyTypeObject *__pyx_ptype_7proteus_10cmeshTools_CMesh = 0;
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 &);
2060 static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string
const &);
2061 static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string
const &);
2062 static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string
const &);
2063 static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string
const &);
2064 static std::string __pyx_convert_string_from_py_std__in_string(PyObject *);
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;
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);
2243 static void __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_2__dealloc__(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
2244 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_4size_field_config(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
2245 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_6adapt_type_config(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
2246 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_8numIter(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
2247 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_10adaptMesh(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
2248 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_12numAdaptSteps(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
2249 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_14nAdapt(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
2250 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_16set_nAdapt(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_numberAdapt);
2251 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_18isReconstructed(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
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);
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);
2254 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_24updateSphereCoordinates(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyArrayObject *__pyx_v_sphereCenter);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
2265 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_46setAdaptProperties(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_manager);
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);
2267 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_50adaptPUMIMesh(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_inputString);
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);
2269 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_54getERMSizeField(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_err_total);
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);
2271 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_58willAdapt(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
2272 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_60willInterfaceAdapt(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
2273 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_62get_local_error(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
2274 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_64get_VMS_error(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
2275 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_66getMinimumQuality(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
2276 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_68writeMesh(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self, PyObject *__pyx_v_meshName);
2277 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_70cleanMesh(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
2278 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_72__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self);
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);
2280 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt___defaults__(CYTHON_UNUSED PyObject *__pyx_self);
2281 static PyObject *__pyx_pf_13MeshAdaptPUMI_9MeshAdapt_12AdaptManager___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_adapter);
2282 static PyObject *__pyx_tp_new_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt(PyTypeObject *t, PyObject *a, PyObject *k);
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;
2308 static int __pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2309 static int __pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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));
2319 __Pyx_RefNannyFinishContext();
2323 static int __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt___cinit__(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt *__pyx_v_self) {
2325 __Pyx_RefNannyDeclarations
2326 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2347 __Pyx_RefNannyFinishContext();
2360 static void __pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_3__dealloc__(PyObject *__pyx_v_self);
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));
2367 __Pyx_RefNannyFinishContext();
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);
2381 delete __pyx_v_self->thisptr;
2392 __Pyx_RefNannyFinishContext();
2404 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_5size_field_config(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
2412 __Pyx_RefNannyFinishContext();
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);
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;
2449 __Pyx_XDECREF(__pyx_t_1);
2450 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.size_field_config", __pyx_clineno, __pyx_lineno, __pyx_filename);
2453 __Pyx_XGIVEREF(__pyx_r);
2454 __Pyx_RefNannyFinishContext();
2467 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_7adapt_type_config(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
2475 __Pyx_RefNannyFinishContext();
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);
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;
2512 __Pyx_XDECREF(__pyx_t_1);
2513 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.adapt_type_config", __pyx_clineno, __pyx_lineno, __pyx_filename);
2516 __Pyx_XGIVEREF(__pyx_r);
2517 __Pyx_RefNannyFinishContext();
2530 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_9numIter(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
2538 __Pyx_RefNannyFinishContext();
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);
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;
2575 __Pyx_XDECREF(__pyx_t_1);
2576 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.numIter", __pyx_clineno, __pyx_lineno, __pyx_filename);
2579 __Pyx_XGIVEREF(__pyx_r);
2580 __Pyx_RefNannyFinishContext();
2593 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_11adaptMesh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
2601 __Pyx_RefNannyFinishContext();
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);
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;
2638 __Pyx_XDECREF(__pyx_t_1);
2639 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.adaptMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
2642 __Pyx_XGIVEREF(__pyx_r);
2643 __Pyx_RefNannyFinishContext();
2656 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_13numAdaptSteps(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
2664 __Pyx_RefNannyFinishContext();
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);
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;
2701 __Pyx_XDECREF(__pyx_t_1);
2702 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.numAdaptSteps", __pyx_clineno, __pyx_lineno, __pyx_filename);
2705 __Pyx_XGIVEREF(__pyx_r);
2706 __Pyx_RefNannyFinishContext();
2719 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_15nAdapt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
2727 __Pyx_RefNannyFinishContext();
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);
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;
2764 __Pyx_XDECREF(__pyx_t_1);
2765 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.nAdapt", __pyx_clineno, __pyx_lineno, __pyx_filename);
2768 __Pyx_XGIVEREF(__pyx_r);
2769 __Pyx_RefNannyFinishContext();
2782 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_17set_nAdapt(PyObject *__pyx_v_self, PyObject *__pyx_v_numberAdapt);
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));
2790 __Pyx_RefNannyFinishContext();
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
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);
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;
2829 __Pyx_XDECREF(__pyx_t_2);
2830 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.set_nAdapt", __pyx_clineno, __pyx_lineno, __pyx_filename);
2833 __Pyx_XGIVEREF(__pyx_r);
2834 __Pyx_RefNannyFinishContext();
2847 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_19isReconstructed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
2855 __Pyx_RefNannyFinishContext();
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);
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;
2892 __Pyx_XDECREF(__pyx_t_1);
2893 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.isReconstructed", __pyx_clineno, __pyx_lineno, __pyx_filename);
2896 __Pyx_XGIVEREF(__pyx_r);
2897 __Pyx_RefNannyFinishContext();
2910 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_21loadModelAndMesh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
2925 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2927 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2929 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2932 default:
goto __pyx_L5_argtuple_error;
2934 kw_args = PyDict_Size(__pyx_kwds);
2937 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_geomName)) != 0)) kw_args--;
2938 else goto __pyx_L5_argtuple_error;
2941 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meshName)) != 0)) kw_args--;
2943 __Pyx_RaiseArgtupleInvalid(
"loadModelAndMesh", 1, 2, 2, 1); __PYX_ERR(1, 82, __pyx_L3_error)
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)
2949 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2950 goto __pyx_L5_argtuple_error;
2952 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2953 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2955 __pyx_v_geomName = values[0];
2956 __pyx_v_meshName = values[1];
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)
2962 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.loadModelAndMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
2963 __Pyx_RefNannyFinishContext();
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);
2969 __Pyx_RefNannyFinishContext();
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
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);
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;
3010 __Pyx_XDECREF(__pyx_t_3);
3011 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.loadModelAndMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
3014 __Pyx_XGIVEREF(__pyx_r);
3015 __Pyx_RefNannyFinishContext();
3028 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_23loadMeshForAnalytic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
3045 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3047 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3049 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3051 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3053 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3056 default:
goto __pyx_L5_argtuple_error;
3058 kw_args = PyDict_Size(__pyx_kwds);
3061 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meshName)) != 0)) kw_args--;
3062 else goto __pyx_L5_argtuple_error;
3065 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boxDim)) != 0)) kw_args--;
3067 __Pyx_RaiseArgtupleInvalid(
"loadMeshForAnalytic", 1, 4, 4, 1); __PYX_ERR(1, 84, __pyx_L3_error)
3071 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sphereCenter)) != 0)) kw_args--;
3073 __Pyx_RaiseArgtupleInvalid(
"loadMeshForAnalytic", 1, 4, 4, 2); __PYX_ERR(1, 84, __pyx_L3_error)
3077 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sphereRadius)) != 0)) kw_args--;
3079 __Pyx_RaiseArgtupleInvalid(
"loadMeshForAnalytic", 1, 4, 4, 3); __PYX_ERR(1, 84, __pyx_L3_error)
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)
3085 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3086 goto __pyx_L5_argtuple_error;
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);
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)
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)
3102 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.loadMeshForAnalytic", __pyx_clineno, __pyx_lineno, __pyx_filename);
3103 __Pyx_RefNannyFinishContext();
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);
3115 __Pyx_RefNannyFinishContext();
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;
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;
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;
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)
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];
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)
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];
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;
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);
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);
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();
3204 PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3206 __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
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)
3212 __Pyx_DECREF_SET(__pyx_v_boxDim, ((PyArrayObject *)__pyx_t_1));
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;
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);
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);
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();
3254 PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
3256 __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
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)
3262 __Pyx_DECREF_SET(__pyx_v_sphereCenter, ((PyArrayObject *)__pyx_t_1));
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);
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);
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;
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)
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)
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)
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;
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);
3359 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_boxDim.rcbuffer->pybuffer);
3360 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer);
3362 __Pyx_XDECREF((PyObject *)__pyx_v_boxDim);
3363 __Pyx_XDECREF((PyObject *)__pyx_v_sphereCenter);
3364 __Pyx_XGIVEREF(__pyx_r);
3365 __Pyx_RefNannyFinishContext();
3378 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_25updateSphereCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_v_sphereCenter);
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));
3394 __Pyx_RefNannyFinishContext();
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;
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;
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)
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];
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;
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);
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);
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();
3466 PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3468 __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
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)
3474 __Pyx_DECREF_SET(__pyx_v_sphereCenter, ((PyArrayObject *)__pyx_t_1));
3484 __Pyx_XDECREF(__pyx_r);
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)
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;
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);
3524 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sphereCenter.rcbuffer->pybuffer);
3526 __Pyx_XDECREF((PyObject *)__pyx_v_sphereCenter);
3527 __Pyx_XGIVEREF(__pyx_r);
3528 __Pyx_RefNannyFinishContext();
3541 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_27reconstructFromProteus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
3558 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3560 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3562 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3564 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3567 default:
goto __pyx_L5_argtuple_error;
3569 kw_args = PyDict_Size(__pyx_kwds);
3572 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3573 else goto __pyx_L5_argtuple_error;
3576 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_global_cmesh)) != 0)) kw_args--;
3578 __Pyx_RaiseArgtupleInvalid(
"reconstructFromProteus", 0, 2, 3, 1); __PYX_ERR(1, 92, __pyx_L3_error)
3583 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasModel);
3584 if (value) { values[2] = value; kw_args--; }
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)
3591 switch (PyTuple_GET_SIZE(__pyx_args)) {
3592 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3594 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3595 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3597 default:
goto __pyx_L5_argtuple_error;
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];
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)
3608 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.reconstructFromProteus", __pyx_clineno, __pyx_lineno, __pyx_filename);
3609 __Pyx_RefNannyFinishContext();
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);
3621 __Pyx_RefNannyFinishContext();
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
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);
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;
3660 __Pyx_XDECREF(__pyx_t_2);
3661 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.reconstructFromProteus", __pyx_clineno, __pyx_lineno, __pyx_filename);
3664 __Pyx_XGIVEREF(__pyx_r);
3665 __Pyx_RefNannyFinishContext();
3678 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_29reconstructFromProteus2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
3694 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3696 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3698 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3700 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3703 default:
goto __pyx_L5_argtuple_error;
3705 kw_args = PyDict_Size(__pyx_kwds);
3708 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3709 else goto __pyx_L5_argtuple_error;
3712 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isModelVert)) != 0)) kw_args--;
3714 __Pyx_RaiseArgtupleInvalid(
"reconstructFromProteus2", 1, 3, 3, 1); __PYX_ERR(1, 94, __pyx_L3_error)
3718 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bFaces)) != 0)) kw_args--;
3720 __Pyx_RaiseArgtupleInvalid(
"reconstructFromProteus2", 1, 3, 3, 2); __PYX_ERR(1, 94, __pyx_L3_error)
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)
3726 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3727 goto __pyx_L5_argtuple_error;
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);
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]);
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)
3741 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.reconstructFromProteus2", __pyx_clineno, __pyx_lineno, __pyx_filename);
3742 __Pyx_RefNannyFinishContext();
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);
3755 __Pyx_RefNannyFinishContext();
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;
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;
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)
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];
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)
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];
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;
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);
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);
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();
3838 PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3840 __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
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)
3846 __Pyx_DECREF_SET(__pyx_v_isModelVert, ((PyArrayObject *)__pyx_t_1));
3856 __Pyx_XDECREF(__pyx_r);
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)
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;
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);
3897 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bFaces.rcbuffer->pybuffer);
3898 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_isModelVert.rcbuffer->pybuffer);
3900 __Pyx_XDECREF((PyObject *)__pyx_v_isModelVert);
3901 __Pyx_XGIVEREF(__pyx_r);
3902 __Pyx_RefNannyFinishContext();
3915 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_31constructFromSerialPUMIMesh(PyObject *__pyx_v_self, PyObject *__pyx_v_cmesh);
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));
3931 __Pyx_RefNannyFinishContext();
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);
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;
3968 __Pyx_XDECREF(__pyx_t_1);
3969 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.constructFromSerialPUMIMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
3972 __Pyx_XGIVEREF(__pyx_r);
3973 __Pyx_RefNannyFinishContext();
3986 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_33constructFromParallelPUMIMesh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
4001 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4003 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4005 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4008 default:
goto __pyx_L5_argtuple_error;
4010 kw_args = PyDict_Size(__pyx_kwds);
4013 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4014 else goto __pyx_L5_argtuple_error;
4017 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4019 __Pyx_RaiseArgtupleInvalid(
"constructFromParallelPUMIMesh", 1, 2, 2, 1); __PYX_ERR(1, 100, __pyx_L3_error)
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)
4025 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4026 goto __pyx_L5_argtuple_error;
4028 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4029 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
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]);
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)
4038 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.constructFromParallelPUMIMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
4039 __Pyx_RefNannyFinishContext();
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);
4051 __Pyx_RefNannyFinishContext();
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);
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;
4088 __Pyx_XDECREF(__pyx_t_1);
4089 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.constructFromParallelPUMIMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
4092 __Pyx_XGIVEREF(__pyx_r);
4093 __Pyx_RefNannyFinishContext();
4106 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_35updateMaterialArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
4126 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4128 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4130 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4132 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4134 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4137 default:
goto __pyx_L5_argtuple_error;
4139 kw_args = PyDict_Size(__pyx_kwds);
4142 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4143 else goto __pyx_L5_argtuple_error;
4147 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim);
4148 if (value) { values[1] = value; kw_args--; }
4153 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bdryId);
4154 if (value) { values[2] = value; kw_args--; }
4159 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_geomTag);
4160 if (value) { values[3] = value; kw_args--; }
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)
4167 switch (PyTuple_GET_SIZE(__pyx_args)) {
4168 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4170 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4172 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4174 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4176 default:
goto __pyx_L5_argtuple_error;
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];
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)
4188 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.updateMaterialArrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
4189 __Pyx_RefNannyFinishContext();
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);
4200 __Pyx_RefNannyFinishContext();
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
4209 PyObject *__pyx_t_3 = NULL;
4213 int __pyx_lineno = 0;
4214 const char *__pyx_filename = NULL;
4215 int __pyx_clineno = 0;
4216 __Pyx_RefNannySetupContext(
"updateMaterialArrays", 0);
4225 __pyx_t_1 = (__pyx_v_dim == Py_None);
4226 __pyx_t_2 = (__pyx_t_1 != 0);
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;
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;
4281 __Pyx_XDECREF(__pyx_t_3);
4282 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.updateMaterialArrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
4285 __Pyx_XGIVEREF(__pyx_r);
4286 __Pyx_RefNannyFinishContext();
4299 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_37updateMaterialArrays2(PyObject *__pyx_v_self, PyObject *__pyx_v_cmesh);
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));
4315 __Pyx_RefNannyFinishContext();
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);
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;
4352 __Pyx_XDECREF(__pyx_t_1);
4353 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.updateMaterialArrays2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4356 __Pyx_XGIVEREF(__pyx_r);
4357 __Pyx_RefNannyFinishContext();
4370 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_39transferFieldToPUMI(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
4385 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4387 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4389 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4392 default:
goto __pyx_L5_argtuple_error;
4394 kw_args = PyDict_Size(__pyx_kwds);
4397 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
4398 else goto __pyx_L5_argtuple_error;
4401 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inArray)) != 0)) kw_args--;
4403 __Pyx_RaiseArgtupleInvalid(
"transferFieldToPUMI", 1, 2, 2, 1); __PYX_ERR(1, 109, __pyx_L3_error)
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)
4409 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4410 goto __pyx_L5_argtuple_error;
4412 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4413 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4415 __pyx_v_name = values[0];
4416 __pyx_v_inArray = ((PyArrayObject *)values[1]);
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)
4422 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferFieldToPUMI", __pyx_clineno, __pyx_lineno, __pyx_filename);
4423 __Pyx_RefNannyFinishContext();
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);
4434 __Pyx_RefNannyFinishContext();
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;
4448 PyObject *__pyx_t_6 = NULL;
4449 PyObject *__pyx_t_7 = NULL;
4450 PyObject *__pyx_t_8 = NULL;
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;
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)
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];
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;
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);
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);
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();
4508 PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
4510 __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
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)
4516 __Pyx_DECREF_SET(__pyx_v_inArray, ((PyArrayObject *)__pyx_t_1));
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)
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)
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;
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);
4572 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inArray.rcbuffer->pybuffer);
4574 __Pyx_XDECREF((PyObject *)__pyx_v_inArray);
4575 __Pyx_XGIVEREF(__pyx_r);
4576 __Pyx_RefNannyFinishContext();
4589 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_41transferFieldToProteus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
4604 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4606 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4608 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4611 default:
goto __pyx_L5_argtuple_error;
4613 kw_args = PyDict_Size(__pyx_kwds);
4616 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
4617 else goto __pyx_L5_argtuple_error;
4620 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outArray)) != 0)) kw_args--;
4622 __Pyx_RaiseArgtupleInvalid(
"transferFieldToProteus", 1, 2, 2, 1); __PYX_ERR(1, 112, __pyx_L3_error)
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)
4628 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4629 goto __pyx_L5_argtuple_error;
4631 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4632 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4634 __pyx_v_name = values[0];
4635 __pyx_v_outArray = ((PyArrayObject *)values[1]);
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)
4641 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferFieldToProteus", __pyx_clineno, __pyx_lineno, __pyx_filename);
4642 __Pyx_RefNannyFinishContext();
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);
4653 __Pyx_RefNannyFinishContext();
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;
4667 PyObject *__pyx_t_6 = NULL;
4668 PyObject *__pyx_t_7 = NULL;
4669 PyObject *__pyx_t_8 = NULL;
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;
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)
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];
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;
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);
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);
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();
4727 PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
4729 __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
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)
4735 __Pyx_DECREF_SET(__pyx_v_outArray, ((PyArrayObject *)__pyx_t_1));
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)
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)
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;
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);
4791 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer);
4793 __Pyx_XDECREF((PyObject *)__pyx_v_outArray);
4794 __Pyx_XGIVEREF(__pyx_r);
4795 __Pyx_RefNannyFinishContext();
4808 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_43transferElementFieldToProteus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
4823 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4825 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4827 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4830 default:
goto __pyx_L5_argtuple_error;
4832 kw_args = PyDict_Size(__pyx_kwds);
4835 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
4836 else goto __pyx_L5_argtuple_error;
4839 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outArray)) != 0)) kw_args--;
4841 __Pyx_RaiseArgtupleInvalid(
"transferElementFieldToProteus", 1, 2, 2, 1); __PYX_ERR(1, 115, __pyx_L3_error)
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)
4847 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4848 goto __pyx_L5_argtuple_error;
4850 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4851 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4853 __pyx_v_name = values[0];
4854 __pyx_v_outArray = ((PyArrayObject *)values[1]);
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)
4860 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferElementFieldToProteus", __pyx_clineno, __pyx_lineno, __pyx_filename);
4861 __Pyx_RefNannyFinishContext();
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);
4872 __Pyx_RefNannyFinishContext();
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;
4886 PyObject *__pyx_t_6 = NULL;
4887 PyObject *__pyx_t_7 = NULL;
4888 PyObject *__pyx_t_8 = NULL;
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;
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)
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];
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;
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);
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);
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();
4946 PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
4948 __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
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)
4954 __Pyx_DECREF_SET(__pyx_v_outArray, ((PyArrayObject *)__pyx_t_1));
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)
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)
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;
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);
5010 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_outArray.rcbuffer->pybuffer);
5012 __Pyx_XDECREF((PyObject *)__pyx_v_outArray);
5013 __Pyx_XGIVEREF(__pyx_r);
5014 __Pyx_RefNannyFinishContext();
5027 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_45transferPropertiesToPUMI(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
5047 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5049 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5051 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5053 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5055 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5057 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5059 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5061 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5064 default:
goto __pyx_L5_argtuple_error;
5066 kw_args = PyDict_Size(__pyx_kwds);
5069 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
5070 else goto __pyx_L5_argtuple_error;
5073 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nu)) != 0)) kw_args--;
5075 __Pyx_RaiseArgtupleInvalid(
"transferPropertiesToPUMI", 1, 7, 7, 1); __PYX_ERR(1, 118, __pyx_L3_error)
5079 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
5081 __Pyx_RaiseArgtupleInvalid(
"transferPropertiesToPUMI", 1, 7, 7, 2); __PYX_ERR(1, 118, __pyx_L3_error)
5085 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deltaT)) != 0)) kw_args--;
5087 __Pyx_RaiseArgtupleInvalid(
"transferPropertiesToPUMI", 1, 7, 7, 3); __PYX_ERR(1, 118, __pyx_L3_error)
5091 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_deltaT_next)) != 0)) kw_args--;
5093 __Pyx_RaiseArgtupleInvalid(
"transferPropertiesToPUMI", 1, 7, 7, 4); __PYX_ERR(1, 118, __pyx_L3_error)
5097 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_T_simulation)) != 0)) kw_args--;
5099 __Pyx_RaiseArgtupleInvalid(
"transferPropertiesToPUMI", 1, 7, 7, 5); __PYX_ERR(1, 118, __pyx_L3_error)
5103 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interfaceBandSize)) != 0)) kw_args--;
5105 __Pyx_RaiseArgtupleInvalid(
"transferPropertiesToPUMI", 1, 7, 7, 6); __PYX_ERR(1, 118, __pyx_L3_error)
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)
5111 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
5112 goto __pyx_L5_argtuple_error;
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);
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)
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)
5134 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferPropertiesToPUMI", __pyx_clineno, __pyx_lineno, __pyx_filename);
5135 __Pyx_RefNannyFinishContext();
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);
5148 __Pyx_RefNannyFinishContext();
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;
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;
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)
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];
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)
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];
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)
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];
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;
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);
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);
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();
5245 PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
5247 __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
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)
5253 __Pyx_DECREF_SET(__pyx_v_rho, ((PyArrayObject *)__pyx_t_1));
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;
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);
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);
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();
5295 PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
5297 __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
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)
5303 __Pyx_DECREF_SET(__pyx_v_nu, ((PyArrayObject *)__pyx_t_1));
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;
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);
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);
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();
5345 PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
5347 __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
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)
5353 __Pyx_DECREF_SET(__pyx_v_g, ((PyArrayObject *)__pyx_t_1));
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;
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);
5395 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_g.rcbuffer->pybuffer);
5396 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nu.rcbuffer->pybuffer);
5397 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rho.rcbuffer->pybuffer);
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();
5416 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_47setAdaptProperties(PyObject *__pyx_v_self, PyObject *__pyx_v_manager);
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));
5424 __Pyx_RefNannyFinishContext();
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;
5447 int __pyx_lineno = 0;
5448 const char *__pyx_filename = NULL;
5449 int __pyx_clineno = 0;
5450 __Pyx_RefNannySetupContext(
"setAdaptProperties", 0);
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;
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)
5469 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
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)
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);
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)
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);
5490 __pyx_t_1 = __pyx_t_4(__pyx_t_2);
5491 if (unlikely(!__pyx_t_1)) {
5492 PyObject* exc_type = PyErr_Occurred();
5494 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5495 else __PYX_ERR(1, 126, __pyx_L1_error)
5499 __Pyx_GOTREF(__pyx_t_1);
5501 __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_1);
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)
5513 __pyx_v_sizeInputs.push_back(__pyx_t_5);
5515 __Pyx_CppExn2PyErr();
5516 __PYX_ERR(1, 127, __pyx_L1_error)
5527 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5536 __Pyx_XDECREF(__pyx_r);
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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);
5674 __Pyx_XDECREF(__pyx_v_entry);
5675 __Pyx_XGIVEREF(__pyx_r);
5676 __Pyx_RefNannyFinishContext();
5689 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_49transferModelInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
5708 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5710 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5712 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5714 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5716 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5718 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5720 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5723 default:
goto __pyx_L5_argtuple_error;
5725 kw_args = PyDict_Size(__pyx_kwds);
5728 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numModelEntities)) != 0)) kw_args--;
5729 else goto __pyx_L5_argtuple_error;
5732 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edges)) != 0)) kw_args--;
5734 __Pyx_RaiseArgtupleInvalid(
"transferModelInfo", 1, 6, 6, 1); __PYX_ERR(1, 142, __pyx_L3_error)
5738 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_faces)) != 0)) kw_args--;
5740 __Pyx_RaiseArgtupleInvalid(
"transferModelInfo", 1, 6, 6, 2); __PYX_ERR(1, 142, __pyx_L3_error)
5744 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meshVertex2Model)) != 0)) kw_args--;
5746 __Pyx_RaiseArgtupleInvalid(
"transferModelInfo", 1, 6, 6, 3); __PYX_ERR(1, 142, __pyx_L3_error)
5750 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meshEdge2Model)) != 0)) kw_args--;
5752 __Pyx_RaiseArgtupleInvalid(
"transferModelInfo", 1, 6, 6, 4); __PYX_ERR(1, 142, __pyx_L3_error)
5756 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meshBoundary2Model)) != 0)) kw_args--;
5758 __Pyx_RaiseArgtupleInvalid(
"transferModelInfo", 1, 6, 6, 5); __PYX_ERR(1, 142, __pyx_L3_error)
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)
5764 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5765 goto __pyx_L5_argtuple_error;
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);
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]);
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)
5785 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.transferModelInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
5786 __Pyx_RefNannyFinishContext();
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);
5802 __Pyx_RefNannyFinishContext();
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;
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;
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)
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];
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)
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];
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)
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];
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)
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];
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)
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];
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)
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];
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;
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);
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);
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();
5939 PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
5941 __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
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)
5947 __Pyx_DECREF_SET(__pyx_v_numModelEntities, ((PyArrayObject *)__pyx_t_1));
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;
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);
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);
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();
5989 PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
5991 __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
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)
5997 __Pyx_DECREF_SET(__pyx_v_edges, ((PyArrayObject *)__pyx_t_1));
6007 __pyx_v_nMaxSegments = (__pyx_v_faces->dimensions[1]);
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;
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);
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);
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();
6048 PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
6050 __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
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)
6056 __Pyx_DECREF_SET(__pyx_v_faces, ((PyArrayObject *)__pyx_t_1));
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;
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);
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);
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();
6098 PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
6100 __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
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)
6106 __Pyx_DECREF_SET(__pyx_v_meshVertex2Model, ((PyArrayObject *)__pyx_t_1));
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;
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);
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);
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();
6148 PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
6150 __pyx_t_6 = __pyx_t_7 = __pyx_t_8 = 0;
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)
6156 __Pyx_DECREF_SET(__pyx_v_meshEdge2Model, ((PyArrayObject *)__pyx_t_1));
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;
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);
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);
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();
6198 PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
6200 __pyx_t_8 = __pyx_t_7 = __pyx_t_6 = 0;
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)
6206 __Pyx_DECREF_SET(__pyx_v_meshBoundary2Model, ((PyArrayObject *)__pyx_t_1));
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;
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);
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);
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();
6278 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_51adaptPUMIMesh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
6293 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6295 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6298 default:
goto __pyx_L5_argtuple_error;
6300 kw_args = PyDict_Size(__pyx_kwds);
6304 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inputString);
6305 if (value) { values[0] = value; kw_args--; }
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)
6312 switch (PyTuple_GET_SIZE(__pyx_args)) {
6313 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6316 default:
goto __pyx_L5_argtuple_error;
6319 __pyx_v_inputString = values[0];
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)
6325 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.adaptPUMIMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
6326 __Pyx_RefNannyFinishContext();
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);
6332 __Pyx_RefNannyFinishContext();
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
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);
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;
6371 __Pyx_XDECREF(__pyx_t_2);
6372 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.adaptPUMIMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
6375 __Pyx_XGIVEREF(__pyx_r);
6376 __Pyx_RefNannyFinishContext();
6389 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_53dumpMesh(PyObject *__pyx_v_self, PyObject *__pyx_v_cmesh);
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));
6405 __Pyx_RefNannyFinishContext();
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);
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;
6442 __Pyx_XDECREF(__pyx_t_1);
6443 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.dumpMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
6446 __Pyx_XGIVEREF(__pyx_r);
6447 __Pyx_RefNannyFinishContext();
6460 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_55getERMSizeField(PyObject *__pyx_v_self, PyObject *__pyx_v_err_total);
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));
6468 __Pyx_RefNannyFinishContext();
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
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);
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;
6507 __Pyx_XDECREF(__pyx_t_2);
6508 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.getERMSizeField", __pyx_clineno, __pyx_lineno, __pyx_filename);
6511 __Pyx_XGIVEREF(__pyx_r);
6512 __Pyx_RefNannyFinishContext();
6525 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_57getMPvalue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
6541 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6543 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6545 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6547 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6550 default:
goto __pyx_L5_argtuple_error;
6552 kw_args = PyDict_Size(__pyx_kwds);
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;
6559 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val_0)) != 0)) kw_args--;
6561 __Pyx_RaiseArgtupleInvalid(
"getMPvalue", 1, 3, 3, 1); __PYX_ERR(1, 171, __pyx_L3_error)
6565 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val_1)) != 0)) kw_args--;
6567 __Pyx_RaiseArgtupleInvalid(
"getMPvalue", 1, 3, 3, 2); __PYX_ERR(1, 171, __pyx_L3_error)
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)
6573 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6574 goto __pyx_L5_argtuple_error;
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);
6580 __pyx_v_field_val = values[0];
6581 __pyx_v_val_0 = values[1];
6582 __pyx_v_val_1 = values[2];
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)
6588 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.getMPvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
6589 __Pyx_RefNannyFinishContext();
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);
6595 __Pyx_RefNannyFinishContext();
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
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);
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;
6638 __Pyx_XDECREF(__pyx_t_4);
6639 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.getMPvalue", __pyx_clineno, __pyx_lineno, __pyx_filename);
6642 __Pyx_XGIVEREF(__pyx_r);
6643 __Pyx_RefNannyFinishContext();
6656 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_59willAdapt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
6664 __Pyx_RefNannyFinishContext();
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);
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;
6701 __Pyx_XDECREF(__pyx_t_1);
6702 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.willAdapt", __pyx_clineno, __pyx_lineno, __pyx_filename);
6705 __Pyx_XGIVEREF(__pyx_r);
6706 __Pyx_RefNannyFinishContext();
6719 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_61willInterfaceAdapt(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
6727 __Pyx_RefNannyFinishContext();
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);
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;
6764 __Pyx_XDECREF(__pyx_t_1);
6765 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.willInterfaceAdapt", __pyx_clineno, __pyx_lineno, __pyx_filename);
6768 __Pyx_XGIVEREF(__pyx_r);
6769 __Pyx_RefNannyFinishContext();
6782 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_63get_local_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
6790 __Pyx_RefNannyFinishContext();
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);
6811 __pyx_v_errTotal = 0.0;
6820 __pyx_v_self->thisptr->get_local_error(__pyx_v_errTotal);
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;
6846 __Pyx_XDECREF(__pyx_t_1);
6847 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.get_local_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
6850 __Pyx_XGIVEREF(__pyx_r);
6851 __Pyx_RefNannyFinishContext();
6864 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_65get_VMS_error(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
6872 __Pyx_RefNannyFinishContext();
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);
6893 __pyx_v_errTotal = 0.0;
6902 __pyx_v_self->thisptr->get_VMS_error(__pyx_v_errTotal);
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;
6928 __Pyx_XDECREF(__pyx_t_1);
6929 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.get_VMS_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
6932 __Pyx_XGIVEREF(__pyx_r);
6933 __Pyx_RefNannyFinishContext();
6946 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_67getMinimumQuality(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
6954 __Pyx_RefNannyFinishContext();
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);
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;
6991 __Pyx_XDECREF(__pyx_t_1);
6992 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.getMinimumQuality", __pyx_clineno, __pyx_lineno, __pyx_filename);
6995 __Pyx_XGIVEREF(__pyx_r);
6996 __Pyx_RefNannyFinishContext();
7009 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_69writeMesh(PyObject *__pyx_v_self, PyObject *__pyx_v_meshName);
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));
7017 __Pyx_RefNannyFinishContext();
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
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);
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;
7056 __Pyx_XDECREF(__pyx_t_2);
7057 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.writeMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
7060 __Pyx_XGIVEREF(__pyx_r);
7061 __Pyx_RefNannyFinishContext();
7074 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_71cleanMesh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
7082 __Pyx_RefNannyFinishContext();
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);
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;
7119 __Pyx_XDECREF(__pyx_t_1);
7120 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.cleanMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
7123 __Pyx_XGIVEREF(__pyx_r);
7124 __Pyx_RefNannyFinishContext();
7135 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_73__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
7143 __Pyx_RefNannyFinishContext();
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);
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)
7176 __Pyx_XDECREF(__pyx_t_1);
7177 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7179 __Pyx_XGIVEREF(__pyx_r);
7180 __Pyx_RefNannyFinishContext();
7192 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_75__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
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));
7200 __Pyx_RefNannyFinishContext();
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);
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)
7233 __Pyx_XDECREF(__pyx_t_1);
7234 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.MeshAdapt.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7236 __Pyx_XGIVEREF(__pyx_r);
7237 __Pyx_RefNannyFinishContext();
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);
7272 __pyx_r = __pyx_t_2;
7278 __Pyx_XDECREF(__pyx_t_1);
7279 __Pyx_XDECREF(__pyx_t_2);
7280 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7283 __Pyx_XGIVEREF(__pyx_r);
7284 __Pyx_RefNannyFinishContext();
7289 static PyObject *__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_12AdaptManager_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
7307 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7309 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7311 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7314 default:
goto __pyx_L5_argtuple_error;
7316 kw_args = PyDict_Size(__pyx_kwds);
7319 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
7320 else goto __pyx_L5_argtuple_error;
7324 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_adapter);
7325 if (value) { values[1] = value; kw_args--; }
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)
7332 switch (PyTuple_GET_SIZE(__pyx_args)) {
7333 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7335 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7337 default:
goto __pyx_L5_argtuple_error;
7340 __pyx_v_self = values[0];
7341 __pyx_v_adapter = values[1];
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)
7347 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.AdaptManager.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7348 __Pyx_RefNannyFinishContext();
7350 __pyx_L4_argument_unpacking_done:;
7351 __pyx_r = __pyx_pf_13MeshAdaptPUMI_9MeshAdapt_12AdaptManager___init__(__pyx_self, __pyx_v_self, __pyx_v_adapter);
7354 __Pyx_RefNannyFinishContext();
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);
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;
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;
7398 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_PUMIAdapter, __pyx_v_adapter) < 0) __PYX_ERR(1, 196, __pyx_L1_error)
7407 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_adapt, __pyx_int_0) < 0) __PYX_ERR(1, 197, __pyx_L1_error)
7416 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hmax, __pyx_float_100_0) < 0) __PYX_ERR(1, 198, __pyx_L1_error)
7425 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hmin, __pyx_float_1eneg_8) < 0) __PYX_ERR(1, 199, __pyx_L1_error)
7434 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hphi, __pyx_float_1eneg_2) < 0) __PYX_ERR(1, 200, __pyx_L1_error)
7443 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_numAdaptSteps, __pyx_int_10) < 0) __PYX_ERR(1, 201, __pyx_L1_error)
7452 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_numIterations, __pyx_int_5) < 0) __PYX_ERR(1, 202, __pyx_L1_error)
7461 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_targetError, __pyx_int_0) < 0) __PYX_ERR(1, 203, __pyx_L1_error)
7470 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_gradingFactor, __pyx_float_1_5) < 0) __PYX_ERR(1, 204, __pyx_L1_error)
7479 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_logging, __pyx_int_0) < 0) __PYX_ERR(1, 205, __pyx_L1_error)
7488 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_maxAspectRatio, __pyx_float_100_0) < 0) __PYX_ERR(1, 206, __pyx_L1_error)
7497 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_maType, __pyx_kp_s_) < 0) __PYX_ERR(1, 207, __pyx_L1_error)
7505 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reconstructedFlag, __pyx_int_2) < 0) __PYX_ERR(1, 208, __pyx_L1_error)
7516 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7519 __Pyx_XDECREF(__pyx_t_1);
7520 __Pyx_AddTraceback(
"MeshAdaptPUMI.MeshAdapt.AdaptManager.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7523 __Pyx_XGIVEREF(__pyx_r);
7524 __Pyx_RefNannyFinishContext();
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);
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;
7569 __Pyx_XDECREF(__pyx_t_1);
7570 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7573 __Pyx_XGIVEREF(__pyx_r);
7574 __Pyx_RefNannyFinishContext();
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);
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;
7619 __Pyx_XDECREF(__pyx_t_1);
7620 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7623 __Pyx_XGIVEREF(__pyx_r);
7624 __Pyx_RefNannyFinishContext();
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);
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;
7669 __Pyx_XDECREF(__pyx_t_1);
7670 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7673 __Pyx_XGIVEREF(__pyx_r);
7674 __Pyx_RefNannyFinishContext();
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);
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;
7719 __Pyx_XDECREF(__pyx_t_1);
7720 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7723 __Pyx_XGIVEREF(__pyx_r);
7724 __Pyx_RefNannyFinishContext();
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);
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;
7769 __Pyx_XDECREF(__pyx_t_1);
7770 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7773 __Pyx_XGIVEREF(__pyx_r);
7774 __Pyx_RefNannyFinishContext();
7786 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7787 PyObject *__pyx_r = NULL;
7788 __Pyx_RefNannyDeclarations
7790 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
7799 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7809 __Pyx_XDECREF(__pyx_r);
7810 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7811 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7831 __Pyx_XDECREF(__pyx_r);
7832 __Pyx_INCREF(__pyx_empty_tuple);
7833 __pyx_r = __pyx_empty_tuple;
7847 __Pyx_XGIVEREF(__pyx_r);
7848 __Pyx_RefNannyFinishContext();
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);
7871 Py_INCREF(__pyx_v_base);
7880 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7891 __Pyx_RefNannyFinishContext();
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
7907 __Pyx_RefNannySetupContext(
"get_array_base", 0);
7916 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7925 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7935 __Pyx_XDECREF(__pyx_r);
7936 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7955 __Pyx_XDECREF(__pyx_r);
7956 __Pyx_INCREF(((PyObject *)__pyx_v_base));
7957 __pyx_r = ((PyObject *)__pyx_v_base);
7970 __Pyx_XGIVEREF(__pyx_r);
7971 __Pyx_RefNannyFinishContext();
7983 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
7985 __Pyx_RefNannyDeclarations
7986 PyObject *__pyx_t_1 = NULL;
7987 PyObject *__pyx_t_2 = NULL;
7988 PyObject *__pyx_t_3 = NULL;
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);
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);
8022 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
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;
8045 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
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);
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)
8066 goto __pyx_L5_except_error;
8067 __pyx_L5_except_error:;
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;
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);
8103 __Pyx_RefNannyFinishContext();
8115 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
8117 __Pyx_RefNannyDeclarations
8118 PyObject *__pyx_t_1 = NULL;
8119 PyObject *__pyx_t_2 = NULL;
8120 PyObject *__pyx_t_3 = NULL;
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);
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);
8154 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
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;
8177 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
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);
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)
8198 goto __pyx_L5_except_error;
8199 __pyx_L5_except_error:;
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;
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);
8235 __Pyx_RefNannyFinishContext();
8247 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
8249 __Pyx_RefNannyDeclarations
8250 PyObject *__pyx_t_1 = NULL;
8251 PyObject *__pyx_t_2 = NULL;
8252 PyObject *__pyx_t_3 = NULL;
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);
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);
8286 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
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;
8309 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
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);
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)
8330 goto __pyx_L5_except_error;
8331 __pyx_L5_except_error:;
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;
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);
8367 __Pyx_RefNannyFinishContext();
8379 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
8381 __Pyx_RefNannyDeclarations
8382 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
8391 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
8404 __Pyx_RefNannyFinishContext();
8416 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
8418 __Pyx_RefNannyDeclarations
8419 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
8428 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
8441 __Pyx_RefNannyFinishContext();
8453 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
8454 npy_datetime __pyx_r;
8463 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
8487 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
8488 npy_timedelta __pyx_r;
8497 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
8521 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
8522 NPY_DATETIMEUNIT __pyx_r;
8529 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
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);
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;
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);
8590 __Pyx_XGIVEREF(__pyx_r);
8591 __Pyx_RefNannyFinishContext();
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);
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;
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);
8640 __Pyx_XGIVEREF(__pyx_r);
8641 __Pyx_RefNannyFinishContext();
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);
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;
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);
8690 __Pyx_XGIVEREF(__pyx_r);
8691 __Pyx_RefNannyFinishContext();
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);
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;
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);
8740 __Pyx_XGIVEREF(__pyx_r);
8741 __Pyx_RefNannyFinishContext();
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);
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;
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);
8789 __Pyx_XGIVEREF(__pyx_r);
8790 __Pyx_RefNannyFinishContext();
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);
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;
8839 __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
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);
8855 __Pyx_RefNannyFinishContext();
8859 static PyObject *__pyx_tp_new_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
8861 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
8862 o = (*t->tp_alloc)(t, 0);
8864 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
8866 if (unlikely(!o))
return 0;
8867 if (unlikely(__pyx_pw_13MeshAdaptPUMI_9MeshAdapt_9MeshAdapt_1__cinit__(o, __pyx_empty_tuple, NULL) < 0))
goto bad;
8870 Py_DECREF(o); o = 0;
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;
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);
8888 (*Py_TYPE(o)->tp_free)(o);
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},
8931 static PyTypeObject __pyx_type_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt = {
8932 PyVarObject_HEAD_INIT(0, 0)
8933 "MeshAdaptPUMI.MeshAdapt.MeshAdapt",
8934 sizeof(
struct __pyx_obj_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt),
8936 __pyx_tp_dealloc_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt,
8937 #if PY_VERSION_HEX < 0x030800b4
8940 #if PY_VERSION_HEX >= 0x030800b4
8945 #if PY_MAJOR_VERSION < 3
8948 #if PY_MAJOR_VERSION >= 3
8961 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
8969 __pyx_methods_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt,
8979 __pyx_tp_new_13MeshAdaptPUMI_9MeshAdapt_MeshAdapt,
8989 #if PY_VERSION_HEX >= 0x030400a1
8992 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
8995 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
8998 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
9003 static PyMethodDef __pyx_methods[] = {
9007 #if PY_MAJOR_VERSION >= 3
9008 #if CYTHON_PEP489_MULTI_PHASE_INIT
9009 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
9010 static int __pyx_pymod_exec_MeshAdapt(PyObject* module);
9011 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
9012 {Py_mod_create, (
void*)__pyx_pymod_create},
9013 {Py_mod_exec, (
void*)__pyx_pymod_exec_MeshAdapt},
9018 static struct PyModuleDef __pyx_moduledef = {
9019 PyModuleDef_HEAD_INIT,
9022 #if CYTHON_PEP489_MULTI_PHASE_INIT
9028 #if CYTHON_PEP489_MULTI_PHASE_INIT
9029 __pyx_moduledef_slots,
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))
9044 #define CYTHON_SMALL_CODE
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}
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)
9143 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
9144 __Pyx_RefNannyDeclarations
9145 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
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);
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);
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);
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);
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();
9202 __Pyx_RefNannyFinishContext();
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)
9221 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
9222 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
9223 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
9224 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
9225 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
9226 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
9227 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
9229 static int __Pyx_modinit_global_init_code(
void) {
9230 __Pyx_RefNannyDeclarations
9231 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
9233 __Pyx_RefNannyFinishContext();
9237 static int __Pyx_modinit_variable_export_code(
void) {
9238 __Pyx_RefNannyDeclarations
9239 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
9241 __Pyx_RefNannyFinishContext();
9245 static int __Pyx_modinit_function_export_code(
void) {
9246 __Pyx_RefNannyDeclarations
9247 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
9249 __Pyx_RefNannyFinishContext();
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);
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;
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;
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();
9273 __Pyx_RefNannyFinishContext();
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);
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),
9291 sizeof(PyHeapTypeObject),
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();
9337 __Pyx_XDECREF(__pyx_t_1);
9338 __Pyx_RefNannyFinishContext();
9342 static int __Pyx_modinit_variable_import_code(
void) {
9343 __Pyx_RefNannyDeclarations
9344 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
9346 __Pyx_RefNannyFinishContext();
9350 static int __Pyx_modinit_function_import_code(
void) {
9351 __Pyx_RefNannyDeclarations
9352 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
9354 __Pyx_RefNannyFinishContext();
9359 #ifndef CYTHON_NO_PYINIT_EXPORT
9360 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
9361 #elif PY_MAJOR_VERSION < 3
9363 #define __Pyx_PyMODINIT_FUNC extern "C" void
9365 #define __Pyx_PyMODINIT_FUNC void
9369 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
9371 #define __Pyx_PyMODINIT_FUNC PyObject *
9376 #if PY_MAJOR_VERSION < 3
9377 __Pyx_PyMODINIT_FUNC initMeshAdapt(
void) CYTHON_SMALL_CODE;
9378 __Pyx_PyMODINIT_FUNC initMeshAdapt(
void)
9380 __Pyx_PyMODINIT_FUNC PyInit_MeshAdapt(
void) CYTHON_SMALL_CODE;
9381 __Pyx_PyMODINIT_FUNC PyInit_MeshAdapt(
void)
9382 #if CYTHON_PEP489_MULTI_PHASE_INIT
9384 return PyModuleDef_Init(&__pyx_moduledef);
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))
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))
9404 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
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);
9412 if (likely(value)) {
9413 if (allow_none || value != Py_None) {
9414 result = PyDict_SetItemString(moddict, to_name, value);
9417 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
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())
9429 return __Pyx_NewRef(__pyx_m);
9430 modname = PyObject_GetAttrString(spec,
"name");
9431 if (unlikely(!modname))
goto bad;
9432 module = PyModule_NewObject(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;
9448 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_MeshAdapt(PyObject *__pyx_pyinit_module)
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
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.");
9465 #elif PY_MAJOR_VERSION >= 3
9466 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
9469 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
9470 if (!__Pyx_RefNanny) {
9472 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
9473 if (!__Pyx_RefNanny)
9474 Py_FatalError(
"failed to import 'refnanny' module");
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();
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)
9488 #ifdef __Pyx_FusedFunction_USED
9489 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9491 #ifdef __Pyx_Coroutine_USED
9492 if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9494 #ifdef __Pyx_Generator_USED
9495 if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9497 #ifdef __Pyx_AsyncGen_USED
9498 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9500 #ifdef __Pyx_StopAsyncIteration_USED
9501 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9505 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
9506 PyEval_InitThreads();
9509 #if CYTHON_PEP489_MULTI_PHASE_INIT
9510 __pyx_m = __pyx_pyinit_module;
9513 #if PY_MAJOR_VERSION < 3
9514 __pyx_m = Py_InitModule4(
"MeshAdapt", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
9516 __pyx_m = PyModule_Create(&__pyx_moduledef);
9518 if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
9520 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
9522 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
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);
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)
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)
9535 #if PY_MAJOR_VERSION >= 3
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)
9544 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9546 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
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();
9556 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
9557 if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
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;
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;
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);
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);
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;
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;
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;
9657 __Pyx_XDECREF(__pyx_t_1);
9658 __Pyx_XDECREF(__pyx_t_2);
9659 __Pyx_XDECREF(__pyx_t_3);
9662 __Pyx_AddTraceback(
"init MeshAdaptPUMI.MeshAdapt", __pyx_clineno, __pyx_lineno, __pyx_filename);
9665 }
else if (!PyErr_Occurred()) {
9666 PyErr_SetString(PyExc_ImportError,
"init MeshAdaptPUMI.MeshAdapt");
9669 __Pyx_RefNannyFinishContext();
9670 #if CYTHON_PEP489_MULTI_PHASE_INIT
9671 return (__pyx_m != NULL) ? 0 : -1;
9672 #elif PY_MAJOR_VERSION >= 3
9682 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
9683 PyObject *m = NULL, *p = NULL;
9685 m = PyImport_ImportModule(modname);
9687 p = PyObject_GetAttrString(m,
"RefNannyAPI");
9689 r = PyLong_AsVoidPtr(p);
9693 return (__Pyx_RefNannyAPIStruct *)
r;
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));
9707 return PyObject_GetAttr(obj, attr_name);
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);
9719 "name '%.200s' is not defined", PyString_AS_STRING(name));
9726 static void __Pyx_RaiseArgtupleInvalid(
9727 const char* func_name,
9731 Py_ssize_t num_found)
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";
9739 num_expected = num_max;
9740 more_or_less =
"at most";
9743 more_or_less =
"exactly";
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);
9752 static int __Pyx_CheckKeywordStrings(
9754 const char* function_name,
9759 #if CYTHON_COMPILING_IN_PYPY
9760 if (!kw_allowed && PyDict_Next(kwdict, &
pos, &key, 0))
9761 goto invalid_keyword;
9764 while (PyDict_Next(kwdict, &
pos, &key, 0)) {
9765 #if PY_MAJOR_VERSION < 3
9766 if (unlikely(!PyString_Check(key)))
9768 if (unlikely(!PyUnicode_Check(key)))
9769 goto invalid_keyword_type;
9771 if ((!kw_allowed) && unlikely(key))
9772 goto invalid_keyword;
9774 invalid_keyword_type:
9775 PyErr_Format(PyExc_TypeError,
9776 "%.200s() keywords must be strings", function_name);
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));
9785 "%s() got an unexpected keyword argument '%U'",
9786 function_name, key);
9792 static void __Pyx_RaiseDoubleKeywordsError(
9793 const char* func_name,
9796 PyErr_Format(PyExc_TypeError,
9797 #
if PY_MAJOR_VERSION >= 3
9798 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
9800 "%s() got multiple values for keyword argument '%s'", func_name,
9801 PyString_AsString(kw_name));
9806 static int __Pyx_ParseOptionalKeywords(
9808 PyObject **argnames[],
9811 Py_ssize_t num_pos_args,
9812 const char* function_name)
9814 PyObject *key = 0, *value = 0;
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++;
9822 values[name-argnames] = value;
9825 name = first_kw_arg;
9826 #if PY_MAJOR_VERSION < 3
9827 if (likely(PyString_Check(key))) {
9829 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
9830 && _PyString_Eq(**name, key)) {
9831 values[name-argnames] = value;
9836 if (*name)
continue;
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;
9850 if (likely(PyUnicode_Check(key))) {
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 :
9856 PyUnicode_Compare(**name, key);
9857 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
9859 values[name-argnames] = value;
9864 if (*name)
continue;
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 :
9872 PyUnicode_Compare(**argname, key);
9873 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
9874 if (cmp == 0)
goto arg_passed_twice;
9879 goto invalid_keyword_type;
9881 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
9883 goto invalid_keyword;
9888 __Pyx_RaiseDoubleKeywordsError(function_name, key);
9890 invalid_keyword_type:
9891 PyErr_Format(PyExc_TypeError,
9892 "%.200s() keywords must be strings", function_name);
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));
9900 "%s() got an unexpected keyword argument '%U'",
9901 function_name, key);
9908 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
9910 if (unlikely(!type)) {
9911 PyErr_SetString(PyExc_SystemError,
"Missing type object");
9915 #if PY_MAJOR_VERSION == 2
9916 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
9920 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
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);
9929 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
9936 return S.u8[0] == 4;
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;
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 =
'@';
9957 ctx->is_complex = 0;
9958 ctx->is_valid_array = 0;
9959 ctx->struct_alignment = 0;
9960 while (type->typegroup ==
'S') {
9962 ctx->head->field = type->fields;
9963 ctx->head->parent_offset = 0;
9964 type = type->fields->type;
9967 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
9969 const char* t = *ts;
9970 if (*t < '0' || *t >
'9') {
9974 while (*t >=
'0' && *t <=
'9') {
9976 count += *t++ -
'0';
9982 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
9983 int number = __Pyx_BufFmt_ParseNumber(ts);
9985 PyErr_Format(PyExc_ValueError,\
9986 "Does not understand character buffer dtype format string ('%c')", **ts);
9989 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
9990 PyErr_Format(PyExc_ValueError,
9991 "Unexpected format string character: '%c'", ch);
9993 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
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";
10018 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
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);
10027 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
10030 case 'O':
case 'P':
return sizeof(
void*);
10032 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
10036 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
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);
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*);
10050 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
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;
10065 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
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);
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*);
10079 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
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;
10097 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
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);
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*);
10111 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
10115 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
10119 case 'b':
case 'h':
case 'i':
10120 case 'l':
case 'q':
case 's':
case 'p':
10122 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
10124 case 'f':
case 'd':
case 'g':
10125 return (is_complex ?
'C' :
'R');
10131 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
10136 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
10137 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
10138 const char* expected;
10140 if (ctx->head == NULL) {
10144 expected = ctx->head->field->type->name;
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));
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);
10160 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
10162 size_t size, offset, arraysize = 1;
10163 if (ctx->enc_type == 0)
return 0;
10164 if (ctx->head->field->type->arraysize[0]) {
10166 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
10167 ctx->is_valid_array = ctx->head->field->type->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);
10176 if (!ctx->is_valid_array) {
10177 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
10178 ctx->head->field->type->ndim, ndim);
10181 for (i = 0; i < ctx->head->field->type->ndim; i++) {
10182 arraysize *= ctx->head->field->type->arraysize[i];
10184 ctx->is_valid_array = 0;
10185 ctx->enc_count = 1;
10187 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
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);
10194 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
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,
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;
10210 ctx->head->field = type->fields;
10211 ctx->head->parent_offset = parent_offset;
10214 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
10216 __Pyx_BufFmt_RaiseExpected(ctx);
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);
10227 ctx->fmt_offset += size;
10229 ctx->fmt_offset += (arraysize - 1) * size;
10232 if (field == &ctx->root) {
10234 if (ctx->enc_count != 0) {
10235 __Pyx_BufFmt_RaiseExpected(ctx);
10240 ctx->head->field = ++field;
10241 if (field->type == NULL) {
10243 field = ctx->head->field;
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;
10250 ctx->head->field = field;
10251 ctx->head->parent_offset = parent_offset;
10257 }
while (ctx->enc_count);
10259 ctx->is_complex = 0;
10263 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
10265 const char *ts = *tsp;
10266 int i = 0,
number, ndim;
10268 if (ctx->new_count != 1) {
10269 PyErr_SetString(PyExc_ValueError,
10270 "Cannot handle repeated arrays in format string");
10273 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
10274 ndim = ctx->head->field->type->ndim;
10275 while (*ts && *ts !=
')') {
10277 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
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++;
10293 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
10294 ctx->head->field->type->ndim, i);
10296 PyErr_SetString(PyExc_ValueError,
10297 "Unexpected end of format string, expected ')'");
10300 ctx->is_valid_array = 1;
10301 ctx->new_count = 1;
10305 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
10310 if (ctx->enc_type != 0 && ctx->head == NULL) {
10311 __Pyx_BufFmt_RaiseExpected(ctx);
10314 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
10315 if (ctx->head != NULL) {
10316 __Pyx_BufFmt_RaiseExpected(ctx);
10326 if (!__Pyx_Is_Little_Endian()) {
10327 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
10330 ctx->new_packmode =
'=';
10335 if (__Pyx_Is_Little_Endian()) {
10336 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
10339 ctx->new_packmode =
'=';
10345 ctx->new_packmode = *ts++;
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;
10355 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
10358 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
10360 ctx->enc_count = 0;
10361 ctx->struct_alignment = 0;
10364 for (i = 0; i != struct_count; ++i) {
10365 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
10366 if (!ts_after_sub)
return NULL;
10369 if (struct_alignment) ctx->struct_alignment = struct_alignment;
10374 size_t alignment = ctx->struct_alignment;
10376 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
10378 if (alignment && ctx->fmt_offset % alignment) {
10379 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
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;
10389 ctx->enc_packmode = ctx->new_packmode;
10395 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
10396 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
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;
10412 CYTHON_FALLTHROUGH;
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;
10420 ctx->new_count = 1;
10425 while(*ts !=
':') ++ts;
10429 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
10433 int number = __Pyx_BufFmt_ExpectNumber(&ts);
10434 if (
number == -1)
return NULL;
10435 ctx->new_count = (size_t)
number;
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);
10447 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
10450 buf->strides = __Pyx_zeros;
10451 buf->shape = __Pyx_zeros;
10452 buf->suboffsets = __Pyx_minusones;
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)
10459 if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
10460 __Pyx_ZeroBuffer(buf);
10463 if (unlikely(buf->ndim != nd)) {
10464 PyErr_Format(PyExc_ValueError,
10465 "Buffer has wrong number of dimensions (expected %d, got %d)",
10470 __Pyx_BufFmt_Context ctx;
10471 __Pyx_BufFmt_Init(&ctx, stack, dtype);
10472 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
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" :
"");
10481 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
10484 __Pyx_SafeReleaseBuffer(buf);
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;
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;
10498 #if CYTHON_COMPILING_IN_CPYTHON
10499 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
10501 dictptr = _PyObject_GetDictPtr(obj);
10504 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
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)))
10510 return obj_dict_version == __Pyx_get_object_dict_version(obj);
10515 #if CYTHON_USE_DICT_VERSIONS
10516 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
10518 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
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())) {
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);
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);
10546 return __Pyx_GetBuiltinName(name);
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);
10563 assert(!PyErr_Occurred());
10564 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
10565 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
10567 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
10573 #if CYTHON_FAST_PYCALL
10574 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
10575 PyObject *globals) {
10577 PyThreadState *tstate = __Pyx_PyThreadState_Current;
10578 PyObject **fastlocals;
10581 assert(globals != NULL);
10586 assert(tstate != NULL);
10587 f = PyFrame_New(tstate, co, globals, NULL);
10591 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
10592 for (i = 0; i < na; i++) {
10594 fastlocals[i] = *args++;
10596 result = PyEval_EvalFrameEx(
f,0);
10597 ++tstate->recursion_depth;
10599 --tstate->recursion_depth;
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);
10608 #if PY_MAJOR_VERSION >= 3
10611 PyObject *kwtuple, **k;
10616 assert(kwargs == NULL || PyDict_Check(kwargs));
10617 nk = kwargs ? PyDict_Size(kwargs) : 0;
10618 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
10622 #
if PY_MAJOR_VERSION >= 3
10623 co->co_kwonlyargcount == 0 &&
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);
10631 else if (nargs == 0 && argdefs != NULL
10632 && co->co_argcount == Py_SIZE(argdefs)) {
10635 args = &PyTuple_GET_ITEM(argdefs, 0);
10636 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
10640 if (kwargs != NULL) {
10642 kwtuple = PyTuple_New(2 * nk);
10643 if (kwtuple == NULL) {
10647 k = &PyTuple_GET_ITEM(kwtuple, 0);
10649 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
10660 closure = PyFunction_GET_CLOSURE(func);
10661 #if PY_MAJOR_VERSION >= 3
10662 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
10664 if (argdefs != NULL) {
10665 d = &PyTuple_GET_ITEM(argdefs, 0);
10666 nd = Py_SIZE(argdefs);
10672 #if PY_MAJOR_VERSION >= 3
10673 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
10676 d, (
int)nd, kwdefs, closure);
10678 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
10681 d, (
int)nd, closure);
10683 Py_XDECREF(kwtuple);
10685 Py_LeaveRecursiveCall();
10692 #if CYTHON_COMPILING_IN_CPYTHON
10693 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
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")))
10700 result = (*call)(func, arg, kw);
10701 Py_LeaveRecursiveCall();
10702 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
10705 "NULL result without error in PyObject_Call");
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);
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);
10726 args = PyTuple_New(2);
10727 if (unlikely(!args))
goto done;
10729 PyTuple_SET_ITEM(args, 0, arg1);
10731 PyTuple_SET_ITEM(args, 1, arg2);
10732 Py_INCREF(
function);
10733 result = __Pyx_PyObject_Call(
function, args, NULL);
10735 Py_DECREF(
function);
10741 #if CYTHON_COMPILING_IN_CPYTHON
10742 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
10743 PyObject *
self, *result;
10745 cfunc = PyCFunction_GET_FUNCTION(func);
10746 self = PyCFunction_GET_SELF(func);
10747 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
10749 result = cfunc(
self, arg);
10750 Py_LeaveRecursiveCall();
10751 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
10754 "NULL result without error in PyObject_Call");
10761 #if CYTHON_COMPILING_IN_CPYTHON
10762 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10764 PyObject *args = PyTuple_New(1);
10765 if (unlikely(!args))
return NULL;
10767 PyTuple_SET_ITEM(args, 0, arg);
10768 result = __Pyx_PyObject_Call(func, args, NULL);
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);
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);
10787 return __Pyx__PyObject_CallOneArg(func, arg);
10790 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10792 PyObject *args = PyTuple_Pack(1, arg);
10793 if (unlikely(!args))
return NULL;
10794 result = __Pyx_PyObject_Call(func, args, NULL);
10801 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
10802 if (unlikely(!type)) {
10803 PyErr_SetString(PyExc_SystemError,
"Missing type object");
10806 if (likely(__Pyx_TypeCheck(obj, type)))
10808 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
10809 Py_TYPE(obj)->tp_name, type->tp_name);
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!");
10820 static void __Pyx_RaiseBufferIndexError(
int axis) {
10821 PyErr_Format(PyExc_IndexError,
10822 "Out of bounds on buffer access (axis %d)", axis);
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);
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;
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
10855 if (!value || value == Py_None)
10859 if (!tb || tb == Py_None)
10863 if (!PyTraceBack_Check(tb)) {
10864 PyErr_SetString(PyExc_TypeError,
10865 "raise: arg 3 must be a traceback or None");
10869 if (PyType_Check(type)) {
10870 #if CYTHON_COMPILING_IN_PYPY
10872 Py_INCREF(Py_None);
10876 PyErr_NormalizeException(&type, &value, &tb);
10879 PyErr_SetString(PyExc_TypeError,
10880 "instance exception may not have a separate value");
10884 type = (PyObject*) Py_TYPE(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");
10892 __Pyx_PyThreadState_assign
10893 __Pyx_ErrRestore(type, value, tb);
10902 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
10903 PyObject* owned_instance = NULL;
10904 if (tb == Py_None) {
10906 }
else if (tb && !PyTraceBack_Check(tb)) {
10907 PyErr_SetString(PyExc_TypeError,
10908 "raise: arg 3 must be a traceback or None");
10911 if (value == Py_None)
10913 if (PyExceptionInstance_Check(type)) {
10915 PyErr_SetString(PyExc_TypeError,
10916 "instance exception may not have a separate value");
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)) {
10932 type = instance_class;
10936 if (!instance_class) {
10939 args = PyTuple_New(0);
10940 else if (PyTuple_Check(value)) {
10944 args = PyTuple_Pack(1, value);
10947 owned_instance = PyObject_Call(type, args, NULL);
10949 if (!owned_instance)
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));
10961 PyErr_SetString(PyExc_TypeError,
10962 "raise: exception class must be a subclass of BaseException");
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)
10973 }
else if (PyExceptionInstance_Check(cause)) {
10974 fixed_cause = cause;
10975 Py_INCREF(fixed_cause);
10977 PyErr_SetString(PyExc_TypeError,
10978 "exception causes must derive from "
10982 PyException_SetCause(value, fixed_cause);
10984 PyErr_SetObject(type, value);
10986 #if CYTHON_COMPILING_IN_PYPY
10987 PyObject *tmp_type, *tmp_value, *tmp_tb;
10988 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
10990 PyErr_Restore(tmp_type, tmp_value, tb);
10991 Py_XDECREF(tmp_tb);
10993 PyThreadState *tstate = __Pyx_PyThreadState_Current;
10994 PyObject* tmp_tb = tstate->curexc_traceback;
10995 if (tb != tmp_tb) {
10997 tstate->curexc_traceback = tb;
10998 Py_XDECREF(tmp_tb);
11003 Py_XDECREF(owned_instance);
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);
11018 return PyObject_SetAttr(obj, attr_name, value);
11023 #if CYTHON_USE_EXC_INFO_STACK
11024 static _PyErr_StackItem *
11025 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
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)
11031 exc_info = exc_info->previous_item;
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;
11046 *type = tstate->exc_type;
11047 *value = tstate->exc_value;
11048 *tb = tstate->exc_traceback;
11051 Py_XINCREF(*value);
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;
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;
11072 Py_XDECREF(tmp_type);
11073 Py_XDECREF(tmp_value);
11074 Py_XDECREF(tmp_tb);
11079 #if CYTHON_FAST_THREAD_STATE
11080 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
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;
11088 for (i=0; i<
n; i++) {
11089 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
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);
11104 #if CYTHON_FAST_THREAD_STATE
11105 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
11107 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
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;
11120 PyErr_Fetch(&local_type, &local_value, &local_tb);
11122 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
11123 #if CYTHON_FAST_THREAD_STATE
11124 if (unlikely(tstate->curexc_type))
11126 if (unlikely(PyErr_Occurred()))
11129 #if PY_MAJOR_VERSION >= 3
11131 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
11135 Py_XINCREF(local_tb);
11136 Py_XINCREF(local_type);
11137 Py_XINCREF(local_value);
11138 *type = local_type;
11139 *value = local_value;
11141 #if CYTHON_FAST_THREAD_STATE
11142 #if CYTHON_USE_EXC_INFO_STACK
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;
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;
11160 Py_XDECREF(tmp_type);
11161 Py_XDECREF(tmp_value);
11162 Py_XDECREF(tmp_tb);
11164 PyErr_SetExcInfo(local_type, local_value, local_tb);
11171 Py_XDECREF(local_type);
11172 Py_XDECREF(local_value);
11173 Py_XDECREF(local_tb);
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);
11185 "'%.50s' object has no attribute '%.400s'",
11186 tp->tp_name, PyString_AS_STRING(attr_name));
11190 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
11192 PyTypeObject *tp = Py_TYPE(obj);
11193 if (unlikely(!PyString_Check(attr_name))) {
11194 return PyObject_GenericGetAttr(obj, attr_name);
11196 assert(!tp->tp_dictoffset);
11197 descr = _PyType_Lookup(tp, attr_name);
11198 if (unlikely(!descr)) {
11199 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
11202 #if PY_MAJOR_VERSION < 3
11203 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
11206 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
11208 PyObject *res =
f(descr, obj, (PyObject *)tp);
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);
11223 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
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();
11234 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
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);
11242 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
11243 if (unlikely(!result)) {
11244 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
11250 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
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);
11259 if (unlikely(ret < 0)) {
11263 Py_XDECREF(name_attr);
11266 static int __Pyx_setup_reduce(PyObject* type_obj) {
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);
11280 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
11281 if (!getstate && PyErr_Occurred()) {
11286 #if CYTHON_USE_PYTYPE_LOOKUP
11287 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
11289 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
11290 if (!object_getstate && PyErr_Occurred()) {
11294 if (object_getstate != getstate) {
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;
11301 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
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;
11308 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
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()) {
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()) {
11330 PyType_Modified((PyTypeObject*)type_obj);
11335 if (!PyErr_Occurred())
11336 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
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);
11345 Py_XDECREF(reduce);
11346 Py_XDECREF(reduce_ex);
11347 Py_XDECREF(reduce_cython);
11348 Py_XDECREF(setstate);
11349 Py_XDECREF(setstate_cython);
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)
11359 PyObject *result = 0;
11361 Py_ssize_t basicsize;
11362 #ifdef Py_LIMITED_API
11363 PyObject *py_basicsize;
11365 result = PyObject_GetAttrString(module, class_name);
11368 if (!PyType_Check(result)) {
11369 PyErr_Format(PyExc_TypeError,
11370 "%.200s.%.200s is not a type object",
11371 module_name, class_name);
11374 #ifndef Py_LIMITED_API
11375 basicsize = ((PyTypeObject *)result)->tp_basicsize;
11377 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
11380 basicsize = PyLong_AsSsize_t(py_basicsize);
11381 Py_DECREF(py_basicsize);
11383 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
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);
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);
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;
11407 return (PyTypeObject *)result;
11409 Py_XDECREF(result);
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;
11421 #if PY_MAJOR_VERSION < 3
11422 PyObject *py_import;
11423 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
11430 empty_list = PyList_New(0);
11435 global_dict = PyModule_GetDict(__pyx_m);
11438 empty_dict = PyDict_New();
11442 #if PY_MAJOR_VERSION >= 3
11444 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
11445 module = PyImport_ImportModuleLevelObject(
11446 name, global_dict, empty_dict, list, 1);
11448 if (!PyErr_ExceptionMatches(PyExc_ImportError))
11457 #if PY_MAJOR_VERSION < 3
11458 PyObject *py_level = PyInt_FromLong(level);
11461 module = PyObject_CallFunctionObjArgs(py_import,
11462 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
11463 Py_DECREF(py_level);
11465 module = PyImport_ImportModuleLevelObject(
11466 name, global_dict, empty_dict, list, level);
11471 #if PY_MAJOR_VERSION < 3
11472 Py_XDECREF(py_import);
11474 Py_XDECREF(empty_list);
11475 Py_XDECREF(empty_dict);
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));
11487 "cannot import name %S", name);
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);
11502 if (!PyType_Check((PyObject*)cached_type)) {
11503 PyErr_Format(PyExc_TypeError,
11504 "Shared Cython type %.200s is not a type object",
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",
11515 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
11517 if (PyType_Ready(type) < 0)
goto bad;
11518 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
11521 cached_type = type;
11524 Py_DECREF(fake_module);
11525 return cached_type;
11527 Py_XDECREF(cached_type);
11528 cached_type = NULL;
11533 #include <structmember.h>
11535 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
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);
11542 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
11544 if (unlikely(op->func_doc == NULL))
11547 Py_INCREF(Py_None);
11551 Py_INCREF(op->func_doc);
11552 return op->func_doc;
11555 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
11557 PyObject *tmp = op->func_doc;
11558 if (value == NULL) {
11562 op->func_doc = value;
11567 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
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);
11573 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
11575 if (unlikely(op->func_name == NULL))
11578 Py_INCREF(op->func_name);
11579 return op->func_name;
11582 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
11585 #if PY_MAJOR_VERSION >= 3
11586 if (unlikely(value == NULL || !PyUnicode_Check(value)))
11588 if (unlikely(value == NULL || !PyString_Check(value)))
11591 PyErr_SetString(PyExc_TypeError,
11592 "__name__ must be set to a string object");
11595 tmp = op->func_name;
11597 op->func_name = value;
11602 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
11604 Py_INCREF(op->func_qualname);
11605 return op->func_qualname;
11608 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
11611 #if PY_MAJOR_VERSION >= 3
11612 if (unlikely(value == NULL || !PyUnicode_Check(value)))
11614 if (unlikely(value == NULL || !PyString_Check(value)))
11617 PyErr_SetString(PyExc_TypeError,
11618 "__qualname__ must be set to a string object");
11621 tmp = op->func_qualname;
11623 op->func_qualname = value;
11628 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
11631 self = m->func_closure;
11638 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
11640 if (unlikely(op->func_dict == NULL)) {
11641 op->func_dict = PyDict_New();
11642 if (unlikely(op->func_dict == NULL))
11645 Py_INCREF(op->func_dict);
11646 return op->func_dict;
11649 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
11652 if (unlikely(value == NULL)) {
11653 PyErr_SetString(PyExc_TypeError,
11654 "function's dictionary may not be deleted");
11657 if (unlikely(!PyDict_Check(value))) {
11658 PyErr_SetString(PyExc_TypeError,
11659 "setting function's dictionary to a non-dict");
11662 tmp = op->func_dict;
11664 op->func_dict = value;
11669 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
11671 Py_INCREF(op->func_globals);
11672 return op->func_globals;
11675 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
11677 Py_INCREF(Py_None);
11681 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
11683 PyObject* result = (op->func_code) ? op->func_code : Py_None;
11688 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
11690 PyObject *res = op->defaults_getter((PyObject *) op);
11691 if (unlikely(!res))
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);
11699 op->defaults_tuple = PySequence_ITEM(res, 0);
11700 if (unlikely(!op->defaults_tuple)) result = -1;
11702 op->defaults_kwdict = PySequence_ITEM(res, 1);
11703 if (unlikely(!op->defaults_kwdict)) result = -1;
11710 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
11714 }
else if (value != Py_None && !PyTuple_Check(value)) {
11715 PyErr_SetString(PyExc_TypeError,
11716 "__defaults__ must be set to a tuple object");
11720 tmp = op->defaults_tuple;
11721 op->defaults_tuple = value;
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;
11740 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
11744 }
else if (value != Py_None && !PyDict_Check(value)) {
11745 PyErr_SetString(PyExc_TypeError,
11746 "__kwdefaults__ must be set to a dict object");
11750 tmp = op->defaults_kwdict;
11751 op->defaults_kwdict = value;
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;
11770 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
11772 if (!value || value == Py_None) {
11774 }
else if (!PyDict_Check(value)) {
11775 PyErr_SetString(PyExc_TypeError,
11776 "__annotations__ must be set to a dict object");
11780 tmp = op->func_annotations;
11781 op->func_annotations = value;
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;
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},
11817 static PyMemberDef __pyx_CyFunction_members[] = {
11818 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
11822 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
11824 #if PY_MAJOR_VERSION >= 3
11825 Py_INCREF(m->func_qualname);
11826 return m->func_qualname;
11828 return PyString_FromString(m->func.m_ml->ml_name);
11831 static PyMethodDef __pyx_CyFunction_methods[] = {
11832 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
11835 #if PY_VERSION_HEX < 0x030500A0
11836 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
11838 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
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))
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);
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;
11872 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
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);
11887 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
11889 for (i = 0; i < m->defaults_pyobjects; i++)
11890 Py_XDECREF(pydefaults[i]);
11891 PyObject_Free(m->defaults);
11892 m->defaults = NULL;
11896 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
11898 if (__Pyx_CyFunction_weakreflist(m) != NULL)
11899 PyObject_ClearWeakRefs((PyObject *) m);
11900 __Pyx_CyFunction_clear(m);
11901 PyObject_GC_Del(m);
11903 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
11905 PyObject_GC_UnTrack(m);
11906 __Pyx__CyFunction_dealloc(m);
11908 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
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);
11922 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
11924 for (i = 0; i < m->defaults_pyobjects; i++)
11925 Py_VISIT(pydefaults[i]);
11929 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
11931 #if PY_MAJOR_VERSION < 3
11932 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
11933 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
11937 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
11939 type = (PyObject *)(Py_TYPE(obj));
11940 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
11942 if (obj == Py_None)
11945 return __Pyx_PyMethod_New(func, obj, type);
11948 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
11950 #if PY_MAJOR_VERSION >= 3
11951 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
11952 op->func_qualname, (
void *)op);
11954 return PyString_FromFormat(
"<cyfunction %s at %p>",
11955 PyString_AsString(op->func_qualname), (
void *)op);
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;
11962 switch (
f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
11964 if (likely(kw == NULL || PyDict_Size(kw) == 0))
11965 return (*meth)(
self, arg);
11967 case METH_VARARGS | METH_KEYWORDS:
11968 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
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);
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);
11988 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
11990 result = (*meth)(
self, arg0);
11991 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
11996 PyErr_Format(PyExc_TypeError,
11997 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
11998 f->m_ml->ml_name, size);
12003 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
12004 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
12005 "longer supported!");
12008 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
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);
12015 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
12017 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
12018 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
12020 PyObject *new_args;
12022 argc = PyTuple_GET_SIZE(args);
12023 new_args = PyTuple_GetSlice(args, 1, argc);
12024 if (unlikely(!new_args))
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);
12034 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
12035 Py_DECREF(new_args);
12037 result = __Pyx_CyFunction_Call(func, args, kw);
12041 static PyTypeObject __pyx_CyFunctionType_type = {
12042 PyVarObject_HEAD_INIT(0, 0)
12043 "cython_function_or_method",
12044 sizeof(__pyx_CyFunctionObject),
12046 (destructor) __Pyx_CyFunction_dealloc,
12050 #if PY_MAJOR_VERSION < 3
12055 (reprfunc) __Pyx_CyFunction_repr,
12060 __Pyx_CyFunction_CallAsMethod,
12065 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
12067 (traverseproc) __Pyx_CyFunction_traverse,
12068 (inquiry) __Pyx_CyFunction_clear,
12070 #
if PY_VERSION_HEX < 0x030500A0
12071 offsetof(__pyx_CyFunctionObject, func_weakreflist),
12073 offsetof(PyCFunctionObject, m_weakreflist),
12077 __pyx_CyFunction_methods,
12078 __pyx_CyFunction_members,
12079 __pyx_CyFunction_getsets,
12082 __Pyx_CyFunction_descr_get,
12084 offsetof(__pyx_CyFunctionObject, func_dict),
12097 #if PY_VERSION_HEX >= 0x030400a1
12100 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
12103 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
12106 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
12110 static int __pyx_CyFunction_init(
void) {
12111 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
12112 if (unlikely(__pyx_CyFunctionType == NULL)) {
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;
12127 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
12128 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12129 m->defaults_tuple = tuple;
12132 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
12133 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12134 m->defaults_kwdict = dict;
12137 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
12138 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12139 m->func_annotations = dict;
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
12151 PyObject_GC_Track(op);
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);
12164 #ifdef __Pyx_CyFunction_USED
12165 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
12167 if (likely(PyCFunction_Check(func)))
12170 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
12171 return __Pyx_PyObject_CallMethO(func, NULL);
12174 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
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)
12190 metaclass = tmptype;
12193 if (PyType_IsSubtype(metaclass, tmptype))
12195 if (PyType_IsSubtype(tmptype, metaclass)) {
12196 metaclass = tmptype;
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");
12207 #if PY_MAJOR_VERSION < 3
12208 metaclass = &PyClass_Type;
12210 metaclass = &PyType_Type;
12213 Py_INCREF((PyObject*) metaclass);
12214 return (PyObject*) metaclass;
12218 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
12219 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
12222 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
12224 PyObject *pargs = PyTuple_Pack(2, name, bases);
12225 if (unlikely(!pargs)) {
12229 ns = PyObject_Call(prep, pargs, mkw);
12233 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
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;
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))) {
12266 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
12267 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
12268 Py_XDECREF(owned_metaclass);
12269 if (unlikely(!metaclass))
12271 owned_metaclass = metaclass;
12273 margs = PyTuple_Pack(3, name, bases, dict);
12274 if (unlikely(!margs)) {
12277 result = PyObject_Call(metaclass, margs, mkw);
12280 Py_XDECREF(owned_metaclass);
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;
12292 if (unlikely(!__pyx_cython_runtime)) {
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))
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);
12316 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
12318 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
12321 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
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) {
12332 while (start < end) {
12333 mid = start + (end - start) / 2;
12334 if (code_line < entries[mid].code_line) {
12336 }
else if (code_line > entries[mid].code_line) {
12342 if (code_line <= entries[mid].code_line) {
12348 static PyCodeObject *__pyx_find_code_object(
int code_line) {
12349 PyCodeObject* code_object;
12351 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
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)) {
12358 code_object = __pyx_code_cache.entries[
pos].code_object;
12359 Py_INCREF(code_object);
12360 return code_object;
12362 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
12364 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
12365 if (unlikely(!code_line)) {
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);
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;
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)) {
12394 __pyx_code_cache.entries = entries;
12395 __pyx_code_cache.max_count = new_max;
12397 for (i=__pyx_code_cache.count; i>
pos; i--) {
12398 entries[i] = entries[i-1];
12400 entries[
pos].code_line = code_line;
12401 entries[
pos].code_object = code_object;
12402 __pyx_code_cache.count++;
12403 Py_INCREF(code_object);
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
12414 #include "internal/pycore_frame.h"
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;
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;
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;
12438 #if PY_MAJOR_VERSION < 3
12439 py_funcname = PyString_FromString(funcname);
12440 if (!py_funcname)
goto bad;
12443 #if PY_MAJOR_VERSION < 3
12444 py_code = __Pyx_PyCode_New(
12461 Py_DECREF(py_srcfile);
12463 py_code = PyCode_NewEmpty(filename, funcname, py_line);
12465 Py_XDECREF(py_funcname);
12468 Py_XDECREF(py_funcname);
12469 #if PY_MAJOR_VERSION < 3
12470 Py_XDECREF(py_srcfile);
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;
12481 c_line = __Pyx_CLineForTraceback(tstate, c_line);
12483 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
12485 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
12486 py_code = __Pyx_CreateCodeObjectForTraceback(
12487 funcname, c_line, py_line, filename);
12492 Py_XDECREF(pvalue);
12493 Py_XDECREF(ptraceback);
12496 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
12497 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
12499 py_frame = PyFrame_New(
12505 if (!py_frame)
goto bad;
12506 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
12507 PyTraceBack_Here(py_frame);
12509 Py_XDECREF(py_code);
12510 Py_XDECREF(py_frame);
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);
12519 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
12520 PyObject *obj = view->obj;
12522 if (PyObject_CheckBuffer(obj)) {
12523 PyBuffer_Release(view);
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)\
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;\
12549 goto raise_overflow;\
12552 return (target_type) value;\
12556 #if CYTHON_CCOMPLEX
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);
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;
12567 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
12568 __pyx_t_float_complex
z;
12576 #if CYTHON_CCOMPLEX
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);
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;
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;
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;
12600 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
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);
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);
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);
12620 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12622 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
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);
12631 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
12632 __pyx_t_float_complex
z;
12637 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
12638 return (a.real == 0) && (a.imag == 0);
12640 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
12641 __pyx_t_float_complex
z;
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);
12651 return hypotf(
z.real,
z.imag);
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) {
12659 float denom = a.real * a.real + a.imag * a.imag;
12660 a.real = a.real / denom;
12661 a.imag = -a.imag / denom;
12664 switch ((
int)b.real) {
12672 return __Pyx_c_prod_float(a, a);
12674 z = __Pyx_c_prod_float(a, a);
12675 return __Pyx_c_prod_float(
z, a);
12677 z = __Pyx_c_prod_float(a, a);
12678 return __Pyx_c_prod_float(
z,
z);
12684 }
else if (b.imag == 0) {
12685 z.real = powf(a.real, b.real);
12688 }
else if (a.real > 0) {
12693 theta = atan2f(0.0, -1.0);
12696 r = __Pyx_c_abs_float(a);
12697 theta = atan2f(a.imag, a.real);
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);
12710 #if CYTHON_CCOMPLEX
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);
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;
12721 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
12722 __pyx_t_double_complex
z;
12730 #if CYTHON_CCOMPLEX
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);
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;
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;
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;
12754 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
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);
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);
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);
12774 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12776 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
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);
12785 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
12786 __pyx_t_double_complex
z;
12791 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
12792 return (a.real == 0) && (a.imag == 0);
12794 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
12795 __pyx_t_double_complex
z;
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);
12805 return hypot(
z.real,
z.imag);
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) {
12813 double denom = a.real * a.real + a.imag * a.imag;
12814 a.real = a.real / denom;
12815 a.imag = -a.imag / denom;
12818 switch ((
int)b.real) {
12826 return __Pyx_c_prod_double(a, a);
12828 z = __Pyx_c_prod_double(a, a);
12829 return __Pyx_c_prod_double(
z, a);
12831 z = __Pyx_c_prod_double(a, a);
12832 return __Pyx_c_prod_double(
z,
z);
12838 }
else if (b.imag == 0) {
12839 z.real = pow(a.real, b.real);
12842 }
else if (a.real > 0) {
12847 theta = atan2(0.0, -1.0);
12850 r = __Pyx_c_abs_double(a);
12851 theta = atan2(a.imag, a.real);
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);
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"
12869 const int neg_one = (int) -1, const_zero = (
int) 0;
12870 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12871 #pragma GCC diagnostic pop
12873 const int is_unsigned = neg_one > const_zero;
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);
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);
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);
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"
12907 const int neg_one = (int) -1, const_zero = (
int) 0;
12908 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
12909 #pragma GCC diagnostic pop
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))
12917 long val = PyInt_AS_LONG(x);
12918 if (is_unsigned && unlikely(val < 0)) {
12919 goto raise_neg_overflow;
12925 if (likely(PyLong_Check(x))) {
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])
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]));
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]));
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]));
12961 #if CYTHON_COMPILING_IN_CPYTHON
12962 if (unlikely(Py_SIZE(x) < 0)) {
12963 goto raise_neg_overflow;
12967 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
12968 if (unlikely(result < 0))
12970 if (unlikely(result == 1))
12971 goto raise_neg_overflow;
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))
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])
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])));
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])));
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])));
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])));
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])));
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])));
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))
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");
13058 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
13059 #if PY_MAJOR_VERSION < 3
13060 if (likely(
v) && !PyLong_Check(
v)) {
13062 v = PyNumber_Long(tmp);
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);
13081 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
13082 if (!tmp)
return (
int) -1;
13083 val = __Pyx_PyInt_As_int(tmp);
13088 PyErr_SetString(PyExc_OverflowError,
13089 "value too large to convert to int");
13091 raise_neg_overflow:
13092 PyErr_SetString(PyExc_OverflowError,
13093 "can't convert negative value to int");
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"
13103 const long neg_one = (long) -1, const_zero = (
long) 0;
13104 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13105 #pragma GCC diagnostic pop
13107 const int is_unsigned = neg_one > const_zero;
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);
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);
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);
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"
13141 const long neg_one = (long) -1, const_zero = (
long) 0;
13142 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13143 #pragma GCC diagnostic pop
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))
13151 long val = PyInt_AS_LONG(x);
13152 if (is_unsigned && unlikely(val < 0)) {
13153 goto raise_neg_overflow;
13159 if (likely(PyLong_Check(x))) {
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])
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]));
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]));
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]));
13195 #if CYTHON_COMPILING_IN_CPYTHON
13196 if (unlikely(Py_SIZE(x) < 0)) {
13197 goto raise_neg_overflow;
13201 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
13202 if (unlikely(result < 0))
13204 if (unlikely(result == 1))
13205 goto raise_neg_overflow;
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))
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])
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])));
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])));
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])));
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])));
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])));
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])));
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))
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");
13292 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
13293 #if PY_MAJOR_VERSION < 3
13294 if (likely(
v) && !PyLong_Check(
v)) {
13296 v = PyNumber_Long(tmp);
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);
13315 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
13316 if (!tmp)
return (
long) -1;
13317 val = __Pyx_PyInt_As_long(tmp);
13322 PyErr_SetString(PyExc_OverflowError,
13323 "value too large to convert to long");
13325 raise_neg_overflow:
13326 PyErr_SetString(PyExc_OverflowError,
13327 "can't convert negative value to long");
13332 #if CYTHON_COMPILING_IN_CPYTHON
13333 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
13339 return b == &PyBaseObject_Type;
13341 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
13343 if (a == b)
return 1;
13347 n = PyTuple_GET_SIZE(mro);
13348 for (i = 0; i <
n; i++) {
13349 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
13354 return __Pyx_InBases(a, b);
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;
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);
13369 res = PyObject_IsSubclass(err, exc_type2);
13370 if (unlikely(res == -1)) {
13371 PyErr_WriteUnraisable(err);
13375 __Pyx_ErrRestore(exception, value, tb);
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;
13382 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
13387 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
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;
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;
13401 if (likely(PyExceptionClass_Check(t))) {
13402 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
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);
13418 return PyErr_GivenExceptionMatches(err, exc_type);
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);
13427 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
13432 static int __Pyx_check_binary_version(
void) {
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);
13438 for (i = 0; i < 4; i++) {
13439 if (!ctversion[i]) {
13440 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
13443 if (rt_from_call[i] != ctversion[i]) {
13449 char rtversion[5] = {
'\0'};
13451 for (i=0; i<4; ++i) {
13452 if (rt_from_call[i] ==
'.') {
13453 if (found_dot)
break;
13455 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
13458 rtversion[i] = rt_from_call[i];
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);
13470 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
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);
13478 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
13481 if (t->is_unicode | t->is_str) {
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);
13487 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
13490 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
13495 if (PyObject_Hash(*t->p) == -1)
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));
13505 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
13507 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
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) {
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
13518 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
13520 for (
c = defenc_c;
c < end;
c++) {
13521 if ((
unsigned char) (*
c) >= 128) {
13522 PyUnicode_AsASCIIString(o);
13528 *length = PyBytes_GET_SIZE(defenc);
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);
13539 PyUnicode_AsASCIIString(o);
13543 return PyUnicode_AsUTF8AndSize(o, length);
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
13551 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13552 __Pyx_sys_getdefaultencoding_not_ascii &&
13554 PyUnicode_Check(o)) {
13555 return __Pyx_PyUnicode_AsStringAndSize(o, length);
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);
13566 int r = PyBytes_AsStringAndSize(o, &result, length);
13567 if (unlikely(
r < 0)) {
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);
13579 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
13581 if (unlikely(!x))
return -1;
13582 retval = __Pyx_PyObject_IsTrue(x);
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)) {
13600 PyErr_Format(PyExc_TypeError,
13601 "__%.4s__ returned non-%.4s (type %.200s)",
13602 type_name, type_name, Py_TYPE(result)->tp_name);
13606 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
13607 #if CYTHON_USE_TYPE_SLOTS
13608 PyNumberMethods *m;
13610 const char *name = NULL;
13611 PyObject *res = NULL;
13612 #if PY_MAJOR_VERSION < 3
13613 if (likely(PyInt_Check(x) || PyLong_Check(x)))
13615 if (likely(PyLong_Check(x)))
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) {
13623 res = m->nb_int(x);
13625 else if (m && m->nb_long) {
13627 res = m->nb_long(x);
13630 if (likely(m && m->nb_int)) {
13632 res = m->nb_int(x);
13636 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
13637 res = PyNumber_Int(x);
13641 #if PY_MAJOR_VERSION < 3
13642 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
13644 if (unlikely(!PyLong_CheckExact(res))) {
13646 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
13649 else if (!PyErr_Occurred()) {
13650 PyErr_SetString(PyExc_TypeError,
13651 "an integer is required");
13655 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
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);
13663 return PyInt_AsSsize_t(b);
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;
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]));
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]));
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]));
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]));
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]));
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]));
13709 return PyLong_AsSsize_t(b);
13711 x = PyNumber_Index(b);
13713 ival = PyInt_AsSsize_t(x);
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);
13727 x = PyNumber_Index(o);
13729 ival = PyInt_AsLong(x);
13734 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
13735 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
13737 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
13738 return PyInt_FromSize_t(ival);