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__mprans__MeshSmoothing
708 #define __PYX_HAVE_API__mprans__MeshSmoothing
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"
721 #include "pythread.h"
728 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
729 #define CYTHON_WITHOUT_ASSERTIONS
732 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
733 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
735 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
736 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
737 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
738 #define __PYX_DEFAULT_STRING_ENCODING ""
739 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
740 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
741 #define __Pyx_uchar_cast(c) ((unsigned char)c)
742 #define __Pyx_long_cast(x) ((long)x)
743 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
744 (sizeof(type) < sizeof(Py_ssize_t)) ||\
745 (sizeof(type) > sizeof(Py_ssize_t) &&\
746 likely(v < (type)PY_SSIZE_T_MAX ||\
747 v == (type)PY_SSIZE_T_MAX) &&\
748 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
749 v == (type)PY_SSIZE_T_MIN))) ||\
750 (sizeof(type) == sizeof(Py_ssize_t) &&\
751 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
752 v == (type)PY_SSIZE_T_MAX))) )
753 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
754 return (
size_t) i < (size_t) limit;
756 #if defined (__cplusplus) && __cplusplus >= 201103L
758 #define __Pyx_sst_abs(value) std::abs(value)
759 #elif SIZEOF_INT >= SIZEOF_SIZE_T
760 #define __Pyx_sst_abs(value) abs(value)
761 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
762 #define __Pyx_sst_abs(value) labs(value)
763 #elif defined (_MSC_VER)
764 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
765 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
766 #define __Pyx_sst_abs(value) llabs(value)
767 #elif defined (__GNUC__)
768 #define __Pyx_sst_abs(value) __builtin_llabs(value)
770 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
772 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
773 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
774 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
775 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
776 #define __Pyx_PyBytes_FromString PyBytes_FromString
777 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
778 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
779 #if PY_MAJOR_VERSION < 3
780 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
781 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
783 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
784 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
786 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
787 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
788 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
790 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
792 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
793 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
794 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
795 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
796 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
797 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
798 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
799 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
800 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
801 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
802 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
803 const Py_UNICODE *u_end =
u;
805 return (
size_t)(u_end -
u - 1);
807 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
808 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
809 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
810 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
811 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
812 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
813 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
814 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
815 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
816 #define __Pyx_PySequence_Tuple(obj)\
817 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
818 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
819 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
820 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
821 #if CYTHON_ASSUME_SAFE_MACROS
822 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
824 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
826 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
827 #if PY_MAJOR_VERSION >= 3
828 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
830 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
832 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
833 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
834 static int __Pyx_sys_getdefaultencoding_not_ascii;
835 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
837 PyObject* default_encoding = NULL;
838 PyObject* ascii_chars_u = NULL;
839 PyObject* ascii_chars_b = NULL;
840 const char* default_encoding_c;
841 sys = PyImport_ImportModule(
"sys");
843 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
845 if (!default_encoding)
goto bad;
846 default_encoding_c = PyBytes_AsString(default_encoding);
847 if (!default_encoding_c)
goto bad;
848 if (strcmp(default_encoding_c,
"ascii") == 0) {
849 __Pyx_sys_getdefaultencoding_not_ascii = 0;
851 char ascii_chars[128];
853 for (
c = 0;
c < 128;
c++) {
856 __Pyx_sys_getdefaultencoding_not_ascii = 1;
857 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
858 if (!ascii_chars_u)
goto bad;
859 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
860 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
863 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
867 Py_DECREF(ascii_chars_u);
868 Py_DECREF(ascii_chars_b);
870 Py_DECREF(default_encoding);
873 Py_XDECREF(default_encoding);
874 Py_XDECREF(ascii_chars_u);
875 Py_XDECREF(ascii_chars_b);
879 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
880 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
882 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
883 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
884 static char* __PYX_DEFAULT_STRING_ENCODING;
885 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
887 PyObject* default_encoding = NULL;
888 char* default_encoding_c;
889 sys = PyImport_ImportModule(
"sys");
891 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
893 if (!default_encoding)
goto bad;
894 default_encoding_c = PyBytes_AsString(default_encoding);
895 if (!default_encoding_c)
goto bad;
896 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
897 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
898 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
899 Py_DECREF(default_encoding);
902 Py_XDECREF(default_encoding);
910 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
911 #define likely(x) __builtin_expect(!!(x), 1)
912 #define unlikely(x) __builtin_expect(!!(x), 0)
914 #define likely(x) (x)
915 #define unlikely(x) (x)
917 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
919 static PyObject *__pyx_m = NULL;
920 static PyObject *__pyx_d;
921 static PyObject *__pyx_b;
922 static PyObject *__pyx_cython_runtime = NULL;
923 static PyObject *__pyx_empty_tuple;
924 static PyObject *__pyx_empty_bytes;
925 static PyObject *__pyx_empty_unicode;
926 static int __pyx_lineno;
927 static int __pyx_clineno = 0;
928 static const char * __pyx_cfilenm= __FILE__;
929 static const char *__pyx_filename;
932 #if !defined(CYTHON_CCOMPLEX)
933 #if defined(__cplusplus)
934 #define CYTHON_CCOMPLEX 1
935 #elif defined(_Complex_I)
936 #define CYTHON_CCOMPLEX 1
938 #define CYTHON_CCOMPLEX 0
948 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
950 #define _Complex_I 1.0fj
954 static const char *__pyx_f[] = {
955 "proteus/mprans/MeshSmoothing.pyx",
961 struct __pyx_memoryview_obj;
963 struct __pyx_memoryview_obj *memview;
966 Py_ssize_t strides[8];
967 Py_ssize_t suboffsets[8];
968 } __Pyx_memviewslice;
969 #define __Pyx_MemoryView_Len(m) (m.shape[0])
972 #include <pythread.h>
973 #ifndef CYTHON_ATOMICS
974 #define CYTHON_ATOMICS 1
976 #define __pyx_atomic_int_type int
977 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
978 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
980 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
981 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
982 #ifdef __PYX_DEBUG_ATOMICS
983 #warning "Using GNU atomics"
985 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
987 #undef __pyx_atomic_int_type
988 #define __pyx_atomic_int_type LONG
989 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
990 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
991 #ifdef __PYX_DEBUG_ATOMICS
992 #pragma message ("Using MSVC atomics")
994 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
995 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
996 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
997 #ifdef __PYX_DEBUG_ATOMICS
998 #warning "Using Intel atomics"
1001 #undef CYTHON_ATOMICS
1002 #define CYTHON_ATOMICS 0
1003 #ifdef __PYX_DEBUG_ATOMICS
1004 #warning "Not using atomics"
1007 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1009 #define __pyx_add_acquisition_count(memview)\
1010 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1011 #define __pyx_sub_acquisition_count(memview)\
1012 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1014 #define __pyx_add_acquisition_count(memview)\
1015 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1016 #define __pyx_sub_acquisition_count(memview)\
1017 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1021 #ifndef __PYX_FORCE_INIT_THREADS
1022 #define __PYX_FORCE_INIT_THREADS 0
1026 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1027 #define __Pyx_PyGILState_Release PyGILState_Release
1028 #define __Pyx_FastGIL_Remember()
1029 #define __Pyx_FastGIL_Forget()
1030 #define __Pyx_FastGilFuncInit()
1033 #define IS_UNSIGNED(type) (((type) -1) > 0)
1034 struct __Pyx_StructField_;
1035 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1038 struct __Pyx_StructField_* fields;
1040 size_t arraysize[8];
1046 typedef struct __Pyx_StructField_ {
1047 __Pyx_TypeInfo* type;
1050 } __Pyx_StructField;
1052 __Pyx_StructField* field;
1053 size_t parent_offset;
1054 } __Pyx_BufFmt_StackElem;
1056 __Pyx_StructField root;
1057 __Pyx_BufFmt_StackElem* head;
1059 size_t new_count, enc_count;
1060 size_t struct_alignment;
1065 char is_valid_array;
1066 } __Pyx_BufFmt_Context;
1076 typedef npy_int8 __pyx_t_5numpy_int8_t;
1085 typedef npy_int16 __pyx_t_5numpy_int16_t;
1094 typedef npy_int32 __pyx_t_5numpy_int32_t;
1103 typedef npy_int64 __pyx_t_5numpy_int64_t;
1112 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1121 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1130 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1139 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1148 typedef npy_float32 __pyx_t_5numpy_float32_t;
1157 typedef npy_float64 __pyx_t_5numpy_float64_t;
1166 typedef npy_long __pyx_t_5numpy_int_t;
1175 typedef npy_longlong __pyx_t_5numpy_long_t;
1184 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1193 typedef npy_ulong __pyx_t_5numpy_uint_t;
1202 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1211 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1220 typedef npy_intp __pyx_t_5numpy_intp_t;
1229 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1238 typedef npy_double __pyx_t_5numpy_float_t;
1247 typedef npy_double __pyx_t_5numpy_double_t;
1256 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1260 typedef ::std::complex< float > __pyx_t_float_complex;
1262 typedef float _Complex __pyx_t_float_complex;
1265 typedef struct {
float real, imag; } __pyx_t_float_complex;
1267 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1272 typedef ::std::complex< double > __pyx_t_double_complex;
1274 typedef double _Complex __pyx_t_double_complex;
1277 typedef struct {
double real, imag; } __pyx_t_double_complex;
1279 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1283 struct __pyx_obj_6mprans_13MeshSmoothing___pyx_scope_struct__getNonOwnedNodeValues;
1284 struct __pyx_obj_6mprans_13MeshSmoothing___pyx_scope_struct_1_genexpr;
1285 struct __pyx_obj_6mprans_13MeshSmoothing___pyx_scope_struct_2_genexpr;
1286 struct __pyx_array_obj;
1287 struct __pyx_MemviewEnum_obj;
1288 struct __pyx_memoryview_obj;
1289 struct __pyx_memoryviewslice_obj;
1298 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1307 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1316 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1325 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1326 struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesLaplace;
1327 struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesCentroid;
1328 struct __pyx_opt_args_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleNodes;
1329 struct __pyx_opt_args_6mprans_13MeshSmoothing_cyGetInverseMeanRatioSingleTriangle;
1330 struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesQuality;
1339 struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesLaplace {
1342 bool smoothBoundaries;
1343 __Pyx_memviewslice fixedNodesBoolArray;
1354 struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesCentroid {
1357 bool smoothBoundaries;
1368 struct __pyx_opt_args_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleNodes {
1380 struct __pyx_opt_args_6mprans_13MeshSmoothing_cyGetInverseMeanRatioSingleTriangle {
1392 struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesQuality {
1394 bool apply_directly;
1404 struct __pyx_obj_6mprans_13MeshSmoothing___pyx_scope_struct__getNonOwnedNodeValues {
1406 int __pyx_v_comm_size;
1417 struct __pyx_obj_6mprans_13MeshSmoothing___pyx_scope_struct_1_genexpr {
1419 struct __pyx_obj_6mprans_13MeshSmoothing___pyx_scope_struct__getNonOwnedNodeValues *__pyx_outer_scope;
1434 struct __pyx_obj_6mprans_13MeshSmoothing___pyx_scope_struct_2_genexpr {
1436 struct __pyx_obj_6mprans_13MeshSmoothing___pyx_scope_struct__getNonOwnedNodeValues *__pyx_outer_scope;
1451 struct __pyx_array_obj {
1453 struct __pyx_vtabstruct_array *__pyx_vtab;
1459 Py_ssize_t *_strides;
1460 Py_ssize_t itemsize;
1463 void (*callback_free_data)(
void *);
1465 int dtype_is_object;
1476 struct __pyx_MemviewEnum_obj {
1489 struct __pyx_memoryview_obj {
1491 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1494 PyObject *_array_interface;
1495 PyThread_type_lock lock;
1496 __pyx_atomic_int acquisition_count[2];
1497 __pyx_atomic_int *acquisition_count_aligned_p;
1500 int dtype_is_object;
1501 __Pyx_TypeInfo *typeinfo;
1512 struct __pyx_memoryviewslice_obj {
1513 struct __pyx_memoryview_obj __pyx_base;
1514 __Pyx_memviewslice from_slice;
1515 PyObject *from_object;
1516 PyObject *(*to_object_func)(
char *);
1517 int (*to_dtype_func)(
char *, PyObject *);
1530 struct __pyx_vtabstruct_array {
1531 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1533 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1544 struct __pyx_vtabstruct_memoryview {
1545 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1546 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1547 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1548 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1549 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1550 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1551 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1553 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1564 struct __pyx_vtabstruct__memoryviewslice {
1565 struct __pyx_vtabstruct_memoryview __pyx_base;
1567 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1571 #ifndef CYTHON_REFNANNY
1572 #define CYTHON_REFNANNY 0
1576 void (*INCREF)(
void*, PyObject*, int);
1577 void (*DECREF)(
void*, PyObject*, int);
1578 void (*GOTREF)(
void*, PyObject*, int);
1579 void (*GIVEREF)(
void*, PyObject*, int);
1580 void* (*SetupContext)(
const char*, int,
const char*);
1581 void (*FinishContext)(
void**);
1582 } __Pyx_RefNannyAPIStruct;
1583 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1584 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1585 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1587 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1589 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1590 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1591 PyGILState_Release(__pyx_gilstate_save);\
1593 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1596 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1597 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1599 #define __Pyx_RefNannyFinishContext()\
1600 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1601 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1602 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1603 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1604 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1605 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1606 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1607 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1608 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1610 #define __Pyx_RefNannyDeclarations
1611 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1612 #define __Pyx_RefNannyFinishContext()
1613 #define __Pyx_INCREF(r) Py_INCREF(r)
1614 #define __Pyx_DECREF(r) Py_DECREF(r)
1615 #define __Pyx_GOTREF(r)
1616 #define __Pyx_GIVEREF(r)
1617 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1618 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1619 #define __Pyx_XGOTREF(r)
1620 #define __Pyx_XGIVEREF(r)
1622 #define __Pyx_XDECREF_SET(r, v) do {\
1623 PyObject *tmp = (PyObject *) r;\
1624 r = v; __Pyx_XDECREF(tmp);\
1626 #define __Pyx_DECREF_SET(r, v) do {\
1627 PyObject *tmp = (PyObject *) r;\
1628 r = v; __Pyx_DECREF(tmp);\
1630 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1631 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1634 #if CYTHON_USE_TYPE_SLOTS
1635 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1637 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1641 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1644 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1645 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1648 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1651 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1652 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1653 const char* function_name);
1656 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1657 #define __Pyx_MEMVIEW_DIRECT 1
1658 #define __Pyx_MEMVIEW_PTR 2
1659 #define __Pyx_MEMVIEW_FULL 4
1660 #define __Pyx_MEMVIEW_CONTIG 8
1661 #define __Pyx_MEMVIEW_STRIDED 16
1662 #define __Pyx_MEMVIEW_FOLLOW 32
1663 #define __Pyx_IS_C_CONTIG 1
1664 #define __Pyx_IS_F_CONTIG 2
1665 static int __Pyx_init_memviewslice(
1666 struct __pyx_memoryview_obj *memview,
1668 __Pyx_memviewslice *memviewslice,
1669 int memview_is_new_reference);
1670 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1671 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1672 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1673 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1674 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1675 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1676 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1677 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1678 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1679 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1682 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1683 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1684 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1685 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1686 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1687 (cache_var) = (value);
1688 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1689 static PY_UINT64_T __pyx_dict_version = 0;\
1690 static PyObject *__pyx_dict_cached_value = NULL;\
1691 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1692 (VAR) = __pyx_dict_cached_value;\
1694 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1695 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1698 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1699 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1700 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1702 #define __PYX_GET_DICT_VERSION(dict) (0)
1703 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1704 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1708 #if CYTHON_USE_DICT_VERSIONS
1709 #define __Pyx_GetModuleGlobalName(var, name) {\
1710 static PY_UINT64_T __pyx_dict_version = 0;\
1711 static PyObject *__pyx_dict_cached_value = NULL;\
1712 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1713 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1714 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1716 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1717 PY_UINT64_T __pyx_dict_version;\
1718 PyObject *__pyx_dict_cached_value;\
1719 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1721 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1723 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1724 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1725 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1729 #if CYTHON_FAST_PYCCALL
1730 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1732 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1736 #if CYTHON_FAST_PYCALL
1737 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1738 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1739 #if 1 || PY_VERSION_HEX < 0x030600B1
1740 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1742 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1744 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1745 (sizeof(char [1 - 2*!(cond)]) - 1)
1746 #ifndef Py_MEMBER_SIZE
1747 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1749 #if CYTHON_FAST_PYCALL
1750 static size_t __pyx_pyframe_localsplus_offset = 0;
1751 #include "frameobject.h"
1752 #if PY_VERSION_HEX >= 0x030b00a6
1753 #ifndef Py_BUILD_CORE
1754 #define Py_BUILD_CORE 1
1756 #include "internal/pycore_frame.h"
1758 #define __Pxy_PyFrame_Initialize_Offsets()\
1759 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1760 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1761 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1762 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1763 #endif // CYTHON_FAST_PYCALL
1767 #if CYTHON_COMPILING_IN_CPYTHON
1768 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1770 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1774 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1777 #if CYTHON_COMPILING_IN_CPYTHON
1778 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1782 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1785 #if !CYTHON_COMPILING_IN_PYPY
1786 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1788 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1789 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1793 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1794 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1795 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1796 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1797 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1798 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1799 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1800 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1801 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1802 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1803 int wraparound,
int boundscheck);
1804 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1805 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1806 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1807 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1808 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1809 int wraparound,
int boundscheck);
1810 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1811 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1812 int is_list,
int wraparound,
int boundscheck);
1815 #if CYTHON_USE_TYPE_SLOTS
1816 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1818 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1822 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1823 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1824 PyListObject*
L = (PyListObject*) list;
1825 Py_ssize_t len = Py_SIZE(list);
1826 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
1828 PyList_SET_ITEM(list, len, x);
1829 __Pyx_SET_SIZE(list, len + 1);
1832 return PyList_Append(list, x);
1835 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1839 static CYTHON_INLINE
int __Pyx_IterFinish(
void);
1842 static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable,
int is_set,
1843 Py_ssize_t* p_orig_length,
int* p_source_is_set);
1844 static CYTHON_INLINE
int __Pyx_set_iter_next(
1845 PyObject* iter_obj, Py_ssize_t orig_length,
1846 Py_ssize_t* ppos, PyObject **value,
1850 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1851 int result = PySequence_Contains(seq, item);
1852 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1856 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1859 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1862 #if CYTHON_COMPILING_IN_CPYTHON
1863 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1865 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1869 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1870 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1871 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1872 (likely(PyDict_CheckExact(obj)) ?\
1873 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1875 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1876 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1880 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1881 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1882 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1883 int has_cstart,
int has_cstop,
int wraparound);
1886 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1887 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1888 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
1889 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
1890 __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
1891 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *
v);
1892 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *
v,
1893 int is_list,
int wraparound,
int boundscheck);
1896 #if CYTHON_FAST_THREAD_STATE
1897 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1898 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1899 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1901 #define __Pyx_PyThreadState_declare
1902 #define __Pyx_PyThreadState_assign
1903 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1907 #if CYTHON_FAST_THREAD_STATE
1908 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1909 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1910 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1911 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1912 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1913 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1914 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1915 #if CYTHON_COMPILING_IN_CPYTHON
1916 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1918 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1921 #define __Pyx_PyErr_Clear() PyErr_Clear()
1922 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1923 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1924 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1925 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1926 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1927 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1928 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1932 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1933 int lineno,
const char *filename,
1934 int full_traceback,
int nogil);
1937 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1943 #if CYTHON_USE_EXC_INFO_STACK
1944 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1948 #if CYTHON_FAST_THREAD_STATE
1949 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1950 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1951 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1952 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1954 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1955 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1959 #if CYTHON_FAST_THREAD_STATE
1960 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1961 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1963 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1967 #if CYTHON_FAST_THREAD_STATE
1968 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1969 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1971 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1975 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1978 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1979 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1980 __Pyx__ArgTypeTest(obj, type, name, exact))
1981 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1984 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1987 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1990 #if PY_MAJOR_VERSION >= 3
1991 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1993 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1997 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1998 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2000 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2001 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2003 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2006 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
2008 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2010 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
2012 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2014 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
2016 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
2020 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2021 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2022 const char* encoding,
const char* errors,
2023 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
2026 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2029 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2032 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2035 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2038 #if CYTHON_FAST_THREAD_STATE
2039 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2040 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2042 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2046 #if CYTHON_COMPILING_IN_CPYTHON
2047 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2048 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2049 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2050 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2052 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2053 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2054 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2056 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2058 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2060 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2061 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2062 PyListObject*
L = (PyListObject*) list;
2063 Py_ssize_t len = Py_SIZE(list);
2064 if (likely(
L->allocated > len)) {
2066 PyList_SET_ITEM(list, len, x);
2067 __Pyx_SET_SIZE(list, len + 1);
2070 return PyList_Append(list, x);
2073 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2077 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
2078 #if CYTHON_COMPILING_IN_CPYTHON
2079 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
2080 if (unlikely(!none))
2085 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
2090 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2093 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2096 #if PY_MAJOR_VERSION < 3
2097 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
2098 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
2100 #define __Pyx_PyString_Join PyUnicode_Join
2101 #define __Pyx_PyBaseString_Join PyUnicode_Join
2103 #if CYTHON_COMPILING_IN_CPYTHON
2104 #if PY_MAJOR_VERSION < 3
2105 #define __Pyx_PyBytes_Join _PyString_Join
2107 #define __Pyx_PyBytes_Join _PyBytes_Join
2110 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2114 #if PY_MAJOR_VERSION >= 3
2115 #define __Pyx_PyObject_Unicode(obj)\
2116 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2118 #define __Pyx_PyObject_Unicode(obj)\
2119 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2123 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2124 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2126 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2130 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2131 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2133 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2137 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2140 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2143 static int __Pyx_setup_reduce(PyObject* type_obj);
2146 #ifndef __PYX_HAVE_RT_ImportType_proto
2147 #define __PYX_HAVE_RT_ImportType_proto
2148 enum __Pyx_ImportType_CheckSize {
2149 __Pyx_ImportType_CheckSize_Error = 0,
2150 __Pyx_ImportType_CheckSize_Warn = 1,
2151 __Pyx_ImportType_CheckSize_Ignore = 2
2153 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2157 #ifdef CYTHON_CLINE_IN_TRACEBACK
2158 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2160 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2165 PyCodeObject* code_object;
2167 } __Pyx_CodeObjectCacheEntry;
2168 struct __Pyx_CodeObjectCache {
2171 __Pyx_CodeObjectCacheEntry* entries;
2173 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2174 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2175 static PyCodeObject *__pyx_find_code_object(
int code_line);
2176 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2179 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2180 int py_line,
const char *filename);
2182 #if PY_MAJOR_VERSION < 3
2183 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2184 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2186 #define __Pyx_GetBuffer PyObject_GetBuffer
2187 #define __Pyx_ReleaseBuffer PyBuffer_Release
2193 Py_ssize_t shape, strides, suboffsets;
2194 } __Pyx_Buf_DimInfo;
2200 __Pyx_Buffer *rcbuffer;
2202 __Pyx_Buf_DimInfo diminfo[8];
2203 } __Pyx_LocalBuf_ND;
2206 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2209 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2210 __Pyx_memviewslice *slice2,
2211 int ndim,
size_t itemsize);
2214 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2217 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2220 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2221 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2222 __Pyx_BufFmt_StackElem* stack,
2223 __Pyx_TypeInfo* type);
2226 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2229 static int __Pyx_ValidateAndInit_memviewslice(
2234 __Pyx_TypeInfo *dtype,
2235 __Pyx_BufFmt_StackElem stack[],
2236 __Pyx_memviewslice *memviewslice,
2237 PyObject *original_obj);
2240 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *,
int writable_flag);
2243 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *,
int writable_flag);
2246 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2247 #define __Pyx_HAS_GCC_DIAGNOSTIC
2251 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2254 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *,
int writable_flag);
2257 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_double(PyObject *,
int writable_flag);
2260 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(PyObject *,
int writable_flag);
2263 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp);
2264 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj);
2267 static CYTHON_INLINE PyObject *__pyx_memview_get_int(
const char *itemp);
2268 static CYTHON_INLINE
int __pyx_memview_set_int(
const char *itemp, PyObject *obj);
2273 #define __Pyx_CREAL(z) ((z).real())
2274 #define __Pyx_CIMAG(z) ((z).imag())
2276 #define __Pyx_CREAL(z) (__real__(z))
2277 #define __Pyx_CIMAG(z) (__imag__(z))
2280 #define __Pyx_CREAL(z) ((z).real)
2281 #define __Pyx_CIMAG(z) ((z).imag)
2283 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2284 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2285 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2286 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2288 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2289 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2294 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2295 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2296 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2297 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2298 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2299 #define __Pyx_c_neg_float(a) (-(a))
2301 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2302 #define __Pyx_c_conj_float(z) (::std::conj(z))
2304 #define __Pyx_c_abs_float(z) (::std::abs(z))
2305 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2308 #define __Pyx_c_is_zero_float(z) ((z)==0)
2309 #define __Pyx_c_conj_float(z) (conjf(z))
2311 #define __Pyx_c_abs_float(z) (cabsf(z))
2312 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2316 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2317 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2318 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2319 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2320 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2321 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2322 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2323 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2325 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2326 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2332 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2333 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2334 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2335 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2336 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2337 #define __Pyx_c_neg_double(a) (-(a))
2339 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2340 #define __Pyx_c_conj_double(z) (::std::conj(z))
2342 #define __Pyx_c_abs_double(z) (::std::abs(z))
2343 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2346 #define __Pyx_c_is_zero_double(z) ((z)==0)
2347 #define __Pyx_c_conj_double(z) (conj(z))
2349 #define __Pyx_c_abs_double(z) (cabs(z))
2350 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2354 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2355 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2356 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2357 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2358 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2359 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2360 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2361 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2363 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2364 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2369 static __Pyx_memviewslice
2370 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2371 const char *mode,
int ndim,
2372 size_t sizeof_dtype,
int contig_flag,
2373 int dtype_is_object);
2376 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2379 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2382 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2385 struct __pyx_typeinfo_string {
2388 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2391 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2394 #define __pyx_memoryview_copy_slice_d_dc_double_c(slice)\
2395 __pyx_memoryview_copy_new_contig(&slice, "c", 2,\
2396 sizeof(double), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT),\
2400 #define __pyx_memoryview_copy_slice_dcd__double_f(slice)\
2401 __pyx_memoryview_copy_new_contig(&slice, "fortran", 2,\
2402 sizeof(double), (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT),\
2406 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2409 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2412 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2415 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
2418 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
2419 #if CYTHON_USE_EXC_INFO_STACK
2420 #define __Pyx_ExcInfoStruct _PyErr_StackItem
2424 PyObject *exc_value;
2425 PyObject *exc_traceback;
2426 } __Pyx_ExcInfoStruct;
2430 __pyx_coroutine_body_t body;
2432 __Pyx_ExcInfoStruct gi_exc_state;
2433 PyObject *gi_weakreflist;
2435 PyObject *yieldfrom;
2437 PyObject *gi_qualname;
2438 PyObject *gi_modulename;
2443 } __pyx_CoroutineObject;
2444 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
2445 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2446 PyObject *name, PyObject *qualname, PyObject *module_name);
2447 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
2448 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2449 PyObject *name, PyObject *qualname, PyObject *module_name);
2450 static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *
self);
2451 static int __Pyx_Coroutine_clear(PyObject *
self);
2452 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
2453 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
2454 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
2455 #if CYTHON_USE_EXC_INFO_STACK
2456 #define __Pyx_Coroutine_SwapException(self)
2457 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
2459 #define __Pyx_Coroutine_SwapException(self) {\
2460 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
2461 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
2463 #define __Pyx_Coroutine_ResetAndClearException(self) {\
2464 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
2465 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
2468 #if CYTHON_FAST_THREAD_STATE
2469 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2470 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
2472 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2473 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
2475 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
2476 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
2479 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
2482 static int __Pyx_patch_abc(
void);
2485 #define __Pyx_Generator_USED
2486 static PyTypeObject *__pyx_GeneratorType = 0;
2487 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
2488 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
2489 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
2490 static PyObject *__Pyx_Generator_Next(PyObject *
self);
2491 static int __pyx_Generator_init(
void);
2494 static int __Pyx_check_binary_version(
void);
2497 static int __Pyx_ExportFunction(
const char *name,
void (*
f)(
void),
const char *sig);
2500 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2502 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2503 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2504 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2505 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2506 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2507 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2508 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2509 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2510 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2511 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2514 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2527 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2540 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2541 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2542 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2543 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2544 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2545 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2546 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2547 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2548 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2549 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2550 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2551 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2552 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2553 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2554 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2561 static PyTypeObject *__pyx_ptype_6mprans_13MeshSmoothing___pyx_scope_struct__getNonOwnedNodeValues = 0;
2562 static PyTypeObject *__pyx_ptype_6mprans_13MeshSmoothing___pyx_scope_struct_1_genexpr = 0;
2563 static PyTypeObject *__pyx_ptype_6mprans_13MeshSmoothing___pyx_scope_struct_2_genexpr = 0;
2564 static PyTypeObject *__pyx_array_type = 0;
2565 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2566 static PyTypeObject *__pyx_memoryview_type = 0;
2567 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2568 static PyObject *
generic = 0;
2569 static PyObject *strided = 0;
2570 static PyObject *indirect = 0;
2571 static PyObject *contiguous = 0;
2572 static PyObject *indirect_contiguous = 0;
2573 static int __pyx_memoryview_thread_locks_used;
2574 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2575 static void __pyx_f_6mprans_13MeshSmoothing_cySmoothNodesLaplace(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesLaplace *__pyx_optional_args);
2576 static void __pyx_f_6mprans_13MeshSmoothing_cySmoothNodesCentroid(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int, __Pyx_memviewslice,
struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesCentroid *__pyx_optional_args);
2577 static void __pyx_f_6mprans_13MeshSmoothing_cyUpdateDilationElements(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2578 static void __pyx_f_6mprans_13MeshSmoothing_cyUpdateDistortionElements(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int,
int);
2579 static void __pyx_f_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleNodes(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
struct __pyx_opt_args_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleNodes *__pyx_optional_args);
2580 static void __pyx_f_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleElements(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2581 static double __pyx_f_6mprans_13MeshSmoothing_cyGetInverseMeanRatioSingleTriangle(
int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
struct __pyx_opt_args_6mprans_13MeshSmoothing_cyGetInverseMeanRatioSingleTriangle *__pyx_optional_args);
2582 static __Pyx_memviewslice __pyx_f_6mprans_13MeshSmoothing_cySmoothNodesQuality(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesQuality *__pyx_optional_args);
2583 static int __pyx_f_6mprans_13MeshSmoothing_pyxGetLocalNearestNode(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2584 static int __pyx_f_6mprans_13MeshSmoothing_pyxGetLocalNearestElement(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2585 static __Pyx_memviewslice __pyx_f_6mprans_13MeshSmoothing_pyxGetLocalNearestElementIntersection(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2586 static int __pyx_f_6mprans_13MeshSmoothing_pyxGetLocalNearestElementAroundNode(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2587 static void __pyx_f_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTetra(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2588 static void __pyx_f_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTriangle(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2589 static void __pyx_f_6mprans_13MeshSmoothing_cyUpdateElementVolumesTriangle(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2590 static void __pyx_f_6mprans_13MeshSmoothing_cyUpdateElementVolumesTetra(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2591 static void __pyx_f_6mprans_13MeshSmoothing_cyUpdateElementBarycenters(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2592 static PyArrayObject *__pyx_f_6mprans_13MeshSmoothing_cyGetCornerNodesTriangle(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2593 static __Pyx_memviewslice __pyx_f_6mprans_13MeshSmoothing_cyCheckOwnedVariable(
int,
int,
int, __Pyx_memviewslice, __Pyx_memviewslice);
2594 static __Pyx_memviewslice __pyx_f_6mprans_13MeshSmoothing_cyScalarRecoveryAtNodes(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice);
2595 static __Pyx_memviewslice __pyx_f_6mprans_13MeshSmoothing_cyScalarRecoveryAtNodesWeighted(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2596 static __Pyx_memviewslice __pyx_f_6mprans_13MeshSmoothing_cyVectorRecoveryAtNodesWeighted(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2597 static __Pyx_memviewslice __pyx_f_6mprans_13MeshSmoothing_cyVectorRecoveryAtNodes(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice,
int);
2598 static void __pyx_f_6mprans_13MeshSmoothing_cyFindBoundaryDirectionTriangle(__Pyx_memviewslice,
int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice);
2599 static void __pyx_f_6mprans_13MeshSmoothing_cyFindBoundaryDirectionTetra(__Pyx_memviewslice,
int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice);
2600 static double __pyx_f_6mprans_13MeshSmoothing_cyGetElementVolumeTriangle(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice);
2601 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2602 static void *__pyx_align_pointer(
void *,
size_t);
2603 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2604 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2605 static PyObject *_unellipsify(PyObject *,
int);
2606 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2607 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2608 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2609 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2610 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2611 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2612 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2613 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2614 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2615 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2616 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2617 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2618 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2619 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2620 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2621 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2622 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2623 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2624 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2625 static int __pyx_memoryview_err(PyObject *,
char *);
2626 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2627 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2628 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2629 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2630 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2631 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2632 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2633 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2634 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *);
2635 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2636 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2637 #define __Pyx_MODULE_NAME "mprans.MeshSmoothing"
2638 extern int __pyx_module_is_main_mprans__MeshSmoothing;
2639 int __pyx_module_is_main_mprans__MeshSmoothing = 0;
2642 static PyObject *__pyx_builtin_range;
2643 static PyObject *__pyx_builtin_enumerate;
2644 static PyObject *__pyx_builtin_ImportError;
2645 static PyObject *__pyx_builtin_ValueError;
2646 static PyObject *__pyx_builtin_MemoryError;
2647 static PyObject *__pyx_builtin_TypeError;
2648 static PyObject *__pyx_builtin_Ellipsis;
2649 static PyObject *__pyx_builtin_id;
2650 static PyObject *__pyx_builtin_IndexError;
2651 static const char __pyx_k_O[] =
"O";
2652 static const char __pyx_k_T[] =
"T{";
2653 static const char __pyx_k_c[] =
"c";
2654 static const char __pyx_k_i[] =
"i";
2655 static const char __pyx_k_s[] =
"(%s)";
2656 static const char __pyx_k_x[] =
"x";
2657 static const char __pyx_k_y[] =
"y";
2658 static const char __pyx_k_z[] =
"z";
2659 static const char __pyx_k_eN[] =
"eN";
2660 static const char __pyx_k_iN[] =
"iN";
2661 static const char __pyx_k_id[] =
"id";
2662 static const char __pyx_k_ii[] =
"ii";
2663 static const char __pyx_k_ir[] =
"ir";
2664 static const char __pyx_k_nA[] =
"nA";
2665 static const char __pyx_k_nB[] =
"nB";
2666 static const char __pyx_k_nC[] =
"nC";
2667 static const char __pyx_k_nd[] =
"nd";
2668 static const char __pyx_k_np[] =
"np";
2669 static const char __pyx_k_op[] =
"op";
2670 static const char __pyx_k_x2[] =
"x2";
2671 static const char __pyx_k_xi[] =
"xi";
2672 static const char __pyx_k_y2[] =
"y2";
2673 static const char __pyx_k_z2[] =
"z2";
2674 static const char __pyx_k_INT[] =
"INT";
2675 static const char __pyx_k_MPI[] =
"MPI";
2676 static const char __pyx_k_SUM[] =
"SUM";
2677 static const char __pyx_k__27[] =
"^";
2678 static const char __pyx_k__28[] =
"";
2679 static const char __pyx_k__29[] =
":";
2680 static const char __pyx_k__30[] =
"}";
2681 static const char __pyx_k__31[] =
",";
2682 static const char __pyx_k_dot[] =
"dot";
2683 static const char __pyx_k_get[] =
"get";
2684 static const char __pyx_k_inv[] =
"inv";
2685 static const char __pyx_k_new[] =
"__new__";
2686 static const char __pyx_k_obj[] =
"obj";
2687 static const char __pyx_k_Comm[] =
"Comm";
2688 static const char __pyx_k_args[] =
"args_";
2689 static const char __pyx_k_base[] =
"base";
2690 static const char __pyx_k_comm[] =
"comm";
2691 static const char __pyx_k_dict[] =
"__dict__";
2692 static const char __pyx_k_disp[] =
"disp";
2693 static const char __pyx_k_join[] =
"join";
2694 static const char __pyx_k_main[] =
"__main__";
2695 static const char __pyx_k_mesh[] =
"mesh";
2696 static const char __pyx_k_mode[] =
"mode";
2697 static const char __pyx_k_name[] =
"name";
2698 static const char __pyx_k_ndim[] =
"ndim";
2699 static const char __pyx_k_node[] =
"node";
2700 static const char __pyx_k_pack[] =
"pack";
2701 static const char __pyx_k_rank[] =
"rank";
2702 static const char __pyx_k_root[] =
"root";
2703 static const char __pyx_k_send[] =
"send";
2704 static const char __pyx_k_size[] =
"size";
2705 static const char __pyx_k_step[] =
"step";
2706 static const char __pyx_k_stop[] =
"stop";
2707 static const char __pyx_k_test[] =
"__test__";
2708 static const char __pyx_k_ASCII[] =
"ASCII";
2709 static const char __pyx_k_alpha[] =
"alpha";
2710 static const char __pyx_k_array[] =
"array";
2711 static const char __pyx_k_class[] =
"__class__";
2712 static const char __pyx_k_close[] =
"close";
2713 static const char __pyx_k_dtype[] =
"dtype";
2714 static const char __pyx_k_error[] =
"error";
2715 static const char __pyx_k_flags[] =
"flags";
2716 static const char __pyx_k_int32[] =
"int32";
2717 static const char __pyx_k_maxit[] =
"maxit";
2718 static const char __pyx_k_node0[] =
"node0";
2719 static const char __pyx_k_numpy[] =
"numpy";
2720 static const char __pyx_k_range[] =
"range";
2721 static const char __pyx_k_shape[] =
"shape";
2722 static const char __pyx_k_start[] =
"start";
2723 static const char __pyx_k_throw[] =
"throw";
2724 static const char __pyx_k_zeros[] =
"zeros";
2725 static const char __pyx_k_Commit[] =
"Commit";
2726 static const char __pyx_k_DOUBLE[] =
"DOUBLE";
2727 static const char __pyx_k_append[] =
"append";
2728 static const char __pyx_k_args_2[] =
"args";
2729 static const char __pyx_k_astype[] =
"astype";
2730 static const char __pyx_k_coords[] =
"coords";
2731 static const char __pyx_k_double[] =
"double";
2732 static const char __pyx_k_encode[] =
"encode";
2733 static const char __pyx_k_format[] =
"format";
2734 static const char __pyx_k_import[] =
"__import__";
2735 static const char __pyx_k_linalg[] =
"linalg";
2736 static const char __pyx_k_mpi4py[] =
"mpi4py";
2737 static const char __pyx_k_nNodes[] =
"nNodes";
2738 static const char __pyx_k_name_2[] =
"__name__";
2739 static const char __pyx_k_pickle[] =
"pickle";
2740 static const char __pyx_k_reduce[] =
"__reduce__";
2741 static const char __pyx_k_result[] =
"result";
2742 static const char __pyx_k_struct[] =
"struct";
2743 static const char __pyx_k_sumtot[] =
"sumtot";
2744 static const char __pyx_k_unpack[] =
"unpack";
2745 static const char __pyx_k_update[] =
"update";
2746 static const char __pyx_k_Gatherv[] =
"Gatherv";
2747 static const char __pyx_k_J_array[] =
"J_array";
2748 static const char __pyx_k_eOffset[] =
"eOffset";
2749 static const char __pyx_k_fortran[] =
"fortran";
2750 static const char __pyx_k_genexpr[] =
"genexpr";
2751 static const char __pyx_k_memview[] =
"memview";
2752 static const char __pyx_k_my_rank[] =
"my_rank";
2753 static const char __pyx_k_my_size[] =
"my_size";
2754 static const char __pyx_k_proteus[] =
"proteus";
2755 static const char __pyx_k_scalars[] =
"scalars";
2756 static const char __pyx_k_vectors[] =
"vectors";
2757 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2758 static const char __pyx_k_datatype[] =
"datatype";
2759 static const char __pyx_k_dilation[] =
"dilation";
2760 static const char __pyx_k_femSpace[] =
"femSpace";
2761 static const char __pyx_k_getstate[] =
"__getstate__";
2762 static const char __pyx_k_itemsize[] =
"itemsize";
2763 static const char __pyx_k_logEvent[] =
"logEvent";
2764 static const char __pyx_k_new_rank[] =
"new_rank";
2765 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2766 static const char __pyx_k_setstate[] =
"__setstate__";
2767 static const char __pyx_k_tompi4py[] =
"tompi4py";
2768 static const char __pyx_k_TypeError[] =
"TypeError";
2769 static const char __pyx_k_allreduce[] =
"allreduce";
2770 static const char __pyx_k_arg_2rank[] =
"arg_2rank";
2771 static const char __pyx_k_arg_shape[] =
"arg_shape";
2772 static const char __pyx_k_comm_size[] =
"comm_size";
2773 static const char __pyx_k_counts_in[] =
"counts_in";
2774 static const char __pyx_k_enumerate[] =
"enumerate";
2775 static const char __pyx_k_nElements[] =
"nElements";
2776 static const char __pyx_k_nodeArray[] =
"nodeArray_";
2777 static const char __pyx_k_onElement[] =
"onElement";
2778 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2779 static const char __pyx_k_rank_recv[] =
"rank_recv";
2780 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2781 static const char __pyx_k_transpose[] =
"transpose";
2782 static const char __pyx_k_IndexError[] =
"IndexError";
2783 static const char __pyx_k_ValueError[] =
"ValueError";
2784 static const char __pyx_k_array_size[] =
"array_size";
2785 static const char __pyx_k_counts_out[] =
"counts_out";
2786 static const char __pyx_k_detJ_array[] =
"detJ_array";
2787 static const char __pyx_k_distortion[] =
"distortion";
2788 static const char __pyx_k_el_average[] =
"el_average";
2789 static const char __pyx_k_nearest_eN[] =
"nearest_eN";
2790 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2791 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2792 static const char __pyx_k_zeros_like[] =
"zeros_like";
2793 static const char __pyx_k_ImportError[] =
"ImportError";
2794 static const char __pyx_k_MemoryError[] =
"MemoryError";
2795 static const char __pyx_k_PickleError[] =
"PickleError";
2796 static const char __pyx_k_elementMaps[] =
"elementMaps";
2797 static const char __pyx_k_nodeArray_2[] =
"nodeArray";
2798 static const char __pyx_k_nodes_2rank[] =
"nodes_2rank";
2799 static const char __pyx_k_arg_2doArray[] =
"arg_2doArray";
2800 static const char __pyx_k_nNodes_owned[] =
"nNodes_owned";
2801 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2802 static const char __pyx_k_shape_factor[] =
"shape_factor";
2803 static const char __pyx_k_simultaneous[] =
"simultaneous";
2804 static const char __pyx_k_stringsource[] =
"stringsource";
2805 static const char __pyx_k_IMRNodesArray[] =
"IMRNodesArray_";
2806 static const char __pyx_k_arg_shape_len[] =
"arg_shape_len";
2807 static const char __pyx_k_nNodes_global[] =
"nNodes_global";
2808 static const char __pyx_k_nodeStarArray[] =
"nodeStarArray";
2809 static const char __pyx_k_node_new_rank[] =
"node_new_rank";
2810 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2811 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2812 static const char __pyx_k_apply_directly[] =
"apply_directly";
2813 static const char __pyx_k_arg_shape_copy[] =
"arg_shape_copy";
2814 static const char __pyx_k_nodes_2doArray[] =
"nodes_2doArray";
2815 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2816 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2817 static const char __pyx_k_checkedElements[] =
"checkedElements";
2818 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2819 static const char __pyx_k_getInverseValue[] =
"getInverseValue";
2820 static const char __pyx_k_getLocalElement[] =
"getLocalElement";
2821 static const char __pyx_k_nodeStarOffsets[] =
"nodeStarOffsets";
2822 static const char __pyx_k_nodes_2rank_len[] =
"nodes_2rank_len";
2823 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2824 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2825 static const char __pyx_k_starting_coords[] =
"starting_coords";
2826 static const char __pyx_k_IMRElementsArray[] =
"IMRElementsArray_";
2827 static const char __pyx_k_arg_2rank_values[] =
"arg_2rank_values";
2828 static const char __pyx_k_displacements_in[] =
"displacements_in";
2829 static const char __pyx_k_nVariables_owned[] =
"nVariables_owned";
2830 static const char __pyx_k_referenceElement[] =
"referenceElement";
2831 static const char __pyx_k_smoothBoundaries[] =
"smoothBoundaries";
2832 static const char __pyx_k_Create_contiguous[] =
"Create_contiguous";
2833 static const char __pyx_k_displacements_out[] =
"displacements_out";
2834 static const char __pyx_k_elementNodesArray[] =
"elementNodesArray";
2835 static const char __pyx_k_nodeElementsArray[] =
"nodeElementsArray";
2836 static const char __pyx_k_nodeMaterialTypes[] =
"nodeMaterialTypes";
2837 static const char __pyx_k_proteus_Profiling[] =
"proteus.Profiling";
2838 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2839 static const char __pyx_k_variable_nb_local[] =
"variable_nb_local";
2840 static const char __pyx_k_checkOwnedVariable[] =
"checkOwnedVariable";
2841 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2842 static const char __pyx_k_elementVolumeArray[] =
"elementVolumeArray";
2843 static const char __pyx_k_nodeElementOffsets[] =
"nodeElementOffsets";
2844 static const char __pyx_k_nodes_2rank_values[] =
"nodes_2rank_values";
2845 static const char __pyx_k_patchBoundaryNodes[] =
"patchBoundaryNodes";
2846 static const char __pyx_k_smoothNodesLaplace[] =
"smoothNodesLaplace";
2847 static const char __pyx_k_smoothNodesQuality[] =
"smoothNodesQuality";
2848 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2849 static const char __pyx_k_elementVolumesArray[] =
"elementVolumesArray";
2850 static const char __pyx_k_fixedNodesBoolArray[] =
"fixedNodesBoolArray";
2851 static const char __pyx_k_getDilationElements[] =
"getDilationElements";
2852 static const char __pyx_k_getLocalNearestNode[] =
"getLocalNearestNode";
2853 static const char __pyx_k_smoothNodesCentroid[] =
"smoothNodesCentroid";
2854 static const char __pyx_k_elementDilationArray[] =
"elementDilationArray_";
2855 static const char __pyx_k_mprans_MeshSmoothing[] =
"mprans.MeshSmoothing";
2856 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2857 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2858 static const char __pyx_k_elementNeighborsArray[] =
"elementNeighborsArray";
2859 static const char __pyx_k_elementVolumesArray_2[] =
"elementVolumesArray_";
2860 static const char __pyx_k_error_looking_for_dir[] =
"error looking for dir_";
2861 static const char __pyx_k_getDistortionElements[] =
"getDistortionElements";
2862 static const char __pyx_k_getNonOwnedNodeValues[] =
"getNonOwnedNodeValues";
2863 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2864 static const char __pyx_k_elementBoundariesArray[] =
"elementBoundariesArray";
2865 static const char __pyx_k_elementDistortionArray[] =
"elementDistortionArray_";
2866 static const char __pyx_k_getCornerNodesTriangle[] =
"getCornerNodesTriangle";
2867 static const char __pyx_k_getLocalNearestElement[] =
"getLocalNearestElement";
2868 static const char __pyx_k_updateDilationElements[] =
"updateDilationElements";
2869 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2870 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2871 static const char __pyx_k_elementBarycentersArray[] =
"elementBarycentersArray";
2872 static const char __pyx_k_pyScalarRecoveryAtNodes[] =
"pyScalarRecoveryAtNodes";
2873 static const char __pyx_k_pyVectorRecoveryAtNodes[] =
"pyVectorRecoveryAtNodes";
2874 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2875 static const char __pyx_k_elementVolumeTargetArray[] =
"elementVolumeTargetArray";
2876 static const char __pyx_k_getElementVolumeTriangle[] =
"getElementVolumeTriangle";
2877 static const char __pyx_k_updateDistortionElements[] =
"updateDistortionElements";
2878 static const char __pyx_k_updateElementBarycenters[] =
"updateElementBarycenters";
2879 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2880 static const char __pyx_k_elementBarycentersArray_2[] =
"elementBarycentersArray_";
2881 static const char __pyx_k_elementBoundaryNodesArray[] =
"elementBoundaryNodesArray";
2882 static const char __pyx_k_updateElementVolumesTetra[] =
"updateElementVolumesTetra";
2883 static const char __pyx_k_elementBoundaryNormalsArray[] =
"elementBoundaryNormalsArray";
2884 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2885 static const char __pyx_k_nodeOffsets_subdomain_owned[] =
"nodeOffsets_subdomain_owned";
2886 static const char __pyx_k_elementBoundaryElementsArray[] =
"elementBoundaryElementsArray";
2887 static const char __pyx_k_updateElementVolumesTriangle[] =
"updateElementVolumesTriangle";
2888 static const char __pyx_k_elementBoundaryNormalsArray_2[] =
"elementBoundaryNormalsArray_";
2889 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2890 static const char __pyx_k_getElementBoundaryNormalsTetra[] =
"getElementBoundaryNormalsTetra";
2891 static const char __pyx_k_nodeNumbering_subdomain2global[] =
"nodeNumbering_subdomain2global";
2892 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2893 static const char __pyx_k_elementBoundaryBarycentersArray[] =
"elementBoundaryBarycentersArray";
2894 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2895 static const char __pyx_k_pyScalarRecoveryAtNodesWeighted[] =
"pyScalarRecoveryAtNodesWeighted";
2896 static const char __pyx_k_pyVectorRecoveryAtNodesWeighted[] =
"pyVectorRecoveryAtNodesWeighted";
2897 static const char __pyx_k_variableOffsets_subdomain_owned[] =
"variableOffsets_subdomain_owned";
2898 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2899 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2900 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2901 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2902 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2903 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2904 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2905 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2906 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2907 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2908 static const char __pyx_k_could_not_find_element_element_e[] =
"could not find element! (element {eN}: {x}, {y}, {z}), nearest_eN {nearest_eN}: closest coords: {x2}, {y2}, {z2}, after {maxit} iterations";
2909 static const char __pyx_k_exteriorElementBoundariesBoolArr[] =
"exteriorElementBoundariesBoolArray";
2910 static const char __pyx_k_getElementBoundaryNormalsTriangl[] =
"getElementBoundaryNormalsTriangle";
2911 static const char __pyx_k_getInverseMeanRatioSingleTriangl[] =
"getInverseMeanRatioSingleTriangle";
2912 static const char __pyx_k_getInverseMeanRatioTriangleEleme[] =
"getInverseMeanRatioTriangleElements";
2913 static const char __pyx_k_getInverseMeanRatioTriangleNodes[] =
"getInverseMeanRatioTriangleNodes";
2914 static const char __pyx_k_getLocalNearestElementAroundNode[] =
"getLocalNearestElementAroundNode";
2915 static const char __pyx_k_getLocalNearestElementIntersecti[] =
"getLocalNearestElementIntersection";
2916 static const char __pyx_k_getNonOwnedNodeValues_locals_gen[] =
"getNonOwnedNodeValues.<locals>.genexpr";
2917 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2918 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2919 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2920 static const char __pyx_k_proteus_mprans_MeshSmoothing_pyx[] =
"proteus/mprans/MeshSmoothing.pyx";
2921 static const char __pyx_k_smoothNodesQuality_is_work_in_pr[] =
"smoothNodesQuality is work in progress, do not use";
2922 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2923 static const char __pyx_k_updateElementBoundaryNormalsTetr[] =
"updateElementBoundaryNormalsTetra";
2924 static const char __pyx_k_updateElementBoundaryNormalsTria[] =
"updateElementBoundaryNormalsTriangle";
2925 static const char __pyx_k_updateInverseMeanRatioTriangleEl[] =
"updateInverseMeanRatioTriangleElements";
2926 static const char __pyx_k_updateInverseMeanRatioTriangleNo[] =
"updateInverseMeanRatioTriangleNodes";
2927 static const char __pyx_k_variableNumbering_subdomain2glob[] =
"variableNumbering_subdomain2global";
2928 static PyObject *__pyx_n_s_ASCII;
2929 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2930 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2931 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2932 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2933 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2934 static PyObject *__pyx_n_s_Comm;
2935 static PyObject *__pyx_n_s_Commit;
2936 static PyObject *__pyx_n_s_Create_contiguous;
2937 static PyObject *__pyx_n_s_DOUBLE;
2938 static PyObject *__pyx_n_s_Ellipsis;
2939 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2940 static PyObject *__pyx_n_s_Gatherv;
2941 static PyObject *__pyx_n_s_IMRElementsArray;
2942 static PyObject *__pyx_n_s_IMRNodesArray;
2943 static PyObject *__pyx_n_s_INT;
2944 static PyObject *__pyx_n_s_ImportError;
2945 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2946 static PyObject *__pyx_n_s_IndexError;
2947 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2948 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2949 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2950 static PyObject *__pyx_n_s_J_array;
2951 static PyObject *__pyx_n_s_MPI;
2952 static PyObject *__pyx_n_s_MemoryError;
2953 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2954 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2955 static PyObject *__pyx_n_b_O;
2956 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2957 static PyObject *__pyx_n_s_PickleError;
2958 static PyObject *__pyx_n_s_SUM;
2959 static PyObject *__pyx_kp_b_T;
2960 static PyObject *__pyx_n_s_TypeError;
2961 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2962 static PyObject *__pyx_n_s_ValueError;
2963 static PyObject *__pyx_n_s_View_MemoryView;
2964 static PyObject *__pyx_kp_b__27;
2965 static PyObject *__pyx_kp_b__28;
2966 static PyObject *__pyx_kp_b__29;
2967 static PyObject *__pyx_kp_b__30;
2968 static PyObject *__pyx_kp_u__31;
2969 static PyObject *__pyx_n_s_allocate_buffer;
2970 static PyObject *__pyx_n_s_allreduce;
2971 static PyObject *__pyx_n_s_alpha;
2972 static PyObject *__pyx_n_s_append;
2973 static PyObject *__pyx_n_s_apply_directly;
2974 static PyObject *__pyx_n_s_arg_2doArray;
2975 static PyObject *__pyx_n_s_arg_2rank;
2976 static PyObject *__pyx_n_s_arg_2rank_values;
2977 static PyObject *__pyx_n_s_arg_shape;
2978 static PyObject *__pyx_n_s_arg_shape_copy;
2979 static PyObject *__pyx_n_s_arg_shape_len;
2980 static PyObject *__pyx_n_s_args;
2981 static PyObject *__pyx_n_s_args_2;
2982 static PyObject *__pyx_n_s_array;
2983 static PyObject *__pyx_n_s_array_size;
2984 static PyObject *__pyx_n_s_astype;
2985 static PyObject *__pyx_n_s_base;
2986 static PyObject *__pyx_n_s_c;
2987 static PyObject *__pyx_n_u_c;
2988 static PyObject *__pyx_n_s_checkOwnedVariable;
2989 static PyObject *__pyx_n_s_checkedElements;
2990 static PyObject *__pyx_n_s_class;
2991 static PyObject *__pyx_n_s_cline_in_traceback;
2992 static PyObject *__pyx_n_s_close;
2993 static PyObject *__pyx_n_s_comm;
2994 static PyObject *__pyx_n_s_comm_size;
2995 static PyObject *__pyx_kp_s_contiguous_and_direct;
2996 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2997 static PyObject *__pyx_n_s_coords;
2998 static PyObject *__pyx_kp_s_could_not_find_element_element_e;
2999 static PyObject *__pyx_n_s_counts_in;
3000 static PyObject *__pyx_n_s_counts_out;
3001 static PyObject *__pyx_n_s_datatype;
3002 static PyObject *__pyx_n_s_detJ_array;
3003 static PyObject *__pyx_n_s_dict;
3004 static PyObject *__pyx_n_s_dilation;
3005 static PyObject *__pyx_n_s_disp;
3006 static PyObject *__pyx_n_s_displacements_in;
3007 static PyObject *__pyx_n_s_displacements_out;
3008 static PyObject *__pyx_n_s_distortion;
3009 static PyObject *__pyx_n_s_dot;
3010 static PyObject *__pyx_n_s_double;
3011 static PyObject *__pyx_n_s_dtype;
3012 static PyObject *__pyx_n_s_dtype_is_object;
3013 static PyObject *__pyx_n_s_eN;
3014 static PyObject *__pyx_n_s_eOffset;
3015 static PyObject *__pyx_n_s_el_average;
3016 static PyObject *__pyx_n_s_elementBarycentersArray;
3017 static PyObject *__pyx_n_s_elementBarycentersArray_2;
3018 static PyObject *__pyx_n_s_elementBoundariesArray;
3019 static PyObject *__pyx_n_s_elementBoundaryBarycentersArray;
3020 static PyObject *__pyx_n_s_elementBoundaryElementsArray;
3021 static PyObject *__pyx_n_s_elementBoundaryNodesArray;
3022 static PyObject *__pyx_n_s_elementBoundaryNormalsArray;
3023 static PyObject *__pyx_n_s_elementBoundaryNormalsArray_2;
3024 static PyObject *__pyx_n_s_elementDilationArray;
3025 static PyObject *__pyx_n_s_elementDistortionArray;
3026 static PyObject *__pyx_n_s_elementMaps;
3027 static PyObject *__pyx_n_s_elementNeighborsArray;
3028 static PyObject *__pyx_n_s_elementNodesArray;
3029 static PyObject *__pyx_n_s_elementVolumeArray;
3030 static PyObject *__pyx_n_s_elementVolumeTargetArray;
3031 static PyObject *__pyx_n_s_elementVolumesArray;
3032 static PyObject *__pyx_n_s_elementVolumesArray_2;
3033 static PyObject *__pyx_n_s_encode;
3034 static PyObject *__pyx_n_s_enumerate;
3035 static PyObject *__pyx_n_s_error;
3036 static PyObject *__pyx_kp_s_error_looking_for_dir;
3037 static PyObject *__pyx_n_s_exteriorElementBoundariesBoolArr;
3038 static PyObject *__pyx_n_s_femSpace;
3039 static PyObject *__pyx_n_s_fixedNodesBoolArray;
3040 static PyObject *__pyx_n_s_flags;
3041 static PyObject *__pyx_n_s_format;
3042 static PyObject *__pyx_n_s_fortran;
3043 static PyObject *__pyx_n_u_fortran;
3044 static PyObject *__pyx_n_s_genexpr;
3045 static PyObject *__pyx_n_s_get;
3046 static PyObject *__pyx_n_s_getCornerNodesTriangle;
3047 static PyObject *__pyx_n_s_getDilationElements;
3048 static PyObject *__pyx_n_s_getDistortionElements;
3049 static PyObject *__pyx_n_s_getElementBoundaryNormalsTetra;
3050 static PyObject *__pyx_n_s_getElementBoundaryNormalsTriangl;
3051 static PyObject *__pyx_n_s_getElementVolumeTriangle;
3052 static PyObject *__pyx_n_s_getInverseMeanRatioSingleTriangl;
3053 static PyObject *__pyx_n_s_getInverseMeanRatioTriangleEleme;
3054 static PyObject *__pyx_n_s_getInverseMeanRatioTriangleNodes;
3055 static PyObject *__pyx_n_s_getInverseValue;
3056 static PyObject *__pyx_n_s_getLocalElement;
3057 static PyObject *__pyx_n_s_getLocalNearestElement;
3058 static PyObject *__pyx_n_s_getLocalNearestElementAroundNode;
3059 static PyObject *__pyx_n_s_getLocalNearestElementIntersecti;
3060 static PyObject *__pyx_n_s_getLocalNearestNode;
3061 static PyObject *__pyx_n_s_getNonOwnedNodeValues;
3062 static PyObject *__pyx_n_s_getNonOwnedNodeValues_locals_gen;
3063 static PyObject *__pyx_n_s_getstate;
3064 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
3065 static PyObject *__pyx_n_s_i;
3066 static PyObject *__pyx_n_s_iN;
3067 static PyObject *__pyx_n_s_id;
3068 static PyObject *__pyx_n_s_ii;
3069 static PyObject *__pyx_n_s_import;
3070 static PyObject *__pyx_n_s_int32;
3071 static PyObject *__pyx_n_s_inv;
3072 static PyObject *__pyx_n_s_ir;
3073 static PyObject *__pyx_n_s_itemsize;
3074 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
3075 static PyObject *__pyx_n_s_join;
3076 static PyObject *__pyx_n_s_linalg;
3077 static PyObject *__pyx_n_s_logEvent;
3078 static PyObject *__pyx_n_s_main;
3079 static PyObject *__pyx_n_s_maxit;
3080 static PyObject *__pyx_n_s_memview;
3081 static PyObject *__pyx_n_s_mesh;
3082 static PyObject *__pyx_n_s_mode;
3083 static PyObject *__pyx_n_s_mpi4py;
3084 static PyObject *__pyx_n_s_mprans_MeshSmoothing;
3085 static PyObject *__pyx_n_s_my_rank;
3086 static PyObject *__pyx_n_s_my_size;
3087 static PyObject *__pyx_n_s_nA;
3088 static PyObject *__pyx_n_s_nB;
3089 static PyObject *__pyx_n_s_nC;
3090 static PyObject *__pyx_n_s_nElements;
3091 static PyObject *__pyx_n_s_nNodes;
3092 static PyObject *__pyx_n_s_nNodes_global;
3093 static PyObject *__pyx_n_s_nNodes_owned;
3094 static PyObject *__pyx_n_s_nVariables_owned;
3095 static PyObject *__pyx_n_s_name;
3096 static PyObject *__pyx_n_s_name_2;
3097 static PyObject *__pyx_n_s_nd;
3098 static PyObject *__pyx_n_s_ndim;
3099 static PyObject *__pyx_n_s_nearest_eN;
3100 static PyObject *__pyx_n_s_new;
3101 static PyObject *__pyx_n_s_new_rank;
3102 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
3103 static PyObject *__pyx_n_s_node;
3104 static PyObject *__pyx_n_s_node0;
3105 static PyObject *__pyx_n_s_nodeArray;
3106 static PyObject *__pyx_n_s_nodeArray_2;
3107 static PyObject *__pyx_n_s_nodeElementOffsets;
3108 static PyObject *__pyx_n_s_nodeElementsArray;
3109 static PyObject *__pyx_n_s_nodeMaterialTypes;
3110 static PyObject *__pyx_n_s_nodeNumbering_subdomain2global;
3111 static PyObject *__pyx_n_s_nodeOffsets_subdomain_owned;
3112 static PyObject *__pyx_n_s_nodeStarArray;
3113 static PyObject *__pyx_n_s_nodeStarOffsets;
3114 static PyObject *__pyx_n_s_node_new_rank;
3115 static PyObject *__pyx_n_s_nodes_2doArray;
3116 static PyObject *__pyx_n_s_nodes_2rank;
3117 static PyObject *__pyx_n_s_nodes_2rank_len;
3118 static PyObject *__pyx_n_s_nodes_2rank_values;
3119 static PyObject *__pyx_n_s_np;
3120 static PyObject *__pyx_n_s_numpy;
3121 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
3122 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
3123 static PyObject *__pyx_n_s_obj;
3124 static PyObject *__pyx_n_s_onElement;
3125 static PyObject *__pyx_n_s_op;
3126 static PyObject *__pyx_n_s_pack;
3127 static PyObject *__pyx_n_s_patchBoundaryNodes;
3128 static PyObject *__pyx_n_s_pickle;
3129 static PyObject *__pyx_n_s_proteus;
3130 static PyObject *__pyx_n_s_proteus_Profiling;
3131 static PyObject *__pyx_kp_s_proteus_mprans_MeshSmoothing_pyx;
3132 static PyObject *__pyx_n_s_pyScalarRecoveryAtNodes;
3133 static PyObject *__pyx_n_s_pyScalarRecoveryAtNodesWeighted;
3134 static PyObject *__pyx_n_s_pyVectorRecoveryAtNodes;
3135 static PyObject *__pyx_n_s_pyVectorRecoveryAtNodesWeighted;
3136 static PyObject *__pyx_n_s_pyx_PickleError;
3137 static PyObject *__pyx_n_s_pyx_checksum;
3138 static PyObject *__pyx_n_s_pyx_getbuffer;
3139 static PyObject *__pyx_n_s_pyx_result;
3140 static PyObject *__pyx_n_s_pyx_state;
3141 static PyObject *__pyx_n_s_pyx_type;
3142 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
3143 static PyObject *__pyx_n_s_pyx_vtable;
3144 static PyObject *__pyx_n_s_range;
3145 static PyObject *__pyx_n_s_rank;
3146 static PyObject *__pyx_n_s_rank_recv;
3147 static PyObject *__pyx_n_s_reduce;
3148 static PyObject *__pyx_n_s_reduce_cython;
3149 static PyObject *__pyx_n_s_reduce_ex;
3150 static PyObject *__pyx_n_s_referenceElement;
3151 static PyObject *__pyx_n_s_result;
3152 static PyObject *__pyx_n_s_root;
3153 static PyObject *__pyx_kp_u_s;
3154 static PyObject *__pyx_n_s_scalars;
3155 static PyObject *__pyx_n_s_send;
3156 static PyObject *__pyx_n_s_setstate;
3157 static PyObject *__pyx_n_s_setstate_cython;
3158 static PyObject *__pyx_n_s_shape;
3159 static PyObject *__pyx_n_s_shape_factor;
3160 static PyObject *__pyx_n_s_simultaneous;
3161 static PyObject *__pyx_n_s_size;
3162 static PyObject *__pyx_n_s_smoothBoundaries;
3163 static PyObject *__pyx_n_s_smoothNodesCentroid;
3164 static PyObject *__pyx_n_s_smoothNodesLaplace;
3165 static PyObject *__pyx_n_s_smoothNodesQuality;
3166 static PyObject *__pyx_kp_s_smoothNodesQuality_is_work_in_pr;
3167 static PyObject *__pyx_n_s_start;
3168 static PyObject *__pyx_n_s_starting_coords;
3169 static PyObject *__pyx_n_s_step;
3170 static PyObject *__pyx_n_s_stop;
3171 static PyObject *__pyx_kp_s_strided_and_direct;
3172 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3173 static PyObject *__pyx_kp_s_strided_and_indirect;
3174 static PyObject *__pyx_kp_s_stringsource;
3175 static PyObject *__pyx_n_s_struct;
3176 static PyObject *__pyx_n_s_sumtot;
3177 static PyObject *__pyx_n_s_test;
3178 static PyObject *__pyx_n_s_throw;
3179 static PyObject *__pyx_n_s_tompi4py;
3180 static PyObject *__pyx_n_s_transpose;
3181 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3182 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3183 static PyObject *__pyx_n_s_unpack;
3184 static PyObject *__pyx_n_s_update;
3185 static PyObject *__pyx_n_s_updateDilationElements;
3186 static PyObject *__pyx_n_s_updateDistortionElements;
3187 static PyObject *__pyx_n_s_updateElementBarycenters;
3188 static PyObject *__pyx_n_s_updateElementBoundaryNormalsTetr;
3189 static PyObject *__pyx_n_s_updateElementBoundaryNormalsTria;
3190 static PyObject *__pyx_n_s_updateElementVolumesTetra;
3191 static PyObject *__pyx_n_s_updateElementVolumesTriangle;
3192 static PyObject *__pyx_n_s_updateInverseMeanRatioTriangleEl;
3193 static PyObject *__pyx_n_s_updateInverseMeanRatioTriangleNo;
3194 static PyObject *__pyx_n_s_variableNumbering_subdomain2glob;
3195 static PyObject *__pyx_n_s_variableOffsets_subdomain_owned;
3196 static PyObject *__pyx_n_s_variable_nb_local;
3197 static PyObject *__pyx_n_s_vectors;
3198 static PyObject *__pyx_n_s_x;
3199 static PyObject *__pyx_n_s_x2;
3200 static PyObject *__pyx_n_s_xi;
3201 static PyObject *__pyx_n_s_y;
3202 static PyObject *__pyx_n_s_y2;
3203 static PyObject *__pyx_n_s_z;
3204 static PyObject *__pyx_n_s_z2;
3205 static PyObject *__pyx_n_s_zeros;
3206 static PyObject *__pyx_n_s_zeros_like;
3207 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_smoothNodesLaplace(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_nodeArray_, __Pyx_memviewslice __pyx_v_nodeStarOffsets, __Pyx_memviewslice __pyx_v_nodeStarArray, __Pyx_memviewslice __pyx_v_nodeMaterialTypes,
int __pyx_v_nNodes_owned,
int __pyx_v_nd,
bool __pyx_v_simultaneous,
bool __pyx_v_smoothBoundaries, __Pyx_memviewslice __pyx_v_fixedNodesBoolArray,
double __pyx_v_alpha);
3208 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_2smoothNodesCentroid(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_nodeArray_, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeMaterialTypes, __Pyx_memviewslice __pyx_v_elementBarycentersArray, __Pyx_memviewslice __pyx_v_elementVolumesArray, __Pyx_memviewslice __pyx_v_elementNodesArray,
int __pyx_v_nNodes_owned,
bool __pyx_v_simultaneous,
bool __pyx_v_smoothBoundaries, __Pyx_memviewslice __pyx_v_fixedNodesBoolArray,
double __pyx_v_alpha);
3209 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_4updateDilationElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_elementDilationArray_, __Pyx_memviewslice __pyx_v_elementVolumeArray, __Pyx_memviewslice __pyx_v_elementVolumeTargetArray,
int __pyx_v_nElements);
3210 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_6getDilationElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_elementVolumeArray, __Pyx_memviewslice __pyx_v_elementVolumeTargetArray);
3211 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_8updateDistortionElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_elementDistortionArray_, __Pyx_memviewslice __pyx_v_J_array, __Pyx_memviewslice __pyx_v_detJ_array,
int __pyx_v_nd,
int __pyx_v_nElements);
3212 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_10getDistortionElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_J_array, __Pyx_memviewslice __pyx_v_detJ_array,
int __pyx_v_nd);
3213 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_12updateInverseMeanRatioTriangleElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_IMRElementsArray_, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementNodesArray,
int __pyx_v_nElements);
3214 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_14getInverseMeanRatioTriangleElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementNodesArray);
3215 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_16updateInverseMeanRatioTriangleNodes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_IMRNodesArray_, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementNodesArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_nodeElementsArray,
int __pyx_v_nNodes,
int __pyx_v_nElements,
bool __pyx_v_el_average);
3216 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_18getInverseMeanRatioTriangleNodes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementNodesArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_nodeElementsArray,
bool __pyx_v_el_average);
3217 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_20getInverseMeanRatioSingleTriangle(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_node0, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementNodesArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_nodeElementsArray);
3218 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_22smoothNodesQuality(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_distortion, __Pyx_memviewslice __pyx_v_dilation, __Pyx_memviewslice __pyx_v_nodeArray,
int __pyx_v_nNodes_owned, __Pyx_memviewslice __pyx_v_nodeMaterialTypes, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_elementNodesArray, CYTHON_UNUSED
bool __pyx_v_apply_directly);
3219 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_24getLocalNearestNode(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_coords, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_nodeStarOffsets, __Pyx_memviewslice __pyx_v_nodeStarArray,
int __pyx_v_node);
3220 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_26getLocalNearestElement(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_coords, __Pyx_memviewslice __pyx_v_elementBarycentersArray, __Pyx_memviewslice __pyx_v_elementNeighborsArray,
int __pyx_v_eN);
3221 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_28getLocalNearestElementAroundNode(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_coords, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_elementBarycentersArray,
int __pyx_v_node);
3222 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_30getLocalNearestElementIntersection(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_coords, __Pyx_memviewslice __pyx_v_starting_coords, __Pyx_memviewslice __pyx_v_elementBoundaryNormalsArray, __Pyx_memviewslice __pyx_v_elementBoundariesArray, __Pyx_memviewslice __pyx_v_elementBoundaryBarycentersArray, __Pyx_memviewslice __pyx_v_elementBoundaryElementsArray, __Pyx_memviewslice __pyx_v_exteriorElementBoundariesBoolArray,
int __pyx_v_eN);
3223 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_32getLocalElement(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_femSpace, PyObject *__pyx_v_coords, PyObject *__pyx_v_node);
3224 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_34updateElementBoundaryNormalsTriangle(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_elementBoundaryNormalsArray_, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementBoundariesArray, __Pyx_memviewslice __pyx_v_elementBoundaryNodesArray, __Pyx_memviewslice __pyx_v_elementBoundaryBarycentersArray, __Pyx_memviewslice __pyx_v_elementBarycentersArray,
int __pyx_v_nElements);
3225 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_36getElementBoundaryNormalsTriangle(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementBoundariesArray, __Pyx_memviewslice __pyx_v_elementBoundaryNodesArray, __Pyx_memviewslice __pyx_v_elementBoundaryBarycentersArray, __Pyx_memviewslice __pyx_v_elementBarycentersArray);
3226 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_38updateElementBoundaryNormalsTetra(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_elementBoundaryNormalsArray_, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementBoundariesArray, __Pyx_memviewslice __pyx_v_elementBoundaryNodesArray, __Pyx_memviewslice __pyx_v_elementBoundaryBarycentersArray, __Pyx_memviewslice __pyx_v_elementBarycentersArray,
int __pyx_v_nElements);
3227 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_40getElementBoundaryNormalsTetra(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementBoundariesArray, __Pyx_memviewslice __pyx_v_elementBoundaryNodesArray, __Pyx_memviewslice __pyx_v_elementBoundaryBarycentersArray, __Pyx_memviewslice __pyx_v_elementBarycentersArray);
3228 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_42updateElementVolumesTriangle(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_elementVolumesArray_, __Pyx_memviewslice __pyx_v_elementNodesArray, __Pyx_memviewslice __pyx_v_nodeArray,
int __pyx_v_nElements);
3229 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_44getElementVolumeTriangle(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_nA, __Pyx_memviewslice __pyx_v_nB, __Pyx_memviewslice __pyx_v_nC);
3230 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_46updateElementVolumesTetra(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_elementVolumesArray_, __Pyx_memviewslice __pyx_v_elementNodesArray, __Pyx_memviewslice __pyx_v_nodeArray,
int __pyx_v_nElements);
3231 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_48updateElementBarycenters(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_elementBarycentersArray_, __Pyx_memviewslice __pyx_v_elementNodesArray, __Pyx_memviewslice __pyx_v_nodeArray,
int __pyx_v_nElements);
3232 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_50getCornerNodesTriangle(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_nodeStarArray, __Pyx_memviewslice __pyx_v_nodeStarOffsets, __Pyx_memviewslice __pyx_v_nodeMaterialTypes,
int __pyx_v_nNodes);
3233 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_21getNonOwnedNodeValues_genexpr(PyObject *__pyx_self);
3234 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_21getNonOwnedNodeValues_3genexpr(PyObject *__pyx_self);
3235 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_52getNonOwnedNodeValues(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args_,
int __pyx_v_nNodes_owned,
int __pyx_v_nNodes_global, __Pyx_memviewslice __pyx_v_nodeNumbering_subdomain2global, __Pyx_memviewslice __pyx_v_nodeOffsets_subdomain_owned);
3236 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_54checkOwnedVariable(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_variable_nb_local,
int __pyx_v_rank,
int __pyx_v_nVariables_owned, __Pyx_memviewslice __pyx_v_variableNumbering_subdomain2global, __Pyx_memviewslice __pyx_v_variableOffsets_subdomain_owned);
3237 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_56pyScalarRecoveryAtNodes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_scalars, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets);
3238 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_58pyScalarRecoveryAtNodesWeighted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_scalars, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_detJ_array,
int __pyx_v_nNodes);
3239 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_60pyVectorRecoveryAtNodes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vectors, PyObject *__pyx_v_nodeElementsArray, PyObject *__pyx_v_nodeElementOffsets, PyObject *__pyx_v_nd);
3240 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_62pyVectorRecoveryAtNodesWeighted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_vectors, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_detJ_array,
int __pyx_v_nd);
3241 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
3242 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
3243 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
3244 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
3245 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
3246 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
3247 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
3248 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
3249 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
3250 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3251 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
3252 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3253 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3254 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3255 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
3256 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
3257 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
3258 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
3259 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
3260 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3261 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3262 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3263 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3264 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3265 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3266 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3267 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3268 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3269 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
3270 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
3271 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
3272 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3273 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3274 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
3275 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
3276 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
3277 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3278 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3279 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3280 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3281 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3282 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
3283 static PyObject *__pyx_tp_new_6mprans_13MeshSmoothing___pyx_scope_struct__getNonOwnedNodeValues(PyTypeObject *t, PyObject *a, PyObject *k);
3284 static PyObject *__pyx_tp_new_6mprans_13MeshSmoothing___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k);
3285 static PyObject *__pyx_tp_new_6mprans_13MeshSmoothing___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k);
3286 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
3287 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
3288 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
3289 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
3290 static PyObject *__pyx_float_0_;
3291 static PyObject *__pyx_float_1_;
3292 static PyObject *__pyx_float_0_5;
3293 static PyObject *__pyx_int_0;
3294 static PyObject *__pyx_int_1;
3295 static PyObject *__pyx_int_2;
3296 static PyObject *__pyx_int_3;
3297 static PyObject *__pyx_int_4;
3298 static PyObject *__pyx_int_112105877;
3299 static PyObject *__pyx_int_136983863;
3300 static PyObject *__pyx_int_184977713;
3301 static PyObject *__pyx_int_neg_1;
3302 static __Pyx_memviewslice __pyx_k_;
3303 static __Pyx_memviewslice __pyx_k__2;
3304 static __Pyx_memviewslice __pyx_k__5;
3305 static PyObject *__pyx_slice__4;
3306 static PyObject *__pyx_tuple__3;
3307 static PyObject *__pyx_tuple__6;
3308 static PyObject *__pyx_tuple__7;
3309 static PyObject *__pyx_tuple__8;
3310 static PyObject *__pyx_tuple__9;
3311 static PyObject *__pyx_tuple__10;
3312 static PyObject *__pyx_tuple__11;
3313 static PyObject *__pyx_tuple__12;
3314 static PyObject *__pyx_tuple__13;
3315 static PyObject *__pyx_tuple__14;
3316 static PyObject *__pyx_tuple__15;
3317 static PyObject *__pyx_tuple__16;
3318 static PyObject *__pyx_tuple__17;
3319 static PyObject *__pyx_tuple__18;
3320 static PyObject *__pyx_tuple__19;
3321 static PyObject *__pyx_tuple__20;
3322 static PyObject *__pyx_tuple__21;
3323 static PyObject *__pyx_tuple__22;
3324 static PyObject *__pyx_tuple__23;
3325 static PyObject *__pyx_tuple__24;
3326 static PyObject *__pyx_tuple__25;
3327 static PyObject *__pyx_tuple__26;
3328 static PyObject *__pyx_tuple__32;
3329 static PyObject *__pyx_tuple__34;
3330 static PyObject *__pyx_tuple__36;
3331 static PyObject *__pyx_tuple__38;
3332 static PyObject *__pyx_tuple__40;
3333 static PyObject *__pyx_tuple__42;
3334 static PyObject *__pyx_tuple__44;
3335 static PyObject *__pyx_tuple__46;
3336 static PyObject *__pyx_tuple__48;
3337 static PyObject *__pyx_tuple__50;
3338 static PyObject *__pyx_tuple__52;
3339 static PyObject *__pyx_tuple__54;
3340 static PyObject *__pyx_tuple__56;
3341 static PyObject *__pyx_tuple__58;
3342 static PyObject *__pyx_tuple__60;
3343 static PyObject *__pyx_tuple__62;
3344 static PyObject *__pyx_tuple__64;
3345 static PyObject *__pyx_tuple__66;
3346 static PyObject *__pyx_tuple__68;
3347 static PyObject *__pyx_tuple__70;
3348 static PyObject *__pyx_tuple__72;
3349 static PyObject *__pyx_tuple__74;
3350 static PyObject *__pyx_tuple__76;
3351 static PyObject *__pyx_tuple__78;
3352 static PyObject *__pyx_tuple__80;
3353 static PyObject *__pyx_tuple__82;
3354 static PyObject *__pyx_tuple__84;
3355 static PyObject *__pyx_tuple__86;
3356 static PyObject *__pyx_tuple__88;
3357 static PyObject *__pyx_tuple__90;
3358 static PyObject *__pyx_tuple__92;
3359 static PyObject *__pyx_tuple__94;
3360 static PyObject *__pyx_tuple__96;
3361 static PyObject *__pyx_tuple__97;
3362 static PyObject *__pyx_tuple__98;
3363 static PyObject *__pyx_tuple__99;
3364 static PyObject *__pyx_tuple__100;
3365 static PyObject *__pyx_tuple__101;
3366 static PyObject *__pyx_codeobj__33;
3367 static PyObject *__pyx_codeobj__35;
3368 static PyObject *__pyx_codeobj__37;
3369 static PyObject *__pyx_codeobj__39;
3370 static PyObject *__pyx_codeobj__41;
3371 static PyObject *__pyx_codeobj__43;
3372 static PyObject *__pyx_codeobj__45;
3373 static PyObject *__pyx_codeobj__47;
3374 static PyObject *__pyx_codeobj__49;
3375 static PyObject *__pyx_codeobj__51;
3376 static PyObject *__pyx_codeobj__53;
3377 static PyObject *__pyx_codeobj__55;
3378 static PyObject *__pyx_codeobj__57;
3379 static PyObject *__pyx_codeobj__59;
3380 static PyObject *__pyx_codeobj__61;
3381 static PyObject *__pyx_codeobj__63;
3382 static PyObject *__pyx_codeobj__65;
3383 static PyObject *__pyx_codeobj__67;
3384 static PyObject *__pyx_codeobj__69;
3385 static PyObject *__pyx_codeobj__71;
3386 static PyObject *__pyx_codeobj__73;
3387 static PyObject *__pyx_codeobj__75;
3388 static PyObject *__pyx_codeobj__77;
3389 static PyObject *__pyx_codeobj__79;
3390 static PyObject *__pyx_codeobj__81;
3391 static PyObject *__pyx_codeobj__83;
3392 static PyObject *__pyx_codeobj__85;
3393 static PyObject *__pyx_codeobj__87;
3394 static PyObject *__pyx_codeobj__89;
3395 static PyObject *__pyx_codeobj__91;
3396 static PyObject *__pyx_codeobj__93;
3397 static PyObject *__pyx_codeobj__95;
3398 static PyObject *__pyx_codeobj__102;
3410 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_1smoothNodesLaplace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3411 static char __pyx_doc_6mprans_13MeshSmoothing_smoothNodesLaplace[] =
"\n Laplace Smoothing:\n Mesh nodes are displaced to the centroid of neighbouring nodes\n\n Parameters\n ----------\n nodeArray_: double[:,:]\n array of mesh nodes\n (!) will be modified with smoothing\n nodeStarOffsets: int[:]\n array to get offsets for neighbouring node numbers\n nodeStarArray: int[:]\n array of neighbouring nodes\n nodeMaterialTypes: int[:]\n array to know which node is interior node (materialType=0)\n nNodes_owned: int\n number of nodes owned\n nd: int\n number of dimensions (needed to find direction to smooth boundaries)\n simultaneous: bool\n if True: simultaneous smoothing\n if False: sequential smoothing\n smoothBoundaries: bool\n if True: boundaries are smoothed (only with surrounding boundary nodes)\n if False: boudnary nodes are fixed\n fixedNodesBoolArray: int[:]\n array of same length as nodeArray with:\n fixedNodesBoolArray[node] = 1 -> node is fixed\n fixedNodesBoolArray[node] = 0 -> node is not fixed\n alpha: double\n penalty term related to original position of nodes (0 <= alpha <= 1)\n ";
3412 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_1smoothNodesLaplace = {
"smoothNodesLaplace", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_1smoothNodesLaplace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mprans_13MeshSmoothing_smoothNodesLaplace};
3413 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_1smoothNodesLaplace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3414 __Pyx_memviewslice __pyx_v_nodeArray_ = { 0, 0, { 0 }, { 0 }, { 0 } };
3415 __Pyx_memviewslice __pyx_v_nodeStarOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
3416 __Pyx_memviewslice __pyx_v_nodeStarArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3417 __Pyx_memviewslice __pyx_v_nodeMaterialTypes = { 0, 0, { 0 }, { 0 }, { 0 } };
3418 int __pyx_v_nNodes_owned;
3420 bool __pyx_v_simultaneous;
3421 bool __pyx_v_smoothBoundaries;
3422 __Pyx_memviewslice __pyx_v_fixedNodesBoolArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3423 double __pyx_v_alpha;
3424 int __pyx_lineno = 0;
3425 const char *__pyx_filename = NULL;
3426 int __pyx_clineno = 0;
3427 PyObject *__pyx_r = 0;
3428 __Pyx_RefNannyDeclarations
3429 __Pyx_RefNannySetupContext(
"smoothNodesLaplace (wrapper)", 0);
3431 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodeArray,&__pyx_n_s_nodeStarOffsets,&__pyx_n_s_nodeStarArray,&__pyx_n_s_nodeMaterialTypes,&__pyx_n_s_nNodes_owned,&__pyx_n_s_nd,&__pyx_n_s_simultaneous,&__pyx_n_s_smoothBoundaries,&__pyx_n_s_fixedNodesBoolArray,&__pyx_n_s_alpha,0};
3432 PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
3433 if (unlikely(__pyx_kwds)) {
3435 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3437 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3439 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3441 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3443 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3445 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3447 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3449 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3451 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3453 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3455 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3458 default:
goto __pyx_L5_argtuple_error;
3460 kw_args = PyDict_Size(__pyx_kwds);
3463 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray)) != 0)) kw_args--;
3464 else goto __pyx_L5_argtuple_error;
3467 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeStarOffsets)) != 0)) kw_args--;
3469 __Pyx_RaiseArgtupleInvalid(
"smoothNodesLaplace", 0, 6, 10, 1); __PYX_ERR(0, 11, __pyx_L3_error)
3473 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeStarArray)) != 0)) kw_args--;
3475 __Pyx_RaiseArgtupleInvalid(
"smoothNodesLaplace", 0, 6, 10, 2); __PYX_ERR(0, 11, __pyx_L3_error)
3479 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeMaterialTypes)) != 0)) kw_args--;
3481 __Pyx_RaiseArgtupleInvalid(
"smoothNodesLaplace", 0, 6, 10, 3); __PYX_ERR(0, 11, __pyx_L3_error)
3485 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes_owned)) != 0)) kw_args--;
3487 __Pyx_RaiseArgtupleInvalid(
"smoothNodesLaplace", 0, 6, 10, 4); __PYX_ERR(0, 11, __pyx_L3_error)
3491 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
3493 __Pyx_RaiseArgtupleInvalid(
"smoothNodesLaplace", 0, 6, 10, 5); __PYX_ERR(0, 11, __pyx_L3_error)
3498 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_simultaneous);
3499 if (value) { values[6] = value; kw_args--; }
3504 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_smoothBoundaries);
3505 if (value) { values[7] = value; kw_args--; }
3510 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fixedNodesBoolArray);
3511 if (value) { values[8] = value; kw_args--; }
3516 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha);
3517 if (value) { values[9] = value; kw_args--; }
3520 if (unlikely(kw_args > 0)) {
3521 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"smoothNodesLaplace") < 0)) __PYX_ERR(0, 11, __pyx_L3_error)
3524 switch (PyTuple_GET_SIZE(__pyx_args)) {
3525 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3527 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3529 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3531 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3533 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3534 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3535 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3536 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3537 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3538 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3540 default:
goto __pyx_L5_argtuple_error;
3543 __pyx_v_nodeArray_ = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeArray_.memview)) __PYX_ERR(0, 11, __pyx_L3_error)
3544 __pyx_v_nodeStarOffsets = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeStarOffsets.memview)) __PYX_ERR(0, 12, __pyx_L3_error)
3545 __pyx_v_nodeStarArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeStarArray.memview)) __PYX_ERR(0, 13, __pyx_L3_error)
3546 __pyx_v_nodeMaterialTypes = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[3], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeMaterialTypes.memview)) __PYX_ERR(0, 14, __pyx_L3_error)
3547 __pyx_v_nNodes_owned = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nNodes_owned == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 15, __pyx_L3_error)
3548 __pyx_v_nd = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L3_error)
3550 __pyx_v_simultaneous = __Pyx_PyObject_IsTrue(values[6]);
if (unlikely((__pyx_v_simultaneous == ((
bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 17, __pyx_L3_error)
3560 __pyx_v_simultaneous = ((bool)0);
3563 __pyx_v_smoothBoundaries = __Pyx_PyObject_IsTrue(values[7]);
if (unlikely((__pyx_v_smoothBoundaries == ((
bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error)
3573 __pyx_v_smoothBoundaries = ((bool)1);
3576 __pyx_v_fixedNodesBoolArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[8], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_fixedNodesBoolArray.memview)) __PYX_ERR(0, 19, __pyx_L3_error)
3578 __pyx_v_fixedNodesBoolArray = __pyx_k_;
3579 __PYX_INC_MEMVIEW(&__pyx_v_fixedNodesBoolArray, 1);
3582 __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[9]);
if (unlikely((__pyx_v_alpha == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L3_error)
3584 __pyx_v_alpha = ((double)0.);
3587 goto __pyx_L4_argument_unpacking_done;
3588 __pyx_L5_argtuple_error:;
3589 __Pyx_RaiseArgtupleInvalid(
"smoothNodesLaplace", 0, 6, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 11, __pyx_L3_error)
3591 __Pyx_AddTraceback(
"mprans.MeshSmoothing.smoothNodesLaplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
3592 __Pyx_RefNannyFinishContext();
3594 __pyx_L4_argument_unpacking_done:;
3595 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_smoothNodesLaplace(__pyx_self, __pyx_v_nodeArray_, __pyx_v_nodeStarOffsets, __pyx_v_nodeStarArray, __pyx_v_nodeMaterialTypes, __pyx_v_nNodes_owned, __pyx_v_nd, __pyx_v_simultaneous, __pyx_v_smoothBoundaries, __pyx_v_fixedNodesBoolArray, __pyx_v_alpha);
3606 __Pyx_RefNannyFinishContext();
3610 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_smoothNodesLaplace(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_nodeArray_, __Pyx_memviewslice __pyx_v_nodeStarOffsets, __Pyx_memviewslice __pyx_v_nodeStarArray, __Pyx_memviewslice __pyx_v_nodeMaterialTypes,
int __pyx_v_nNodes_owned,
int __pyx_v_nd,
bool __pyx_v_simultaneous,
bool __pyx_v_smoothBoundaries, __Pyx_memviewslice __pyx_v_fixedNodesBoolArray,
double __pyx_v_alpha) {
3611 PyObject *__pyx_r = NULL;
3612 __Pyx_RefNannyDeclarations
3613 struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesLaplace __pyx_t_1;
3614 __Pyx_RefNannySetupContext(
"smoothNodesLaplace", 0);
3623 __pyx_t_1.__pyx_n = 4;
3624 __pyx_t_1.simultaneous = __pyx_v_simultaneous;
3625 __pyx_t_1.smoothBoundaries = __pyx_v_smoothBoundaries;
3626 __pyx_t_1.fixedNodesBoolArray = __pyx_v_fixedNodesBoolArray;
3627 __pyx_t_1.alpha = __pyx_v_alpha;
3628 __pyx_f_6mprans_13MeshSmoothing_cySmoothNodesLaplace(__pyx_v_nodeArray_, __pyx_v_nodeStarOffsets, __pyx_v_nodeStarArray, __pyx_v_nodeMaterialTypes, __pyx_v_nNodes_owned, __pyx_v_nd, &__pyx_t_1);
3639 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3640 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray_, 1);
3641 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeStarOffsets, 1);
3642 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeStarArray, 1);
3643 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeMaterialTypes, 1);
3644 __PYX_XDEC_MEMVIEW(&__pyx_v_fixedNodesBoolArray, 1);
3645 __Pyx_XGIVEREF(__pyx_r);
3646 __Pyx_RefNannyFinishContext();
3659 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_3smoothNodesCentroid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3660 static char __pyx_doc_6mprans_13MeshSmoothing_2smoothNodesCentroid[] =
"\n Centroid Smoothing:\n Mesh nodes are displaced to the centroid of the polygon/volume formed by\n neighbouring nodes\n\n Parameters\n ----------\n nodeArray_: double[:,:]\n array of mesh nodes\n (!) will be modified with smoothing\n nodeElementsOffsets: int[:]\n array to get offsets for neighbouring element numbers\n nodeElementsArray: int[:]\n array to get element number from nodeElementOffsets\n nodeMaterialTypes: int[:]\n array to know which node is interior node (materialType=0)\n elementBarycentersArray: double[:,:]\n barycenters of elements\n elementVolumesArray: double[:]\n volume of elements\n elementNodesArray: int[:,:]\n list of nodes per elements\n nNodes_owned: int\n number of nodes owned\n simultaneous: bool\n if True: simultaneous smoothing\n if False: sequential smoothing\n (!) will update areas/volumes and barycenters in this case\n smoothBoundaries: bool\n if True: boundaries are smoothed (only with surrounding boundary nodes)\n if False: boudnary nodes are fixed\n fixedNodesBoolArray: int[:]\n array of same length as nodeArray with:\n fixedNodesBoolArray[node] = 1 -> node is fixed\n fixedNodesBoolArray[node] = 0 -> node is not fixed\n alpha: double\n penalty term related to original position of nodes (0 <= alpha <= 1)\n ";
3661 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_3smoothNodesCentroid = {
"smoothNodesCentroid", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_3smoothNodesCentroid, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mprans_13MeshSmoothing_2smoothNodesCentroid};
3662 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_3smoothNodesCentroid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3663 __Pyx_memviewslice __pyx_v_nodeArray_ = { 0, 0, { 0 }, { 0 }, { 0 } };
3664 __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
3665 __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3666 __Pyx_memviewslice __pyx_v_nodeMaterialTypes = { 0, 0, { 0 }, { 0 }, { 0 } };
3667 __Pyx_memviewslice __pyx_v_elementBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3668 __Pyx_memviewslice __pyx_v_elementVolumesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3669 __Pyx_memviewslice __pyx_v_elementNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3670 int __pyx_v_nNodes_owned;
3671 bool __pyx_v_simultaneous;
3672 bool __pyx_v_smoothBoundaries;
3673 __Pyx_memviewslice __pyx_v_fixedNodesBoolArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3674 double __pyx_v_alpha;
3675 int __pyx_lineno = 0;
3676 const char *__pyx_filename = NULL;
3677 int __pyx_clineno = 0;
3678 PyObject *__pyx_r = 0;
3679 __Pyx_RefNannyDeclarations
3680 __Pyx_RefNannySetupContext(
"smoothNodesCentroid (wrapper)", 0);
3682 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodeArray,&__pyx_n_s_nodeElementOffsets,&__pyx_n_s_nodeElementsArray,&__pyx_n_s_nodeMaterialTypes,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementVolumesArray,&__pyx_n_s_elementNodesArray,&__pyx_n_s_nNodes_owned,&__pyx_n_s_simultaneous,&__pyx_n_s_smoothBoundaries,&__pyx_n_s_fixedNodesBoolArray,&__pyx_n_s_alpha,0};
3683 PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
3684 if (unlikely(__pyx_kwds)) {
3686 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3688 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3690 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3692 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3694 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3696 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3698 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3700 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3702 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3704 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3706 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3708 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3710 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3713 default:
goto __pyx_L5_argtuple_error;
3715 kw_args = PyDict_Size(__pyx_kwds);
3718 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray)) != 0)) kw_args--;
3719 else goto __pyx_L5_argtuple_error;
3722 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
3724 __Pyx_RaiseArgtupleInvalid(
"smoothNodesCentroid", 0, 8, 12, 1); __PYX_ERR(0, 64, __pyx_L3_error)
3728 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
3730 __Pyx_RaiseArgtupleInvalid(
"smoothNodesCentroid", 0, 8, 12, 2); __PYX_ERR(0, 64, __pyx_L3_error)
3734 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeMaterialTypes)) != 0)) kw_args--;
3736 __Pyx_RaiseArgtupleInvalid(
"smoothNodesCentroid", 0, 8, 12, 3); __PYX_ERR(0, 64, __pyx_L3_error)
3740 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
3742 __Pyx_RaiseArgtupleInvalid(
"smoothNodesCentroid", 0, 8, 12, 4); __PYX_ERR(0, 64, __pyx_L3_error)
3746 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementVolumesArray)) != 0)) kw_args--;
3748 __Pyx_RaiseArgtupleInvalid(
"smoothNodesCentroid", 0, 8, 12, 5); __PYX_ERR(0, 64, __pyx_L3_error)
3752 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
3754 __Pyx_RaiseArgtupleInvalid(
"smoothNodesCentroid", 0, 8, 12, 6); __PYX_ERR(0, 64, __pyx_L3_error)
3758 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes_owned)) != 0)) kw_args--;
3760 __Pyx_RaiseArgtupleInvalid(
"smoothNodesCentroid", 0, 8, 12, 7); __PYX_ERR(0, 64, __pyx_L3_error)
3765 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_simultaneous);
3766 if (value) { values[8] = value; kw_args--; }
3771 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_smoothBoundaries);
3772 if (value) { values[9] = value; kw_args--; }
3777 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fixedNodesBoolArray);
3778 if (value) { values[10] = value; kw_args--; }
3783 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha);
3784 if (value) { values[11] = value; kw_args--; }
3787 if (unlikely(kw_args > 0)) {
3788 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"smoothNodesCentroid") < 0)) __PYX_ERR(0, 64, __pyx_L3_error)
3791 switch (PyTuple_GET_SIZE(__pyx_args)) {
3792 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3794 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3796 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3798 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3800 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3801 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3802 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3803 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3804 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3805 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3806 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3807 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3809 default:
goto __pyx_L5_argtuple_error;
3812 __pyx_v_nodeArray_ = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeArray_.memview)) __PYX_ERR(0, 64, __pyx_L3_error)
3813 __pyx_v_nodeElementOffsets = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementOffsets.memview)) __PYX_ERR(0, 65, __pyx_L3_error)
3814 __pyx_v_nodeElementsArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementsArray.memview)) __PYX_ERR(0, 66, __pyx_L3_error)
3815 __pyx_v_nodeMaterialTypes = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[3], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeMaterialTypes.memview)) __PYX_ERR(0, 67, __pyx_L3_error)
3816 __pyx_v_elementBarycentersArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[4], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementBarycentersArray.memview)) __PYX_ERR(0, 68, __pyx_L3_error)
3817 __pyx_v_elementVolumesArray = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[5], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementVolumesArray.memview)) __PYX_ERR(0, 69, __pyx_L3_error)
3818 __pyx_v_elementNodesArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[6], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementNodesArray.memview)) __PYX_ERR(0, 70, __pyx_L3_error)
3819 __pyx_v_nNodes_owned = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nNodes_owned == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error)
3821 __pyx_v_simultaneous = __Pyx_PyObject_IsTrue(values[8]);
if (unlikely((__pyx_v_simultaneous == ((
bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error)
3831 __pyx_v_simultaneous = ((bool)1);
3834 __pyx_v_smoothBoundaries = __Pyx_PyObject_IsTrue(values[9]);
if (unlikely((__pyx_v_smoothBoundaries == ((
bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L3_error)
3844 __pyx_v_smoothBoundaries = ((bool)1);
3847 __pyx_v_fixedNodesBoolArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[10], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_fixedNodesBoolArray.memview)) __PYX_ERR(0, 74, __pyx_L3_error)
3849 __pyx_v_fixedNodesBoolArray = __pyx_k__2;
3850 __PYX_INC_MEMVIEW(&__pyx_v_fixedNodesBoolArray, 1);
3853 __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[11]);
if (unlikely((__pyx_v_alpha == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L3_error)
3855 __pyx_v_alpha = ((double)0.);
3858 goto __pyx_L4_argument_unpacking_done;
3859 __pyx_L5_argtuple_error:;
3860 __Pyx_RaiseArgtupleInvalid(
"smoothNodesCentroid", 0, 8, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 64, __pyx_L3_error)
3862 __Pyx_AddTraceback(
"mprans.MeshSmoothing.smoothNodesCentroid", __pyx_clineno, __pyx_lineno, __pyx_filename);
3863 __Pyx_RefNannyFinishContext();
3865 __pyx_L4_argument_unpacking_done:;
3866 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_2smoothNodesCentroid(__pyx_self, __pyx_v_nodeArray_, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_nodeMaterialTypes, __pyx_v_elementBarycentersArray, __pyx_v_elementVolumesArray, __pyx_v_elementNodesArray, __pyx_v_nNodes_owned, __pyx_v_simultaneous, __pyx_v_smoothBoundaries, __pyx_v_fixedNodesBoolArray, __pyx_v_alpha);
3877 __Pyx_RefNannyFinishContext();
3881 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_2smoothNodesCentroid(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_nodeArray_, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeMaterialTypes, __Pyx_memviewslice __pyx_v_elementBarycentersArray, __Pyx_memviewslice __pyx_v_elementVolumesArray, __Pyx_memviewslice __pyx_v_elementNodesArray,
int __pyx_v_nNodes_owned,
bool __pyx_v_simultaneous,
bool __pyx_v_smoothBoundaries, __Pyx_memviewslice __pyx_v_fixedNodesBoolArray,
double __pyx_v_alpha) {
3882 PyObject *__pyx_r = NULL;
3883 __Pyx_RefNannyDeclarations
3884 struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesCentroid __pyx_t_1;
3885 __Pyx_RefNannySetupContext(
"smoothNodesCentroid", 0);
3894 __pyx_t_1.__pyx_n = 3;
3895 __pyx_t_1.simultaneous = __pyx_v_simultaneous;
3896 __pyx_t_1.smoothBoundaries = __pyx_v_smoothBoundaries;
3897 __pyx_t_1.alpha = __pyx_v_alpha;
3898 __pyx_f_6mprans_13MeshSmoothing_cySmoothNodesCentroid(__pyx_v_nodeArray_, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_nodeMaterialTypes, __pyx_v_elementVolumesArray, __pyx_v_elementBarycentersArray, __pyx_v_elementNodesArray, __pyx_v_nNodes_owned, __pyx_v_fixedNodesBoolArray, &__pyx_t_1);
3909 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3910 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray_, 1);
3911 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementOffsets, 1);
3912 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementsArray, 1);
3913 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeMaterialTypes, 1);
3914 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBarycentersArray, 1);
3915 __PYX_XDEC_MEMVIEW(&__pyx_v_elementVolumesArray, 1);
3916 __PYX_XDEC_MEMVIEW(&__pyx_v_elementNodesArray, 1);
3917 __PYX_XDEC_MEMVIEW(&__pyx_v_fixedNodesBoolArray, 1);
3918 __Pyx_XGIVEREF(__pyx_r);
3919 __Pyx_RefNannyFinishContext();
3932 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_5updateDilationElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3933 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_5updateDilationElements = {
"updateDilationElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_5updateDilationElements, METH_VARARGS|METH_KEYWORDS, 0};
3934 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_5updateDilationElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3935 __Pyx_memviewslice __pyx_v_elementDilationArray_ = { 0, 0, { 0 }, { 0 }, { 0 } };
3936 __Pyx_memviewslice __pyx_v_elementVolumeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3937 __Pyx_memviewslice __pyx_v_elementVolumeTargetArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3938 int __pyx_v_nElements;
3939 int __pyx_lineno = 0;
3940 const char *__pyx_filename = NULL;
3941 int __pyx_clineno = 0;
3942 PyObject *__pyx_r = 0;
3943 __Pyx_RefNannyDeclarations
3944 __Pyx_RefNannySetupContext(
"updateDilationElements (wrapper)", 0);
3946 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDilationArray,&__pyx_n_s_elementVolumeArray,&__pyx_n_s_elementVolumeTargetArray,&__pyx_n_s_nElements,0};
3947 PyObject* values[4] = {0,0,0,0};
3948 if (unlikely(__pyx_kwds)) {
3950 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3952 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3954 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3956 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3958 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3961 default:
goto __pyx_L5_argtuple_error;
3963 kw_args = PyDict_Size(__pyx_kwds);
3966 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDilationArray)) != 0)) kw_args--;
3967 else goto __pyx_L5_argtuple_error;
3970 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementVolumeArray)) != 0)) kw_args--;
3972 __Pyx_RaiseArgtupleInvalid(
"updateDilationElements", 1, 4, 4, 1); __PYX_ERR(0, 127, __pyx_L3_error)
3976 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementVolumeTargetArray)) != 0)) kw_args--;
3978 __Pyx_RaiseArgtupleInvalid(
"updateDilationElements", 1, 4, 4, 2); __PYX_ERR(0, 127, __pyx_L3_error)
3982 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements)) != 0)) kw_args--;
3984 __Pyx_RaiseArgtupleInvalid(
"updateDilationElements", 1, 4, 4, 3); __PYX_ERR(0, 127, __pyx_L3_error)
3987 if (unlikely(kw_args > 0)) {
3988 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateDilationElements") < 0)) __PYX_ERR(0, 127, __pyx_L3_error)
3990 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3991 goto __pyx_L5_argtuple_error;
3993 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3994 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3995 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3996 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3998 __pyx_v_elementDilationArray_ = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementDilationArray_.memview)) __PYX_ERR(0, 127, __pyx_L3_error)
3999 __pyx_v_elementVolumeArray = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementVolumeArray.memview)) __PYX_ERR(0, 128, __pyx_L3_error)
4000 __pyx_v_elementVolumeTargetArray = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementVolumeTargetArray.memview)) __PYX_ERR(0, 129, __pyx_L3_error)
4001 __pyx_v_nElements = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nElements == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L3_error)
4003 goto __pyx_L4_argument_unpacking_done;
4004 __pyx_L5_argtuple_error:;
4005 __Pyx_RaiseArgtupleInvalid(
"updateDilationElements", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 127, __pyx_L3_error)
4007 __Pyx_AddTraceback(
"mprans.MeshSmoothing.updateDilationElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4008 __Pyx_RefNannyFinishContext();
4010 __pyx_L4_argument_unpacking_done:;
4011 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_4updateDilationElements(__pyx_self, __pyx_v_elementDilationArray_, __pyx_v_elementVolumeArray, __pyx_v_elementVolumeTargetArray, __pyx_v_nElements);
4014 __Pyx_RefNannyFinishContext();
4018 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_4updateDilationElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_elementDilationArray_, __Pyx_memviewslice __pyx_v_elementVolumeArray, __Pyx_memviewslice __pyx_v_elementVolumeTargetArray,
int __pyx_v_nElements) {
4019 PyObject *__pyx_r = NULL;
4020 __Pyx_RefNannyDeclarations
4021 __Pyx_RefNannySetupContext(
"updateDilationElements", 0);
4030 __pyx_f_6mprans_13MeshSmoothing_cyUpdateDilationElements(__pyx_v_elementDilationArray_, __pyx_v_elementVolumeArray, __pyx_v_elementVolumeTargetArray, __pyx_v_nElements);
4041 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4042 __PYX_XDEC_MEMVIEW(&__pyx_v_elementDilationArray_, 1);
4043 __PYX_XDEC_MEMVIEW(&__pyx_v_elementVolumeArray, 1);
4044 __PYX_XDEC_MEMVIEW(&__pyx_v_elementVolumeTargetArray, 1);
4045 __Pyx_XGIVEREF(__pyx_r);
4046 __Pyx_RefNannyFinishContext();
4059 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_7getDilationElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4060 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_7getDilationElements = {
"getDilationElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_7getDilationElements, METH_VARARGS|METH_KEYWORDS, 0};
4061 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_7getDilationElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4062 __Pyx_memviewslice __pyx_v_elementVolumeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4063 __Pyx_memviewslice __pyx_v_elementVolumeTargetArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4064 int __pyx_lineno = 0;
4065 const char *__pyx_filename = NULL;
4066 int __pyx_clineno = 0;
4067 PyObject *__pyx_r = 0;
4068 __Pyx_RefNannyDeclarations
4069 __Pyx_RefNannySetupContext(
"getDilationElements (wrapper)", 0);
4071 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementVolumeArray,&__pyx_n_s_elementVolumeTargetArray,0};
4072 PyObject* values[2] = {0,0};
4073 if (unlikely(__pyx_kwds)) {
4075 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4077 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4079 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4082 default:
goto __pyx_L5_argtuple_error;
4084 kw_args = PyDict_Size(__pyx_kwds);
4087 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementVolumeArray)) != 0)) kw_args--;
4088 else goto __pyx_L5_argtuple_error;
4091 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementVolumeTargetArray)) != 0)) kw_args--;
4093 __Pyx_RaiseArgtupleInvalid(
"getDilationElements", 1, 2, 2, 1); __PYX_ERR(0, 136, __pyx_L3_error)
4096 if (unlikely(kw_args > 0)) {
4097 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getDilationElements") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
4099 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4100 goto __pyx_L5_argtuple_error;
4102 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4103 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4105 __pyx_v_elementVolumeArray = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementVolumeArray.memview)) __PYX_ERR(0, 136, __pyx_L3_error)
4106 __pyx_v_elementVolumeTargetArray = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementVolumeTargetArray.memview)) __PYX_ERR(0, 137, __pyx_L3_error)
4108 goto __pyx_L4_argument_unpacking_done;
4109 __pyx_L5_argtuple_error:;
4110 __Pyx_RaiseArgtupleInvalid(
"getDilationElements", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
4112 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getDilationElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4113 __Pyx_RefNannyFinishContext();
4115 __pyx_L4_argument_unpacking_done:;
4116 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_6getDilationElements(__pyx_self, __pyx_v_elementVolumeArray, __pyx_v_elementVolumeTargetArray);
4119 __Pyx_RefNannyFinishContext();
4123 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_6getDilationElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_elementVolumeArray, __Pyx_memviewslice __pyx_v_elementVolumeTargetArray) {
4124 int __pyx_v_nElements;
4125 PyObject *__pyx_v_elementDilationArray_ = NULL;
4126 PyObject *__pyx_r = NULL;
4127 __Pyx_RefNannyDeclarations
4129 PyObject *__pyx_t_2 = NULL;
4130 PyObject *__pyx_t_3 = NULL;
4131 PyObject *__pyx_t_4 = NULL;
4132 PyObject *__pyx_t_5 = NULL;
4133 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4134 int __pyx_lineno = 0;
4135 const char *__pyx_filename = NULL;
4136 int __pyx_clineno = 0;
4137 __Pyx_RefNannySetupContext(
"getDilationElements", 0);
4146 __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_elementVolumeArray);
4147 __pyx_v_nElements = __pyx_t_1;
4156 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
4157 __Pyx_GOTREF(__pyx_t_3);
4158 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
4159 __Pyx_GOTREF(__pyx_t_4);
4160 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4161 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nElements);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
4162 __Pyx_GOTREF(__pyx_t_3);
4164 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4165 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
4166 if (likely(__pyx_t_5)) {
4167 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
4168 __Pyx_INCREF(__pyx_t_5);
4169 __Pyx_INCREF(
function);
4170 __Pyx_DECREF_SET(__pyx_t_4,
function);
4173 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
4174 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4175 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4176 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
4177 __Pyx_GOTREF(__pyx_t_2);
4178 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4179 __pyx_v_elementDilationArray_ = __pyx_t_2;
4189 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_elementDilationArray_, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 140, __pyx_L1_error)
4198 __pyx_f_6mprans_13MeshSmoothing_cyUpdateDilationElements(__pyx_t_6, __pyx_v_elementVolumeArray, __pyx_v_elementVolumeTargetArray, __pyx_v_nElements);
4199 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4200 __pyx_t_6.memview = NULL;
4201 __pyx_t_6.data = NULL;
4210 __Pyx_XDECREF(__pyx_r);
4211 __Pyx_INCREF(__pyx_v_elementDilationArray_);
4212 __pyx_r = __pyx_v_elementDilationArray_;
4225 __Pyx_XDECREF(__pyx_t_2);
4226 __Pyx_XDECREF(__pyx_t_3);
4227 __Pyx_XDECREF(__pyx_t_4);
4228 __Pyx_XDECREF(__pyx_t_5);
4229 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4230 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getDilationElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4233 __Pyx_XDECREF(__pyx_v_elementDilationArray_);
4234 __PYX_XDEC_MEMVIEW(&__pyx_v_elementVolumeArray, 1);
4235 __PYX_XDEC_MEMVIEW(&__pyx_v_elementVolumeTargetArray, 1);
4236 __Pyx_XGIVEREF(__pyx_r);
4237 __Pyx_RefNannyFinishContext();
4250 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_9updateDistortionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4251 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_9updateDistortionElements = {
"updateDistortionElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_9updateDistortionElements, METH_VARARGS|METH_KEYWORDS, 0};
4252 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_9updateDistortionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4253 __Pyx_memviewslice __pyx_v_elementDistortionArray_ = { 0, 0, { 0 }, { 0 }, { 0 } };
4254 __Pyx_memviewslice __pyx_v_J_array = { 0, 0, { 0 }, { 0 }, { 0 } };
4255 __Pyx_memviewslice __pyx_v_detJ_array = { 0, 0, { 0 }, { 0 }, { 0 } };
4257 int __pyx_v_nElements;
4258 int __pyx_lineno = 0;
4259 const char *__pyx_filename = NULL;
4260 int __pyx_clineno = 0;
4261 PyObject *__pyx_r = 0;
4262 __Pyx_RefNannyDeclarations
4263 __Pyx_RefNannySetupContext(
"updateDistortionElements (wrapper)", 0);
4265 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementDistortionArray,&__pyx_n_s_J_array,&__pyx_n_s_detJ_array,&__pyx_n_s_nd,&__pyx_n_s_nElements,0};
4266 PyObject* values[5] = {0,0,0,0,0};
4267 if (unlikely(__pyx_kwds)) {
4269 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4271 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4273 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4275 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4277 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4279 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4282 default:
goto __pyx_L5_argtuple_error;
4284 kw_args = PyDict_Size(__pyx_kwds);
4287 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDistortionArray)) != 0)) kw_args--;
4288 else goto __pyx_L5_argtuple_error;
4291 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J_array)) != 0)) kw_args--;
4293 __Pyx_RaiseArgtupleInvalid(
"updateDistortionElements", 1, 5, 5, 1); __PYX_ERR(0, 146, __pyx_L3_error)
4297 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_detJ_array)) != 0)) kw_args--;
4299 __Pyx_RaiseArgtupleInvalid(
"updateDistortionElements", 1, 5, 5, 2); __PYX_ERR(0, 146, __pyx_L3_error)
4303 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
4305 __Pyx_RaiseArgtupleInvalid(
"updateDistortionElements", 1, 5, 5, 3); __PYX_ERR(0, 146, __pyx_L3_error)
4309 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements)) != 0)) kw_args--;
4311 __Pyx_RaiseArgtupleInvalid(
"updateDistortionElements", 1, 5, 5, 4); __PYX_ERR(0, 146, __pyx_L3_error)
4314 if (unlikely(kw_args > 0)) {
4315 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateDistortionElements") < 0)) __PYX_ERR(0, 146, __pyx_L3_error)
4317 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4318 goto __pyx_L5_argtuple_error;
4320 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4321 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4322 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4323 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4324 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4326 __pyx_v_elementDistortionArray_ = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementDistortionArray_.memview)) __PYX_ERR(0, 146, __pyx_L3_error)
4327 __pyx_v_J_array = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_double(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_J_array.memview)) __PYX_ERR(0, 147, __pyx_L3_error)
4328 __pyx_v_detJ_array = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_detJ_array.memview)) __PYX_ERR(0, 148, __pyx_L3_error)
4329 __pyx_v_nd = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L3_error)
4330 __pyx_v_nElements = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error)
4332 goto __pyx_L4_argument_unpacking_done;
4333 __pyx_L5_argtuple_error:;
4334 __Pyx_RaiseArgtupleInvalid(
"updateDistortionElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 146, __pyx_L3_error)
4336 __Pyx_AddTraceback(
"mprans.MeshSmoothing.updateDistortionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4337 __Pyx_RefNannyFinishContext();
4339 __pyx_L4_argument_unpacking_done:;
4340 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_8updateDistortionElements(__pyx_self, __pyx_v_elementDistortionArray_, __pyx_v_J_array, __pyx_v_detJ_array, __pyx_v_nd, __pyx_v_nElements);
4343 __Pyx_RefNannyFinishContext();
4347 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_8updateDistortionElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_elementDistortionArray_, __Pyx_memviewslice __pyx_v_J_array, __Pyx_memviewslice __pyx_v_detJ_array,
int __pyx_v_nd,
int __pyx_v_nElements) {
4348 PyObject *__pyx_r = NULL;
4349 __Pyx_RefNannyDeclarations
4350 __Pyx_RefNannySetupContext(
"updateDistortionElements", 0);
4359 __pyx_f_6mprans_13MeshSmoothing_cyUpdateDistortionElements(__pyx_v_elementDistortionArray_, __pyx_v_J_array, __pyx_v_detJ_array, __pyx_v_nd, __pyx_v_nElements);
4370 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4371 __PYX_XDEC_MEMVIEW(&__pyx_v_elementDistortionArray_, 1);
4372 __PYX_XDEC_MEMVIEW(&__pyx_v_J_array, 1);
4373 __PYX_XDEC_MEMVIEW(&__pyx_v_detJ_array, 1);
4374 __Pyx_XGIVEREF(__pyx_r);
4375 __Pyx_RefNannyFinishContext();
4388 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_11getDistortionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4389 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_11getDistortionElements = {
"getDistortionElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_11getDistortionElements, METH_VARARGS|METH_KEYWORDS, 0};
4390 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_11getDistortionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4391 __Pyx_memviewslice __pyx_v_J_array = { 0, 0, { 0 }, { 0 }, { 0 } };
4392 __Pyx_memviewslice __pyx_v_detJ_array = { 0, 0, { 0 }, { 0 }, { 0 } };
4394 int __pyx_lineno = 0;
4395 const char *__pyx_filename = NULL;
4396 int __pyx_clineno = 0;
4397 PyObject *__pyx_r = 0;
4398 __Pyx_RefNannyDeclarations
4399 __Pyx_RefNannySetupContext(
"getDistortionElements (wrapper)", 0);
4401 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_J_array,&__pyx_n_s_detJ_array,&__pyx_n_s_nd,0};
4402 PyObject* values[3] = {0,0,0};
4403 if (unlikely(__pyx_kwds)) {
4405 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4407 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4409 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4411 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4414 default:
goto __pyx_L5_argtuple_error;
4416 kw_args = PyDict_Size(__pyx_kwds);
4419 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J_array)) != 0)) kw_args--;
4420 else goto __pyx_L5_argtuple_error;
4423 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_detJ_array)) != 0)) kw_args--;
4425 __Pyx_RaiseArgtupleInvalid(
"getDistortionElements", 1, 3, 3, 1); __PYX_ERR(0, 157, __pyx_L3_error)
4429 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
4431 __Pyx_RaiseArgtupleInvalid(
"getDistortionElements", 1, 3, 3, 2); __PYX_ERR(0, 157, __pyx_L3_error)
4434 if (unlikely(kw_args > 0)) {
4435 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getDistortionElements") < 0)) __PYX_ERR(0, 157, __pyx_L3_error)
4437 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4438 goto __pyx_L5_argtuple_error;
4440 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4441 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4442 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4444 __pyx_v_J_array = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_J_array.memview)) __PYX_ERR(0, 157, __pyx_L3_error)
4445 __pyx_v_detJ_array = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_detJ_array.memview)) __PYX_ERR(0, 158, __pyx_L3_error)
4446 __pyx_v_nd = __Pyx_PyInt_As_int(values[2]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L3_error)
4448 goto __pyx_L4_argument_unpacking_done;
4449 __pyx_L5_argtuple_error:;
4450 __Pyx_RaiseArgtupleInvalid(
"getDistortionElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 157, __pyx_L3_error)
4452 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getDistortionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4453 __Pyx_RefNannyFinishContext();
4455 __pyx_L4_argument_unpacking_done:;
4456 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_10getDistortionElements(__pyx_self, __pyx_v_J_array, __pyx_v_detJ_array, __pyx_v_nd);
4459 __Pyx_RefNannyFinishContext();
4463 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_10getDistortionElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_J_array, __Pyx_memviewslice __pyx_v_detJ_array,
int __pyx_v_nd) {
4464 Py_ssize_t __pyx_v_nElements;
4465 PyObject *__pyx_v_elementDistortionArray_ = NULL;
4466 PyObject *__pyx_r = NULL;
4467 __Pyx_RefNannyDeclarations
4469 PyObject *__pyx_t_2 = NULL;
4470 PyObject *__pyx_t_3 = NULL;
4471 PyObject *__pyx_t_4 = NULL;
4472 PyObject *__pyx_t_5 = NULL;
4473 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4474 int __pyx_lineno = 0;
4475 const char *__pyx_filename = NULL;
4476 int __pyx_clineno = 0;
4477 __Pyx_RefNannySetupContext(
"getDistortionElements", 0);
4486 __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_detJ_array);
4487 __pyx_v_nElements = __pyx_t_1;
4496 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error)
4497 __Pyx_GOTREF(__pyx_t_3);
4498 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
4499 __Pyx_GOTREF(__pyx_t_4);
4500 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4501 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_nElements);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error)
4502 __Pyx_GOTREF(__pyx_t_3);
4504 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4505 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
4506 if (likely(__pyx_t_5)) {
4507 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
4508 __Pyx_INCREF(__pyx_t_5);
4509 __Pyx_INCREF(
function);
4510 __Pyx_DECREF_SET(__pyx_t_4,
function);
4513 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
4514 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4515 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4516 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
4517 __Pyx_GOTREF(__pyx_t_2);
4518 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4519 __pyx_v_elementDistortionArray_ = __pyx_t_2;
4529 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_elementDistortionArray_, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 162, __pyx_L1_error)
4538 __pyx_f_6mprans_13MeshSmoothing_cyUpdateDistortionElements(__pyx_t_6, __pyx_v_J_array, __pyx_v_detJ_array, __pyx_v_nd, __pyx_v_nElements);
4539 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4540 __pyx_t_6.memview = NULL;
4541 __pyx_t_6.data = NULL;
4550 __Pyx_XDECREF(__pyx_r);
4551 __Pyx_INCREF(__pyx_v_elementDistortionArray_);
4552 __pyx_r = __pyx_v_elementDistortionArray_;
4565 __Pyx_XDECREF(__pyx_t_2);
4566 __Pyx_XDECREF(__pyx_t_3);
4567 __Pyx_XDECREF(__pyx_t_4);
4568 __Pyx_XDECREF(__pyx_t_5);
4569 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4570 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getDistortionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4573 __Pyx_XDECREF(__pyx_v_elementDistortionArray_);
4574 __PYX_XDEC_MEMVIEW(&__pyx_v_J_array, 1);
4575 __PYX_XDEC_MEMVIEW(&__pyx_v_detJ_array, 1);
4576 __Pyx_XGIVEREF(__pyx_r);
4577 __Pyx_RefNannyFinishContext();
4590 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_13updateInverseMeanRatioTriangleElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4591 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_13updateInverseMeanRatioTriangleElements = {
"updateInverseMeanRatioTriangleElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_13updateInverseMeanRatioTriangleElements, METH_VARARGS|METH_KEYWORDS, 0};
4592 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_13updateInverseMeanRatioTriangleElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4593 __Pyx_memviewslice __pyx_v_IMRElementsArray_ = { 0, 0, { 0 }, { 0 }, { 0 } };
4594 __Pyx_memviewslice __pyx_v_nodeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4595 __Pyx_memviewslice __pyx_v_elementNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4596 int __pyx_v_nElements;
4597 int __pyx_lineno = 0;
4598 const char *__pyx_filename = NULL;
4599 int __pyx_clineno = 0;
4600 PyObject *__pyx_r = 0;
4601 __Pyx_RefNannyDeclarations
4602 __Pyx_RefNannySetupContext(
"updateInverseMeanRatioTriangleElements (wrapper)", 0);
4604 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_IMRElementsArray,&__pyx_n_s_nodeArray_2,&__pyx_n_s_elementNodesArray,&__pyx_n_s_nElements,0};
4605 PyObject* values[4] = {0,0,0,0};
4606 if (unlikely(__pyx_kwds)) {
4608 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4610 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4612 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4614 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4616 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4619 default:
goto __pyx_L5_argtuple_error;
4621 kw_args = PyDict_Size(__pyx_kwds);
4624 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_IMRElementsArray)) != 0)) kw_args--;
4625 else goto __pyx_L5_argtuple_error;
4628 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray_2)) != 0)) kw_args--;
4630 __Pyx_RaiseArgtupleInvalid(
"updateInverseMeanRatioTriangleElements", 1, 4, 4, 1); __PYX_ERR(0, 169, __pyx_L3_error)
4634 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
4636 __Pyx_RaiseArgtupleInvalid(
"updateInverseMeanRatioTriangleElements", 1, 4, 4, 2); __PYX_ERR(0, 169, __pyx_L3_error)
4640 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements)) != 0)) kw_args--;
4642 __Pyx_RaiseArgtupleInvalid(
"updateInverseMeanRatioTriangleElements", 1, 4, 4, 3); __PYX_ERR(0, 169, __pyx_L3_error)
4645 if (unlikely(kw_args > 0)) {
4646 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateInverseMeanRatioTriangleElements") < 0)) __PYX_ERR(0, 169, __pyx_L3_error)
4648 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4649 goto __pyx_L5_argtuple_error;
4651 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4652 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4653 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4654 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4656 __pyx_v_IMRElementsArray_ = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_IMRElementsArray_.memview)) __PYX_ERR(0, 169, __pyx_L3_error)
4657 __pyx_v_nodeArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeArray.memview)) __PYX_ERR(0, 170, __pyx_L3_error)
4658 __pyx_v_elementNodesArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementNodesArray.memview)) __PYX_ERR(0, 171, __pyx_L3_error)
4659 __pyx_v_nElements = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nElements == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L3_error)
4661 goto __pyx_L4_argument_unpacking_done;
4662 __pyx_L5_argtuple_error:;
4663 __Pyx_RaiseArgtupleInvalid(
"updateInverseMeanRatioTriangleElements", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 169, __pyx_L3_error)
4665 __Pyx_AddTraceback(
"mprans.MeshSmoothing.updateInverseMeanRatioTriangleElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4666 __Pyx_RefNannyFinishContext();
4668 __pyx_L4_argument_unpacking_done:;
4669 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_12updateInverseMeanRatioTriangleElements(__pyx_self, __pyx_v_IMRElementsArray_, __pyx_v_nodeArray, __pyx_v_elementNodesArray, __pyx_v_nElements);
4672 __Pyx_RefNannyFinishContext();
4676 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_12updateInverseMeanRatioTriangleElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_IMRElementsArray_, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementNodesArray,
int __pyx_v_nElements) {
4677 PyObject *__pyx_r = NULL;
4678 __Pyx_RefNannyDeclarations
4679 __Pyx_RefNannySetupContext(
"updateInverseMeanRatioTriangleElements", 0);
4688 __pyx_f_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleElements(__pyx_v_IMRElementsArray_, __pyx_v_nodeArray, __pyx_v_elementNodesArray, __pyx_v_nElements);
4699 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4700 __PYX_XDEC_MEMVIEW(&__pyx_v_IMRElementsArray_, 1);
4701 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray, 1);
4702 __PYX_XDEC_MEMVIEW(&__pyx_v_elementNodesArray, 1);
4703 __Pyx_XGIVEREF(__pyx_r);
4704 __Pyx_RefNannyFinishContext();
4717 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_15getInverseMeanRatioTriangleElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4718 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_15getInverseMeanRatioTriangleElements = {
"getInverseMeanRatioTriangleElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_15getInverseMeanRatioTriangleElements, METH_VARARGS|METH_KEYWORDS, 0};
4719 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_15getInverseMeanRatioTriangleElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4720 __Pyx_memviewslice __pyx_v_nodeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4721 __Pyx_memviewslice __pyx_v_elementNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4722 int __pyx_lineno = 0;
4723 const char *__pyx_filename = NULL;
4724 int __pyx_clineno = 0;
4725 PyObject *__pyx_r = 0;
4726 __Pyx_RefNannyDeclarations
4727 __Pyx_RefNannySetupContext(
"getInverseMeanRatioTriangleElements (wrapper)", 0);
4729 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodeArray_2,&__pyx_n_s_elementNodesArray,0};
4730 PyObject* values[2] = {0,0};
4731 if (unlikely(__pyx_kwds)) {
4733 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4735 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4737 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4740 default:
goto __pyx_L5_argtuple_error;
4742 kw_args = PyDict_Size(__pyx_kwds);
4745 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray_2)) != 0)) kw_args--;
4746 else goto __pyx_L5_argtuple_error;
4749 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
4751 __Pyx_RaiseArgtupleInvalid(
"getInverseMeanRatioTriangleElements", 1, 2, 2, 1); __PYX_ERR(0, 178, __pyx_L3_error)
4754 if (unlikely(kw_args > 0)) {
4755 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getInverseMeanRatioTriangleElements") < 0)) __PYX_ERR(0, 178, __pyx_L3_error)
4757 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4758 goto __pyx_L5_argtuple_error;
4760 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4761 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4763 __pyx_v_nodeArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeArray.memview)) __PYX_ERR(0, 178, __pyx_L3_error)
4764 __pyx_v_elementNodesArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementNodesArray.memview)) __PYX_ERR(0, 179, __pyx_L3_error)
4766 goto __pyx_L4_argument_unpacking_done;
4767 __pyx_L5_argtuple_error:;
4768 __Pyx_RaiseArgtupleInvalid(
"getInverseMeanRatioTriangleElements", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 178, __pyx_L3_error)
4770 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getInverseMeanRatioTriangleElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4771 __Pyx_RefNannyFinishContext();
4773 __pyx_L4_argument_unpacking_done:;
4774 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_14getInverseMeanRatioTriangleElements(__pyx_self, __pyx_v_nodeArray, __pyx_v_elementNodesArray);
4777 __Pyx_RefNannyFinishContext();
4781 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_14getInverseMeanRatioTriangleElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementNodesArray) {
4782 int __pyx_v_nElements;
4783 PyObject *__pyx_v_IMRElementsArray_ = NULL;
4784 PyObject *__pyx_r = NULL;
4785 __Pyx_RefNannyDeclarations
4787 PyObject *__pyx_t_2 = NULL;
4788 PyObject *__pyx_t_3 = NULL;
4789 PyObject *__pyx_t_4 = NULL;
4790 PyObject *__pyx_t_5 = NULL;
4791 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4792 int __pyx_lineno = 0;
4793 const char *__pyx_filename = NULL;
4794 int __pyx_clineno = 0;
4795 __Pyx_RefNannySetupContext(
"getInverseMeanRatioTriangleElements", 0);
4804 __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_elementNodesArray);
4805 __pyx_v_nElements = __pyx_t_1;
4814 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
4815 __Pyx_GOTREF(__pyx_t_3);
4816 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
4817 __Pyx_GOTREF(__pyx_t_4);
4818 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4819 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nElements);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
4820 __Pyx_GOTREF(__pyx_t_3);
4822 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4823 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
4824 if (likely(__pyx_t_5)) {
4825 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
4826 __Pyx_INCREF(__pyx_t_5);
4827 __Pyx_INCREF(
function);
4828 __Pyx_DECREF_SET(__pyx_t_4,
function);
4831 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
4832 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4833 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4834 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
4835 __Pyx_GOTREF(__pyx_t_2);
4836 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4837 __pyx_v_IMRElementsArray_ = __pyx_t_2;
4847 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_IMRElementsArray_, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 182, __pyx_L1_error)
4856 __pyx_f_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleElements(__pyx_t_6, __pyx_v_nodeArray, __pyx_v_elementNodesArray, __pyx_v_nElements);
4857 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4858 __pyx_t_6.memview = NULL;
4859 __pyx_t_6.data = NULL;
4868 __Pyx_XDECREF(__pyx_r);
4869 __Pyx_INCREF(__pyx_v_IMRElementsArray_);
4870 __pyx_r = __pyx_v_IMRElementsArray_;
4883 __Pyx_XDECREF(__pyx_t_2);
4884 __Pyx_XDECREF(__pyx_t_3);
4885 __Pyx_XDECREF(__pyx_t_4);
4886 __Pyx_XDECREF(__pyx_t_5);
4887 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4888 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getInverseMeanRatioTriangleElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4891 __Pyx_XDECREF(__pyx_v_IMRElementsArray_);
4892 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray, 1);
4893 __PYX_XDEC_MEMVIEW(&__pyx_v_elementNodesArray, 1);
4894 __Pyx_XGIVEREF(__pyx_r);
4895 __Pyx_RefNannyFinishContext();
4908 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_17updateInverseMeanRatioTriangleNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4909 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_17updateInverseMeanRatioTriangleNodes = {
"updateInverseMeanRatioTriangleNodes", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_17updateInverseMeanRatioTriangleNodes, METH_VARARGS|METH_KEYWORDS, 0};
4910 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_17updateInverseMeanRatioTriangleNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4911 __Pyx_memviewslice __pyx_v_IMRNodesArray_ = { 0, 0, { 0 }, { 0 }, { 0 } };
4912 __Pyx_memviewslice __pyx_v_nodeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4913 __Pyx_memviewslice __pyx_v_elementNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4914 __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
4915 __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4917 int __pyx_v_nElements;
4918 bool __pyx_v_el_average;
4919 int __pyx_lineno = 0;
4920 const char *__pyx_filename = NULL;
4921 int __pyx_clineno = 0;
4922 PyObject *__pyx_r = 0;
4923 __Pyx_RefNannyDeclarations
4924 __Pyx_RefNannySetupContext(
"updateInverseMeanRatioTriangleNodes (wrapper)", 0);
4926 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_IMRNodesArray,&__pyx_n_s_nodeArray_2,&__pyx_n_s_elementNodesArray,&__pyx_n_s_nodeElementOffsets,&__pyx_n_s_nodeElementsArray,&__pyx_n_s_nNodes,&__pyx_n_s_nElements,&__pyx_n_s_el_average,0};
4927 PyObject* values[8] = {0,0,0,0,0,0,0,0};
4928 if (unlikely(__pyx_kwds)) {
4930 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4932 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4934 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4936 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4938 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4940 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4942 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4944 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4946 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4949 default:
goto __pyx_L5_argtuple_error;
4951 kw_args = PyDict_Size(__pyx_kwds);
4954 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_IMRNodesArray)) != 0)) kw_args--;
4955 else goto __pyx_L5_argtuple_error;
4958 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray_2)) != 0)) kw_args--;
4960 __Pyx_RaiseArgtupleInvalid(
"updateInverseMeanRatioTriangleNodes", 0, 7, 8, 1); __PYX_ERR(0, 188, __pyx_L3_error)
4964 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
4966 __Pyx_RaiseArgtupleInvalid(
"updateInverseMeanRatioTriangleNodes", 0, 7, 8, 2); __PYX_ERR(0, 188, __pyx_L3_error)
4970 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
4972 __Pyx_RaiseArgtupleInvalid(
"updateInverseMeanRatioTriangleNodes", 0, 7, 8, 3); __PYX_ERR(0, 188, __pyx_L3_error)
4976 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
4978 __Pyx_RaiseArgtupleInvalid(
"updateInverseMeanRatioTriangleNodes", 0, 7, 8, 4); __PYX_ERR(0, 188, __pyx_L3_error)
4982 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes)) != 0)) kw_args--;
4984 __Pyx_RaiseArgtupleInvalid(
"updateInverseMeanRatioTriangleNodes", 0, 7, 8, 5); __PYX_ERR(0, 188, __pyx_L3_error)
4988 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements)) != 0)) kw_args--;
4990 __Pyx_RaiseArgtupleInvalid(
"updateInverseMeanRatioTriangleNodes", 0, 7, 8, 6); __PYX_ERR(0, 188, __pyx_L3_error)
4995 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_el_average);
4996 if (value) { values[7] = value; kw_args--; }
4999 if (unlikely(kw_args > 0)) {
5000 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateInverseMeanRatioTriangleNodes") < 0)) __PYX_ERR(0, 188, __pyx_L3_error)
5003 switch (PyTuple_GET_SIZE(__pyx_args)) {
5004 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5006 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5007 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5008 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5009 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5010 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5011 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5012 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5014 default:
goto __pyx_L5_argtuple_error;
5017 __pyx_v_IMRNodesArray_ = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_IMRNodesArray_.memview)) __PYX_ERR(0, 188, __pyx_L3_error)
5018 __pyx_v_nodeArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeArray.memview)) __PYX_ERR(0, 189, __pyx_L3_error)
5019 __pyx_v_elementNodesArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementNodesArray.memview)) __PYX_ERR(0, 190, __pyx_L3_error)
5020 __pyx_v_nodeElementOffsets = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[3], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementOffsets.memview)) __PYX_ERR(0, 191, __pyx_L3_error)
5021 __pyx_v_nodeElementsArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementsArray.memview)) __PYX_ERR(0, 192, __pyx_L3_error)
5022 __pyx_v_nNodes = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nNodes == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error)
5023 __pyx_v_nElements = __Pyx_PyInt_As_int(values[6]);
if (unlikely((__pyx_v_nElements == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L3_error)
5025 __pyx_v_el_average = __Pyx_PyObject_IsTrue(values[7]);
if (unlikely((__pyx_v_el_average == ((
bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L3_error)
5035 __pyx_v_el_average = ((bool)0);
5038 goto __pyx_L4_argument_unpacking_done;
5039 __pyx_L5_argtuple_error:;
5040 __Pyx_RaiseArgtupleInvalid(
"updateInverseMeanRatioTriangleNodes", 0, 7, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 188, __pyx_L3_error)
5042 __Pyx_AddTraceback(
"mprans.MeshSmoothing.updateInverseMeanRatioTriangleNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
5043 __Pyx_RefNannyFinishContext();
5045 __pyx_L4_argument_unpacking_done:;
5046 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_16updateInverseMeanRatioTriangleNodes(__pyx_self, __pyx_v_IMRNodesArray_, __pyx_v_nodeArray, __pyx_v_elementNodesArray, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_nNodes, __pyx_v_nElements, __pyx_v_el_average);
5057 __Pyx_RefNannyFinishContext();
5061 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_16updateInverseMeanRatioTriangleNodes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_IMRNodesArray_, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementNodesArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_nodeElementsArray,
int __pyx_v_nNodes,
int __pyx_v_nElements,
bool __pyx_v_el_average) {
5062 PyObject *__pyx_r = NULL;
5063 __Pyx_RefNannyDeclarations
5064 struct __pyx_opt_args_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleNodes __pyx_t_1;
5065 __Pyx_RefNannySetupContext(
"updateInverseMeanRatioTriangleNodes", 0);
5074 __pyx_t_1.__pyx_n = 1;
5075 __pyx_t_1.el_average = __pyx_v_el_average;
5076 __pyx_f_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleNodes(__pyx_v_IMRNodesArray_, __pyx_v_nodeArray, __pyx_v_elementNodesArray, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_nElements, __pyx_v_nNodes, &__pyx_t_1);
5087 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5088 __PYX_XDEC_MEMVIEW(&__pyx_v_IMRNodesArray_, 1);
5089 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray, 1);
5090 __PYX_XDEC_MEMVIEW(&__pyx_v_elementNodesArray, 1);
5091 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementOffsets, 1);
5092 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementsArray, 1);
5093 __Pyx_XGIVEREF(__pyx_r);
5094 __Pyx_RefNannyFinishContext();
5107 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_19getInverseMeanRatioTriangleNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5108 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_19getInverseMeanRatioTriangleNodes = {
"getInverseMeanRatioTriangleNodes", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_19getInverseMeanRatioTriangleNodes, METH_VARARGS|METH_KEYWORDS, 0};
5109 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_19getInverseMeanRatioTriangleNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5110 __Pyx_memviewslice __pyx_v_nodeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
5111 __Pyx_memviewslice __pyx_v_elementNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
5112 __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
5113 __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
5114 bool __pyx_v_el_average;
5115 int __pyx_lineno = 0;
5116 const char *__pyx_filename = NULL;
5117 int __pyx_clineno = 0;
5118 PyObject *__pyx_r = 0;
5119 __Pyx_RefNannyDeclarations
5120 __Pyx_RefNannySetupContext(
"getInverseMeanRatioTriangleNodes (wrapper)", 0);
5122 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nodeArray_2,&__pyx_n_s_elementNodesArray,&__pyx_n_s_nodeElementOffsets,&__pyx_n_s_nodeElementsArray,&__pyx_n_s_el_average,0};
5123 PyObject* values[5] = {0,0,0,0,0};
5124 if (unlikely(__pyx_kwds)) {
5126 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5128 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5130 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5132 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5134 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5136 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5139 default:
goto __pyx_L5_argtuple_error;
5141 kw_args = PyDict_Size(__pyx_kwds);
5144 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray_2)) != 0)) kw_args--;
5145 else goto __pyx_L5_argtuple_error;
5148 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
5150 __Pyx_RaiseArgtupleInvalid(
"getInverseMeanRatioTriangleNodes", 0, 4, 5, 1); __PYX_ERR(0, 205, __pyx_L3_error)
5154 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
5156 __Pyx_RaiseArgtupleInvalid(
"getInverseMeanRatioTriangleNodes", 0, 4, 5, 2); __PYX_ERR(0, 205, __pyx_L3_error)
5160 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
5162 __Pyx_RaiseArgtupleInvalid(
"getInverseMeanRatioTriangleNodes", 0, 4, 5, 3); __PYX_ERR(0, 205, __pyx_L3_error)
5167 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_el_average);
5168 if (value) { values[4] = value; kw_args--; }
5171 if (unlikely(kw_args > 0)) {
5172 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getInverseMeanRatioTriangleNodes") < 0)) __PYX_ERR(0, 205, __pyx_L3_error)
5175 switch (PyTuple_GET_SIZE(__pyx_args)) {
5176 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5178 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5179 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5180 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5181 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5183 default:
goto __pyx_L5_argtuple_error;
5186 __pyx_v_nodeArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeArray.memview)) __PYX_ERR(0, 205, __pyx_L3_error)
5187 __pyx_v_elementNodesArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementNodesArray.memview)) __PYX_ERR(0, 206, __pyx_L3_error)
5188 __pyx_v_nodeElementOffsets = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementOffsets.memview)) __PYX_ERR(0, 207, __pyx_L3_error)
5189 __pyx_v_nodeElementsArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[3], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementsArray.memview)) __PYX_ERR(0, 208, __pyx_L3_error)
5191 __pyx_v_el_average = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_el_average == ((
bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L3_error)
5201 __pyx_v_el_average = ((bool)0);
5204 goto __pyx_L4_argument_unpacking_done;
5205 __pyx_L5_argtuple_error:;
5206 __Pyx_RaiseArgtupleInvalid(
"getInverseMeanRatioTriangleNodes", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 205, __pyx_L3_error)
5208 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getInverseMeanRatioTriangleNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
5209 __Pyx_RefNannyFinishContext();
5211 __pyx_L4_argument_unpacking_done:;
5212 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_18getInverseMeanRatioTriangleNodes(__pyx_self, __pyx_v_nodeArray, __pyx_v_elementNodesArray, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_el_average);
5223 __Pyx_RefNannyFinishContext();
5227 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_18getInverseMeanRatioTriangleNodes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementNodesArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_nodeElementsArray,
bool __pyx_v_el_average) {
5229 int __pyx_v_nElements;
5230 PyObject *__pyx_v_IMRNodesArray_ = NULL;
5231 PyObject *__pyx_r = NULL;
5232 __Pyx_RefNannyDeclarations
5234 PyObject *__pyx_t_2 = NULL;
5235 PyObject *__pyx_t_3 = NULL;
5236 PyObject *__pyx_t_4 = NULL;
5237 PyObject *__pyx_t_5 = NULL;
5238 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5239 struct __pyx_opt_args_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleNodes __pyx_t_7;
5240 int __pyx_lineno = 0;
5241 const char *__pyx_filename = NULL;
5242 int __pyx_clineno = 0;
5243 __Pyx_RefNannySetupContext(
"getInverseMeanRatioTriangleNodes", 0);
5252 __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_nodeArray);
5253 __pyx_v_nNodes = __pyx_t_1;
5262 __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_elementNodesArray);
5263 __pyx_v_nElements = __pyx_t_1;
5272 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
5273 __Pyx_GOTREF(__pyx_t_3);
5274 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
5275 __Pyx_GOTREF(__pyx_t_4);
5276 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5277 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nNodes);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
5278 __Pyx_GOTREF(__pyx_t_3);
5280 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5281 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5282 if (likely(__pyx_t_5)) {
5283 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
5284 __Pyx_INCREF(__pyx_t_5);
5285 __Pyx_INCREF(
function);
5286 __Pyx_DECREF_SET(__pyx_t_4,
function);
5289 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
5290 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5291 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5292 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
5293 __Pyx_GOTREF(__pyx_t_2);
5294 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5295 __pyx_v_IMRNodesArray_ = __pyx_t_2;
5305 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_IMRNodesArray_, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 213, __pyx_L1_error)
5314 __pyx_t_7.__pyx_n = 1;
5315 __pyx_t_7.el_average = __pyx_v_el_average;
5316 __pyx_f_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleNodes(__pyx_t_6, __pyx_v_nodeArray, __pyx_v_elementNodesArray, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_nElements, __pyx_v_nNodes, &__pyx_t_7);
5317 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5318 __pyx_t_6.memview = NULL;
5319 __pyx_t_6.data = NULL;
5328 __Pyx_XDECREF(__pyx_r);
5329 __Pyx_INCREF(__pyx_v_IMRNodesArray_);
5330 __pyx_r = __pyx_v_IMRNodesArray_;
5343 __Pyx_XDECREF(__pyx_t_2);
5344 __Pyx_XDECREF(__pyx_t_3);
5345 __Pyx_XDECREF(__pyx_t_4);
5346 __Pyx_XDECREF(__pyx_t_5);
5347 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5348 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getInverseMeanRatioTriangleNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
5351 __Pyx_XDECREF(__pyx_v_IMRNodesArray_);
5352 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray, 1);
5353 __PYX_XDEC_MEMVIEW(&__pyx_v_elementNodesArray, 1);
5354 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementOffsets, 1);
5355 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementsArray, 1);
5356 __Pyx_XGIVEREF(__pyx_r);
5357 __Pyx_RefNannyFinishContext();
5370 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_21getInverseMeanRatioSingleTriangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5371 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_21getInverseMeanRatioSingleTriangle = {
"getInverseMeanRatioSingleTriangle", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_21getInverseMeanRatioSingleTriangle, METH_VARARGS|METH_KEYWORDS, 0};
5372 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_21getInverseMeanRatioSingleTriangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5374 __Pyx_memviewslice __pyx_v_nodeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
5375 __Pyx_memviewslice __pyx_v_elementNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
5376 __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
5377 __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
5378 int __pyx_lineno = 0;
5379 const char *__pyx_filename = NULL;
5380 int __pyx_clineno = 0;
5381 PyObject *__pyx_r = 0;
5382 __Pyx_RefNannyDeclarations
5383 __Pyx_RefNannySetupContext(
"getInverseMeanRatioSingleTriangle (wrapper)", 0);
5385 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node0,&__pyx_n_s_nodeArray_2,&__pyx_n_s_elementNodesArray,&__pyx_n_s_nodeElementOffsets,&__pyx_n_s_nodeElementsArray,0};
5386 PyObject* values[5] = {0,0,0,0,0};
5387 if (unlikely(__pyx_kwds)) {
5389 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5391 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5393 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5395 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5397 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5399 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5402 default:
goto __pyx_L5_argtuple_error;
5404 kw_args = PyDict_Size(__pyx_kwds);
5407 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node0)) != 0)) kw_args--;
5408 else goto __pyx_L5_argtuple_error;
5411 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray_2)) != 0)) kw_args--;
5413 __Pyx_RaiseArgtupleInvalid(
"getInverseMeanRatioSingleTriangle", 1, 5, 5, 1); __PYX_ERR(0, 223, __pyx_L3_error)
5417 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
5419 __Pyx_RaiseArgtupleInvalid(
"getInverseMeanRatioSingleTriangle", 1, 5, 5, 2); __PYX_ERR(0, 223, __pyx_L3_error)
5423 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
5425 __Pyx_RaiseArgtupleInvalid(
"getInverseMeanRatioSingleTriangle", 1, 5, 5, 3); __PYX_ERR(0, 223, __pyx_L3_error)
5429 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
5431 __Pyx_RaiseArgtupleInvalid(
"getInverseMeanRatioSingleTriangle", 1, 5, 5, 4); __PYX_ERR(0, 223, __pyx_L3_error)
5434 if (unlikely(kw_args > 0)) {
5435 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getInverseMeanRatioSingleTriangle") < 0)) __PYX_ERR(0, 223, __pyx_L3_error)
5437 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5438 goto __pyx_L5_argtuple_error;
5440 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5441 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5442 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5443 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5444 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5446 __pyx_v_node0 = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_node0 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L3_error)
5447 __pyx_v_nodeArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeArray.memview)) __PYX_ERR(0, 224, __pyx_L3_error)
5448 __pyx_v_elementNodesArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementNodesArray.memview)) __PYX_ERR(0, 225, __pyx_L3_error)
5449 __pyx_v_nodeElementOffsets = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[3], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementOffsets.memview)) __PYX_ERR(0, 226, __pyx_L3_error)
5450 __pyx_v_nodeElementsArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementsArray.memview)) __PYX_ERR(0, 227, __pyx_L3_error)
5452 goto __pyx_L4_argument_unpacking_done;
5453 __pyx_L5_argtuple_error:;
5454 __Pyx_RaiseArgtupleInvalid(
"getInverseMeanRatioSingleTriangle", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 223, __pyx_L3_error)
5456 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getInverseMeanRatioSingleTriangle", __pyx_clineno, __pyx_lineno, __pyx_filename);
5457 __Pyx_RefNannyFinishContext();
5459 __pyx_L4_argument_unpacking_done:;
5460 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_20getInverseMeanRatioSingleTriangle(__pyx_self, __pyx_v_node0, __pyx_v_nodeArray, __pyx_v_elementNodesArray, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray);
5463 __Pyx_RefNannyFinishContext();
5467 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_20getInverseMeanRatioSingleTriangle(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_node0, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementNodesArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_nodeElementsArray) {
5468 PyObject *__pyx_r = NULL;
5469 __Pyx_RefNannyDeclarations
5470 PyObject *__pyx_t_1 = NULL;
5471 int __pyx_lineno = 0;
5472 const char *__pyx_filename = NULL;
5473 int __pyx_clineno = 0;
5474 __Pyx_RefNannySetupContext(
"getInverseMeanRatioSingleTriangle", 0);
5483 __Pyx_XDECREF(__pyx_r);
5492 __pyx_t_1 = PyFloat_FromDouble(__pyx_f_6mprans_13MeshSmoothing_cyGetInverseMeanRatioSingleTriangle(__pyx_v_node0, __pyx_v_nodeArray, __pyx_v_elementNodesArray, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, NULL));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
5493 __Pyx_GOTREF(__pyx_t_1);
5494 __pyx_r = __pyx_t_1;
5508 __Pyx_XDECREF(__pyx_t_1);
5509 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getInverseMeanRatioSingleTriangle", __pyx_clineno, __pyx_lineno, __pyx_filename);
5512 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray, 1);
5513 __PYX_XDEC_MEMVIEW(&__pyx_v_elementNodesArray, 1);
5514 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementOffsets, 1);
5515 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementsArray, 1);
5516 __Pyx_XGIVEREF(__pyx_r);
5517 __Pyx_RefNannyFinishContext();
5530 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_23smoothNodesQuality(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5531 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_23smoothNodesQuality = {
"smoothNodesQuality", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_23smoothNodesQuality, METH_VARARGS|METH_KEYWORDS, 0};
5532 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_23smoothNodesQuality(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5533 __Pyx_memviewslice __pyx_v_distortion = { 0, 0, { 0 }, { 0 }, { 0 } };
5534 __Pyx_memviewslice __pyx_v_dilation = { 0, 0, { 0 }, { 0 }, { 0 } };
5535 __Pyx_memviewslice __pyx_v_nodeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
5536 int __pyx_v_nNodes_owned;
5537 __Pyx_memviewslice __pyx_v_nodeMaterialTypes = { 0, 0, { 0 }, { 0 }, { 0 } };
5538 __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
5539 __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
5540 __Pyx_memviewslice __pyx_v_elementNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
5541 CYTHON_UNUSED
bool __pyx_v_apply_directly;
5542 int __pyx_lineno = 0;
5543 const char *__pyx_filename = NULL;
5544 int __pyx_clineno = 0;
5545 PyObject *__pyx_r = 0;
5546 __Pyx_RefNannyDeclarations
5547 __Pyx_RefNannySetupContext(
"smoothNodesQuality (wrapper)", 0);
5549 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_distortion,&__pyx_n_s_dilation,&__pyx_n_s_nodeArray_2,&__pyx_n_s_nNodes_owned,&__pyx_n_s_nodeMaterialTypes,&__pyx_n_s_nodeElementOffsets,&__pyx_n_s_nodeElementsArray,&__pyx_n_s_elementNodesArray,&__pyx_n_s_apply_directly,0};
5550 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
5551 if (unlikely(__pyx_kwds)) {
5553 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5555 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5557 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5559 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5561 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5563 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5565 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5567 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5569 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5571 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5574 default:
goto __pyx_L5_argtuple_error;
5576 kw_args = PyDict_Size(__pyx_kwds);
5579 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_distortion)) != 0)) kw_args--;
5580 else goto __pyx_L5_argtuple_error;
5583 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dilation)) != 0)) kw_args--;
5585 __Pyx_RaiseArgtupleInvalid(
"smoothNodesQuality", 0, 8, 9, 1); __PYX_ERR(0, 234, __pyx_L3_error)
5589 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray_2)) != 0)) kw_args--;
5591 __Pyx_RaiseArgtupleInvalid(
"smoothNodesQuality", 0, 8, 9, 2); __PYX_ERR(0, 234, __pyx_L3_error)
5595 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes_owned)) != 0)) kw_args--;
5597 __Pyx_RaiseArgtupleInvalid(
"smoothNodesQuality", 0, 8, 9, 3); __PYX_ERR(0, 234, __pyx_L3_error)
5601 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeMaterialTypes)) != 0)) kw_args--;
5603 __Pyx_RaiseArgtupleInvalid(
"smoothNodesQuality", 0, 8, 9, 4); __PYX_ERR(0, 234, __pyx_L3_error)
5607 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
5609 __Pyx_RaiseArgtupleInvalid(
"smoothNodesQuality", 0, 8, 9, 5); __PYX_ERR(0, 234, __pyx_L3_error)
5613 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
5615 __Pyx_RaiseArgtupleInvalid(
"smoothNodesQuality", 0, 8, 9, 6); __PYX_ERR(0, 234, __pyx_L3_error)
5619 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
5621 __Pyx_RaiseArgtupleInvalid(
"smoothNodesQuality", 0, 8, 9, 7); __PYX_ERR(0, 234, __pyx_L3_error)
5626 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_apply_directly);
5627 if (value) { values[8] = value; kw_args--; }
5630 if (unlikely(kw_args > 0)) {
5631 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"smoothNodesQuality") < 0)) __PYX_ERR(0, 234, __pyx_L3_error)
5634 switch (PyTuple_GET_SIZE(__pyx_args)) {
5635 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5637 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5638 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5639 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5640 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5641 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5642 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5643 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5644 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5646 default:
goto __pyx_L5_argtuple_error;
5649 __pyx_v_distortion = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_distortion.memview)) __PYX_ERR(0, 234, __pyx_L3_error)
5650 __pyx_v_dilation = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_dilation.memview)) __PYX_ERR(0, 235, __pyx_L3_error)
5651 __pyx_v_nodeArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeArray.memview)) __PYX_ERR(0, 236, __pyx_L3_error)
5652 __pyx_v_nNodes_owned = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nNodes_owned == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L3_error)
5653 __pyx_v_nodeMaterialTypes = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeMaterialTypes.memview)) __PYX_ERR(0, 238, __pyx_L3_error)
5654 __pyx_v_nodeElementOffsets = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[5], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementOffsets.memview)) __PYX_ERR(0, 239, __pyx_L3_error)
5655 __pyx_v_nodeElementsArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[6], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeElementsArray.memview)) __PYX_ERR(0, 240, __pyx_L3_error)
5656 __pyx_v_elementNodesArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[7], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementNodesArray.memview)) __PYX_ERR(0, 241, __pyx_L3_error)
5658 __pyx_v_apply_directly = __Pyx_PyObject_IsTrue(values[8]);
if (unlikely((__pyx_v_apply_directly == ((
bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error)
5668 __pyx_v_apply_directly = ((bool)0);
5671 goto __pyx_L4_argument_unpacking_done;
5672 __pyx_L5_argtuple_error:;
5673 __Pyx_RaiseArgtupleInvalid(
"smoothNodesQuality", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 234, __pyx_L3_error)
5675 __Pyx_AddTraceback(
"mprans.MeshSmoothing.smoothNodesQuality", __pyx_clineno, __pyx_lineno, __pyx_filename);
5676 __Pyx_RefNannyFinishContext();
5678 __pyx_L4_argument_unpacking_done:;
5679 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_22smoothNodesQuality(__pyx_self, __pyx_v_distortion, __pyx_v_dilation, __pyx_v_nodeArray, __pyx_v_nNodes_owned, __pyx_v_nodeMaterialTypes, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_elementNodesArray, __pyx_v_apply_directly);
5690 __Pyx_RefNannyFinishContext();
5694 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_22smoothNodesQuality(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_distortion, __Pyx_memviewslice __pyx_v_dilation, __Pyx_memviewslice __pyx_v_nodeArray,
int __pyx_v_nNodes_owned, __Pyx_memviewslice __pyx_v_nodeMaterialTypes, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_elementNodesArray, CYTHON_UNUSED
bool __pyx_v_apply_directly) {
5695 PyObject *__pyx_r = NULL;
5696 __Pyx_RefNannyDeclarations
5697 __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
5698 struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesQuality __pyx_t_2;
5699 PyObject *__pyx_t_3 = NULL;
5700 int __pyx_lineno = 0;
5701 const char *__pyx_filename = NULL;
5702 int __pyx_clineno = 0;
5703 __Pyx_RefNannySetupContext(
"smoothNodesQuality", 0);
5712 #ifndef CYTHON_WITHOUT_ASSERTIONS
5713 if (unlikely(!Py_OptimizeFlag)) {
5715 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_smoothNodesQuality_is_work_in_pr);
5716 __PYX_ERR(0, 243, __pyx_L1_error)
5728 __Pyx_XDECREF(__pyx_r);
5737 __pyx_t_2.__pyx_n = 1;
5738 __pyx_t_2.apply_directly = 0;
5739 __pyx_t_1 = __pyx_f_6mprans_13MeshSmoothing_cySmoothNodesQuality(__pyx_v_distortion, __pyx_v_dilation, __pyx_v_nodeArray, __pyx_v_nNodes_owned, __pyx_v_nodeMaterialTypes, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_elementNodesArray, &__pyx_t_2);
if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 244, __pyx_L1_error)
5748 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_t_1, 2, (PyObject *(*)(
char *)) __pyx_memview_get_double, (
int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
5749 __Pyx_GOTREF(__pyx_t_3);
5750 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5751 __pyx_t_1.memview = NULL;
5752 __pyx_t_1.data = NULL;
5753 __pyx_r = __pyx_t_3;
5767 __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5768 __Pyx_XDECREF(__pyx_t_3);
5769 __Pyx_AddTraceback(
"mprans.MeshSmoothing.smoothNodesQuality", __pyx_clineno, __pyx_lineno, __pyx_filename);
5772 __PYX_XDEC_MEMVIEW(&__pyx_v_distortion, 1);
5773 __PYX_XDEC_MEMVIEW(&__pyx_v_dilation, 1);
5774 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray, 1);
5775 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeMaterialTypes, 1);
5776 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementOffsets, 1);
5777 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementsArray, 1);
5778 __PYX_XDEC_MEMVIEW(&__pyx_v_elementNodesArray, 1);
5779 __Pyx_XGIVEREF(__pyx_r);
5780 __Pyx_RefNannyFinishContext();
5793 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_25getLocalNearestNode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5794 static char __pyx_doc_6mprans_13MeshSmoothing_24getLocalNearestNode[] =
"Finds nearest node to coordinates (local)\n\n Parameters\n ----------\n coords: array_like\n coordinates from which to find nearest node\n nodeArray: array_like\n array of fluid mesh node coordinates\n nodeStarOffsets: array_like\n array of offsets from nodes (range)\n nodeStarArray: array_like\n array of neighbouring nodes\n node: int\n first guess for nearest node\n\n Returns\n -------\n node: int\n nearest node index\n ";
5795 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_25getLocalNearestNode = {
"getLocalNearestNode", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_25getLocalNearestNode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mprans_13MeshSmoothing_24getLocalNearestNode};
5796 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_25getLocalNearestNode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5797 __Pyx_memviewslice __pyx_v_coords = { 0, 0, { 0 }, { 0 }, { 0 } };
5798 __Pyx_memviewslice __pyx_v_nodeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
5799 __Pyx_memviewslice __pyx_v_nodeStarOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
5800 __Pyx_memviewslice __pyx_v_nodeStarArray = { 0, 0, { 0 }, { 0 }, { 0 } };
5802 int __pyx_lineno = 0;
5803 const char *__pyx_filename = NULL;
5804 int __pyx_clineno = 0;
5805 PyObject *__pyx_r = 0;
5806 __Pyx_RefNannyDeclarations
5807 __Pyx_RefNannySetupContext(
"getLocalNearestNode (wrapper)", 0);
5809 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coords,&__pyx_n_s_nodeArray_2,&__pyx_n_s_nodeStarOffsets,&__pyx_n_s_nodeStarArray,&__pyx_n_s_node,0};
5810 PyObject* values[5] = {0,0,0,0,0};
5811 if (unlikely(__pyx_kwds)) {
5813 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5815 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5817 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5819 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5821 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5823 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5826 default:
goto __pyx_L5_argtuple_error;
5828 kw_args = PyDict_Size(__pyx_kwds);
5831 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
5832 else goto __pyx_L5_argtuple_error;
5835 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray_2)) != 0)) kw_args--;
5837 __Pyx_RaiseArgtupleInvalid(
"getLocalNearestNode", 1, 5, 5, 1); __PYX_ERR(0, 254, __pyx_L3_error)
5841 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeStarOffsets)) != 0)) kw_args--;
5843 __Pyx_RaiseArgtupleInvalid(
"getLocalNearestNode", 1, 5, 5, 2); __PYX_ERR(0, 254, __pyx_L3_error)
5847 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeStarArray)) != 0)) kw_args--;
5849 __Pyx_RaiseArgtupleInvalid(
"getLocalNearestNode", 1, 5, 5, 3); __PYX_ERR(0, 254, __pyx_L3_error)
5853 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node)) != 0)) kw_args--;
5855 __Pyx_RaiseArgtupleInvalid(
"getLocalNearestNode", 1, 5, 5, 4); __PYX_ERR(0, 254, __pyx_L3_error)
5858 if (unlikely(kw_args > 0)) {
5859 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getLocalNearestNode") < 0)) __PYX_ERR(0, 254, __pyx_L3_error)
5861 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5862 goto __pyx_L5_argtuple_error;
5864 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5865 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5866 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5867 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5868 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5870 __pyx_v_coords = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_coords.memview)) __PYX_ERR(0, 254, __pyx_L3_error)
5871 __pyx_v_nodeArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeArray.memview)) __PYX_ERR(0, 255, __pyx_L3_error)
5872 __pyx_v_nodeStarOffsets = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeStarOffsets.memview)) __PYX_ERR(0, 256, __pyx_L3_error)
5873 __pyx_v_nodeStarArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[3], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_nodeStarArray.memview)) __PYX_ERR(0, 257, __pyx_L3_error)
5874 __pyx_v_node = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_node == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 258, __pyx_L3_error)
5876 goto __pyx_L4_argument_unpacking_done;
5877 __pyx_L5_argtuple_error:;
5878 __Pyx_RaiseArgtupleInvalid(
"getLocalNearestNode", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 254, __pyx_L3_error)
5880 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getLocalNearestNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
5881 __Pyx_RefNannyFinishContext();
5883 __pyx_L4_argument_unpacking_done:;
5884 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_24getLocalNearestNode(__pyx_self, __pyx_v_coords, __pyx_v_nodeArray, __pyx_v_nodeStarOffsets, __pyx_v_nodeStarArray, __pyx_v_node);
5887 __Pyx_RefNannyFinishContext();
5891 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_24getLocalNearestNode(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_coords, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_nodeStarOffsets, __Pyx_memviewslice __pyx_v_nodeStarArray,
int __pyx_v_node) {
5892 PyObject *__pyx_r = NULL;
5893 __Pyx_RefNannyDeclarations
5894 PyObject *__pyx_t_1 = NULL;
5895 int __pyx_lineno = 0;
5896 const char *__pyx_filename = NULL;
5897 int __pyx_clineno = 0;
5898 __Pyx_RefNannySetupContext(
"getLocalNearestNode", 0);
5907 __Pyx_XDECREF(__pyx_r);
5916 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_6mprans_13MeshSmoothing_pyxGetLocalNearestNode(__pyx_v_coords, __pyx_v_nodeArray, __pyx_v_nodeStarOffsets, __pyx_v_nodeStarArray, __pyx_v_node));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
5917 __Pyx_GOTREF(__pyx_t_1);
5918 __pyx_r = __pyx_t_1;
5932 __Pyx_XDECREF(__pyx_t_1);
5933 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getLocalNearestNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
5936 __PYX_XDEC_MEMVIEW(&__pyx_v_coords, 1);
5937 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray, 1);
5938 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeStarOffsets, 1);
5939 __PYX_XDEC_MEMVIEW(&__pyx_v_nodeStarArray, 1);
5940 __Pyx_XGIVEREF(__pyx_r);
5941 __Pyx_RefNannyFinishContext();
5954 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_27getLocalNearestElement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5955 static char __pyx_doc_6mprans_13MeshSmoothing_26getLocalNearestElement[] =
"Finds nearest element to coordinates (local)\n\n Parameters\n ----------\n coords: double[:]\n coordinates from which to find nearest element\n elementBarycentersArray: double[:,:]\n array of mesh cell barycenter coordinates\n elementNeighborsArray: double[:,:]\n array of element neighbors\n eN: int\n first guess for nearest element\n\n Returns\n -------\n eN: int\n nearest element index\n ";
5956 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_27getLocalNearestElement = {
"getLocalNearestElement", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_27getLocalNearestElement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mprans_13MeshSmoothing_26getLocalNearestElement};
5957 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_27getLocalNearestElement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5958 __Pyx_memviewslice __pyx_v_coords = { 0, 0, { 0 }, { 0 }, { 0 } };
5959 __Pyx_memviewslice __pyx_v_elementBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
5960 __Pyx_memviewslice __pyx_v_elementNeighborsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
5962 int __pyx_lineno = 0;
5963 const char *__pyx_filename = NULL;
5964 int __pyx_clineno = 0;
5965 PyObject *__pyx_r = 0;
5966 __Pyx_RefNannyDeclarations
5967 __Pyx_RefNannySetupContext(
"getLocalNearestElement (wrapper)", 0);
5969 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coords,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_eN,0};
5970 PyObject* values[4] = {0,0,0,0};
5971 if (unlikely(__pyx_kwds)) {
5973 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5975 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5977 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5979 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5981 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5984 default:
goto __pyx_L5_argtuple_error;
5986 kw_args = PyDict_Size(__pyx_kwds);
5989 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
5990 else goto __pyx_L5_argtuple_error;
5993 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
5995 __Pyx_RaiseArgtupleInvalid(
"getLocalNearestElement", 1, 4, 4, 1); __PYX_ERR(0, 285, __pyx_L3_error)
5999 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
6001 __Pyx_RaiseArgtupleInvalid(
"getLocalNearestElement", 1, 4, 4, 2); __PYX_ERR(0, 285, __pyx_L3_error)
6005 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eN)) != 0)) kw_args--;
6007 __Pyx_RaiseArgtupleInvalid(
"getLocalNearestElement", 1, 4, 4, 3); __PYX_ERR(0, 285, __pyx_L3_error)
6010 if (unlikely(kw_args > 0)) {
6011 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getLocalNearestElement") < 0)) __PYX_ERR(0, 285, __pyx_L3_error)
6013 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
6014 goto __pyx_L5_argtuple_error;
6016 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6017 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6018 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6019 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6021 __pyx_v_coords = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[0], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_coords.memview)) __PYX_ERR(0, 285, __pyx_L3_error)
6022 __pyx_v_elementBarycentersArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[1], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementBarycentersArray.memview)) __PYX_ERR(0, 286, __pyx_L3_error)
6023 __pyx_v_elementNeighborsArray = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(values[2], PyBUF_WRITABLE);
if (unlikely(!__pyx_v_elementNeighborsArray.memview)) __PYX_ERR(0, 287, __pyx_L3_error)
6024 __pyx_v_eN = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_eN == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error)
6026 goto __pyx_L4_argument_unpacking_done;
6027 __pyx_L5_argtuple_error:;
6028 __Pyx_RaiseArgtupleInvalid(
"getLocalNearestElement", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 285, __pyx_L3_error)
6030 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getLocalNearestElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
6031 __Pyx_RefNannyFinishContext();
6033 __pyx_L4_argument_unpacking_done:;
6034 __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_26getLocalNearestElement(__pyx_self, __pyx_v_coords, __pyx_v_elementBarycentersArray, __pyx_v_elementNeighborsArray, __pyx_v_eN);
6037 __Pyx_RefNannyFinishContext();
6041 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_26getLocalNearestElement(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_coords, __Pyx_memviewslice __pyx_v_elementBarycentersArray, __Pyx_memviewslice __pyx_v_elementNeighborsArray,
int __pyx_v_eN) {
6042 PyObject *__pyx_r = NULL;
6043 __Pyx_RefNannyDeclarations
6044 PyObject *__pyx_t_1 = NULL;
6045 int __pyx_lineno = 0;
6046 const char *__pyx_filename = NULL;
6047 int __pyx_clineno = 0;
6048 __Pyx_RefNannySetupContext(
"getLocalNearestElement", 0);
6057 __Pyx_XDECREF(__pyx_r);
6066 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_6mprans_13MeshSmoothing_pyxGetLocalNearestElement(__pyx_v_coords, __pyx_v_elementBarycentersArray, __pyx_v_elementNeighborsArray, __pyx_v_eN));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
6067 __Pyx_GOTREF(__pyx_t_1);
6068 __pyx_r = __pyx_t_1;
6082 __Pyx_XDECREF(__pyx_t_1);
6083 __Pyx_AddTraceback(
"mprans.MeshSmoothing.getLocalNearestElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
6086 __PYX_XDEC_MEMVIEW(&__pyx_v_coords, 1);
6087 __PYX_XDEC_MEMVIEW(&__pyx_v_elementBarycentersArray, 1);
6088 __PYX_XDEC_MEMVIEW(&__pyx_v_elementNeighborsArray, 1);
6089 __Pyx_XGIVEREF(__pyx_r);
6090 __Pyx_RefNannyFinishContext();
6103 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_29getLocalNearestElementAroundNode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6104 static char __pyx_doc_6mprans_13MeshSmoothing_28getLocalNearestElementAroundNode[] =
"Finds nearest neighbouring element of node to coordinates (local)\n\n Parameters\n ----------\n coords: double[:]\n coordinates from which to find nearest element\n nodeElementOffsets: int[:]\n element offsets from nodes\n nodeElementsArray: int[:]\n elements array from nodeElementOffsets\n elementBarycentersArray: int[:]\n array of mesh cell barycenter coordinates\n node: int\n node from which to search\n\n Returns\n -------\n eN: int\n nearest element index\n ";
6105 static PyMethodDef __pyx_mdef_6mprans_13MeshSmoothing_29getLocalNearestElementAroundNode = {
"getLocalNearestElementAroundNode", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_13MeshSmoothing_29getLocalNearestElementAroundNode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mprans_13MeshSmoothing_28getLocalNearestElementAroundNode};
6106 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_29getLocalNearestElementAroundNode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6107 __Pyx_memviewslice __pyx_v_coords = { 0, 0, { 0 }, { 0 }, { 0 } };
6108 __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
6109 __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6110 __Pyx_memviewslice __pyx_v_elementBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6112 int __pyx_lineno = 0;
6113 const char *__pyx_filename = NULL;
6114 int __pyx_clineno = 0;
6115 PyObject *__pyx_r = 0;
6116 __Pyx_RefNannyDeclarations
6117 __Pyx_RefNannySetupContext(
"getLocalNearestElementAroundNode (wrapper)", 0);
6119 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coords,&__pyx_n_s_nodeElementOffsets,&__pyx_n_s_nodeElementsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_node,0};
6120 PyObject* values[5] = {0,0,0,0,0};
6121 if (unlikely(__pyx_kwds)) {
6123 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6125 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6127 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6129 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6131 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6133 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6136 default:
goto __pyx_L5_argtuple_error;
6138 kw_args = PyDict_Size(__pyx_kwds);
6141 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
6142 else goto __pyx_L5_argtuple_error;
6145 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
6147 __Pyx_RaiseArgtupleInvalid(
"getLocalNearestElementAroundNode", 1, 5, 5, 1); __PYX_ERR(0, 312, __pyx_L3_error)