proteus  1.8.1
C/C++/Fortran libraries
MeshSmoothing.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.30 */
2 
3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
5 #endif /* PY_SSIZE_T_CLEAN */
6 #include "Python.h"
7 #ifndef Py_PYTHON_H
8  #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10  #error Cython requires Python 2.6+ or Python 3.3+.
11 #else
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
15 #include <stddef.h>
16 #ifndef offsetof
17  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18 #endif
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
20  #ifndef __stdcall
21  #define __stdcall
22  #endif
23  #ifndef __cdecl
24  #define __cdecl
25  #endif
26  #ifndef __fastcall
27  #define __fastcall
28  #endif
29 #endif
30 #ifndef DL_IMPORT
31  #define DL_IMPORT(t) t
32 #endif
33 #ifndef DL_EXPORT
34  #define DL_EXPORT(t) t
35 #endif
36 #define __PYX_COMMA ,
37 #ifndef HAVE_LONG_LONG
38  #if PY_VERSION_HEX >= 0x02070000
39  #define HAVE_LONG_LONG
40  #endif
41 #endif
42 #ifndef PY_LONG_LONG
43  #define PY_LONG_LONG LONG_LONG
44 #endif
45 #ifndef Py_HUGE_VAL
46  #define Py_HUGE_VAL HUGE_VAL
47 #endif
48 #ifdef PYPY_VERSION
49  #define CYTHON_COMPILING_IN_PYPY 1
50  #define CYTHON_COMPILING_IN_PYSTON 0
51  #define CYTHON_COMPILING_IN_CPYTHON 0
52  #undef CYTHON_USE_TYPE_SLOTS
53  #define CYTHON_USE_TYPE_SLOTS 0
54  #undef CYTHON_USE_PYTYPE_LOOKUP
55  #define CYTHON_USE_PYTYPE_LOOKUP 0
56  #if PY_VERSION_HEX < 0x03050000
57  #undef CYTHON_USE_ASYNC_SLOTS
58  #define CYTHON_USE_ASYNC_SLOTS 0
59  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60  #define CYTHON_USE_ASYNC_SLOTS 1
61  #endif
62  #undef CYTHON_USE_PYLIST_INTERNALS
63  #define CYTHON_USE_PYLIST_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_INTERNALS
65  #define CYTHON_USE_UNICODE_INTERNALS 0
66  #undef CYTHON_USE_UNICODE_WRITER
67  #define CYTHON_USE_UNICODE_WRITER 0
68  #undef CYTHON_USE_PYLONG_INTERNALS
69  #define CYTHON_USE_PYLONG_INTERNALS 0
70  #undef CYTHON_AVOID_BORROWED_REFS
71  #define CYTHON_AVOID_BORROWED_REFS 1
72  #undef CYTHON_ASSUME_SAFE_MACROS
73  #define CYTHON_ASSUME_SAFE_MACROS 0
74  #undef CYTHON_UNPACK_METHODS
75  #define CYTHON_UNPACK_METHODS 0
76  #undef CYTHON_FAST_THREAD_STATE
77  #define CYTHON_FAST_THREAD_STATE 0
78  #undef CYTHON_FAST_PYCALL
79  #define CYTHON_FAST_PYCALL 0
80  #undef CYTHON_PEP489_MULTI_PHASE_INIT
81  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82  #undef CYTHON_USE_TP_FINALIZE
83  #define CYTHON_USE_TP_FINALIZE 0
84  #undef CYTHON_USE_DICT_VERSIONS
85  #define CYTHON_USE_DICT_VERSIONS 0
86  #undef CYTHON_USE_EXC_INFO_STACK
87  #define CYTHON_USE_EXC_INFO_STACK 0
88  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89  #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
90  #endif
91 #elif defined(PYSTON_VERSION)
92  #define CYTHON_COMPILING_IN_PYPY 0
93  #define CYTHON_COMPILING_IN_PYSTON 1
94  #define CYTHON_COMPILING_IN_CPYTHON 0
95  #ifndef CYTHON_USE_TYPE_SLOTS
96  #define CYTHON_USE_TYPE_SLOTS 1
97  #endif
98  #undef CYTHON_USE_PYTYPE_LOOKUP
99  #define CYTHON_USE_PYTYPE_LOOKUP 0
100  #undef CYTHON_USE_ASYNC_SLOTS
101  #define CYTHON_USE_ASYNC_SLOTS 0
102  #undef CYTHON_USE_PYLIST_INTERNALS
103  #define CYTHON_USE_PYLIST_INTERNALS 0
104  #ifndef CYTHON_USE_UNICODE_INTERNALS
105  #define CYTHON_USE_UNICODE_INTERNALS 1
106  #endif
107  #undef CYTHON_USE_UNICODE_WRITER
108  #define CYTHON_USE_UNICODE_WRITER 0
109  #undef CYTHON_USE_PYLONG_INTERNALS
110  #define CYTHON_USE_PYLONG_INTERNALS 0
111  #ifndef CYTHON_AVOID_BORROWED_REFS
112  #define CYTHON_AVOID_BORROWED_REFS 0
113  #endif
114  #ifndef CYTHON_ASSUME_SAFE_MACROS
115  #define CYTHON_ASSUME_SAFE_MACROS 1
116  #endif
117  #ifndef CYTHON_UNPACK_METHODS
118  #define CYTHON_UNPACK_METHODS 1
119  #endif
120  #undef CYTHON_FAST_THREAD_STATE
121  #define CYTHON_FAST_THREAD_STATE 0
122  #undef CYTHON_FAST_PYCALL
123  #define CYTHON_FAST_PYCALL 0
124  #undef CYTHON_PEP489_MULTI_PHASE_INIT
125  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126  #undef CYTHON_USE_TP_FINALIZE
127  #define CYTHON_USE_TP_FINALIZE 0
128  #undef CYTHON_USE_DICT_VERSIONS
129  #define CYTHON_USE_DICT_VERSIONS 0
130  #undef CYTHON_USE_EXC_INFO_STACK
131  #define CYTHON_USE_EXC_INFO_STACK 0
132  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
134  #endif
135 #else
136  #define CYTHON_COMPILING_IN_PYPY 0
137  #define CYTHON_COMPILING_IN_PYSTON 0
138  #define CYTHON_COMPILING_IN_CPYTHON 1
139  #ifndef CYTHON_USE_TYPE_SLOTS
140  #define CYTHON_USE_TYPE_SLOTS 1
141  #endif
142  #if PY_VERSION_HEX < 0x02070000
143  #undef CYTHON_USE_PYTYPE_LOOKUP
144  #define CYTHON_USE_PYTYPE_LOOKUP 0
145  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146  #define CYTHON_USE_PYTYPE_LOOKUP 1
147  #endif
148  #if PY_MAJOR_VERSION < 3
149  #undef CYTHON_USE_ASYNC_SLOTS
150  #define CYTHON_USE_ASYNC_SLOTS 0
151  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152  #define CYTHON_USE_ASYNC_SLOTS 1
153  #endif
154  #if PY_VERSION_HEX < 0x02070000
155  #undef CYTHON_USE_PYLONG_INTERNALS
156  #define CYTHON_USE_PYLONG_INTERNALS 0
157  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158  #define CYTHON_USE_PYLONG_INTERNALS 1
159  #endif
160  #ifndef CYTHON_USE_PYLIST_INTERNALS
161  #define CYTHON_USE_PYLIST_INTERNALS 1
162  #endif
163  #ifndef CYTHON_USE_UNICODE_INTERNALS
164  #define CYTHON_USE_UNICODE_INTERNALS 1
165  #endif
166  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167  #undef CYTHON_USE_UNICODE_WRITER
168  #define CYTHON_USE_UNICODE_WRITER 0
169  #elif !defined(CYTHON_USE_UNICODE_WRITER)
170  #define CYTHON_USE_UNICODE_WRITER 1
171  #endif
172  #ifndef CYTHON_AVOID_BORROWED_REFS
173  #define CYTHON_AVOID_BORROWED_REFS 0
174  #endif
175  #ifndef CYTHON_ASSUME_SAFE_MACROS
176  #define CYTHON_ASSUME_SAFE_MACROS 1
177  #endif
178  #ifndef CYTHON_UNPACK_METHODS
179  #define CYTHON_UNPACK_METHODS 1
180  #endif
181  #if PY_VERSION_HEX >= 0x030B00A4
182  #undef CYTHON_FAST_THREAD_STATE
183  #define CYTHON_FAST_THREAD_STATE 0
184  #elif !defined(CYTHON_FAST_THREAD_STATE)
185  #define CYTHON_FAST_THREAD_STATE 1
186  #endif
187  #ifndef CYTHON_FAST_PYCALL
188  #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
189  #endif
190  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
192  #endif
193  #ifndef CYTHON_USE_TP_FINALIZE
194  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
195  #endif
196  #ifndef CYTHON_USE_DICT_VERSIONS
197  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
198  #endif
199  #if PY_VERSION_HEX >= 0x030B00A4
200  #undef CYTHON_USE_EXC_INFO_STACK
201  #define CYTHON_USE_EXC_INFO_STACK 0
202  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
204  #endif
205  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
207  #endif
208 #endif
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
211 #endif
212 #if CYTHON_USE_PYLONG_INTERNALS
213  #if PY_MAJOR_VERSION < 3
214  #include "longintrepr.h"
215  #endif
216  #undef SHIFT
217  #undef BASE
218  #undef MASK
219  #ifdef SIZEOF_VOID_P
220  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
221  #endif
222 #endif
223 #ifndef __has_attribute
224  #define __has_attribute(x) 0
225 #endif
226 #ifndef __has_cpp_attribute
227  #define __has_cpp_attribute(x) 0
228 #endif
229 #ifndef CYTHON_RESTRICT
230  #if defined(__GNUC__)
231  #define CYTHON_RESTRICT __restrict__
232  #elif defined(_MSC_VER) && _MSC_VER >= 1400
233  #define CYTHON_RESTRICT __restrict
234  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235  #define CYTHON_RESTRICT restrict
236  #else
237  #define CYTHON_RESTRICT
238  #endif
239 #endif
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
244 # else
245 # define CYTHON_UNUSED
246 # endif
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
249 # else
250 # define CYTHON_UNUSED
251 # endif
252 #endif
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
256 # else
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
258 # endif
259 #endif
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
263 # else
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
265 # endif
266 #endif
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
268 #ifdef _MSC_VER
269  #ifndef _MSC_STDINT_H_
270  #if _MSC_VER < 1300
271  typedef unsigned char uint8_t;
272  typedef unsigned int uint32_t;
273  #else
274  typedef unsigned __int8 uint8_t;
275  typedef unsigned __int32 uint32_t;
276  #endif
277  #endif
278 #else
279  #include <stdint.h>
280 #endif
281 #ifndef CYTHON_FALLTHROUGH
282  #if defined(__cplusplus) && __cplusplus >= 201103L
283  #if __has_cpp_attribute(fallthrough)
284  #define CYTHON_FALLTHROUGH [[fallthrough]]
285  #elif __has_cpp_attribute(clang::fallthrough)
286  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287  #elif __has_cpp_attribute(gnu::fallthrough)
288  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
289  #endif
290  #endif
291  #ifndef CYTHON_FALLTHROUGH
292  #if __has_attribute(fallthrough)
293  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
294  #else
295  #define CYTHON_FALLTHROUGH
296  #endif
297  #endif
298  #if defined(__clang__ ) && defined(__apple_build_version__)
299  #if __apple_build_version__ < 7000000
300  #undef CYTHON_FALLTHROUGH
301  #define CYTHON_FALLTHROUGH
302  #endif
303  #endif
304 #endif
305 
306 #ifndef __cplusplus
307  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
308 #endif
309 #ifndef CYTHON_INLINE
310  #if defined(__clang__)
311  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
312  #else
313  #define CYTHON_INLINE inline
314  #endif
315 #endif
316 template<typename T>
317 void __Pyx_call_destructor(T& x) {
318  x.~T();
319 }
320 template<typename T>
321 class __Pyx_FakeReference {
322  public:
323  __Pyx_FakeReference() : ptr(NULL) { }
324  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
325  T *operator->() { return ptr; }
326  T *operator&() { return ptr; }
327  operator T&() { return *ptr; }
328  template<typename U> bool operator ==(U other) { return *ptr == other; }
329  template<typename U> bool operator !=(U other) { return *ptr != other; }
330  private:
331  T *ptr;
332 };
333 
334 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
335  #define Py_OptimizeFlag 0
336 #endif
337 #define __PYX_BUILD_PY_SSIZE_T "n"
338 #define CYTHON_FORMAT_SSIZE_T "z"
339 #if PY_MAJOR_VERSION < 3
340  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
341  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
342  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
343  #define __Pyx_DefaultClassType PyClass_Type
344 #else
345  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
346  #define __Pyx_DefaultClassType PyType_Type
347 #if PY_VERSION_HEX >= 0x030B00A1
348  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
349  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
350  PyObject *fv, PyObject *cell, PyObject* fn,
351  PyObject *name, int fline, PyObject *lnos) {
352  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
353  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
354  const char *fn_cstr=NULL;
355  const char *name_cstr=NULL;
356  PyCodeObject* co=NULL;
357  PyObject *type, *value, *traceback;
358  PyErr_Fetch(&type, &value, &traceback);
359  if (!(kwds=PyDict_New())) goto end;
360  if (!(argcount=PyLong_FromLong(a))) goto end;
361  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
362  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
363  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
364  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
365  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
366  if (!(nlocals=PyLong_FromLong(l))) goto end;
367  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
368  if (!(stacksize=PyLong_FromLong(s))) goto end;
369  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
370  if (!(flags=PyLong_FromLong(f))) goto end;
371  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
372  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
373  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
374  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
375  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
376  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
377  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
378  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
379  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
380  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
381  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
382  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
383  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
384  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
385  Py_XDECREF((PyObject*)co);
386  co = (PyCodeObject*)call_result;
387  call_result = NULL;
388  if (0) {
389  cleanup_code_too:
390  Py_XDECREF((PyObject*)co);
391  co = NULL;
392  }
393  end:
394  Py_XDECREF(kwds);
395  Py_XDECREF(argcount);
396  Py_XDECREF(posonlyargcount);
397  Py_XDECREF(kwonlyargcount);
398  Py_XDECREF(nlocals);
399  Py_XDECREF(stacksize);
400  Py_XDECREF(replace);
401  Py_XDECREF(call_result);
402  Py_XDECREF(empty);
403  if (type) {
404  PyErr_Restore(type, value, traceback);
405  }
406  return co;
407  }
408 #else
409  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
410  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
411 #endif
412  #define __Pyx_DefaultClassType PyType_Type
413 #endif
414 #ifndef Py_TPFLAGS_CHECKTYPES
415  #define Py_TPFLAGS_CHECKTYPES 0
416 #endif
417 #ifndef Py_TPFLAGS_HAVE_INDEX
418  #define Py_TPFLAGS_HAVE_INDEX 0
419 #endif
420 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
421  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
422 #endif
423 #ifndef Py_TPFLAGS_HAVE_FINALIZE
424  #define Py_TPFLAGS_HAVE_FINALIZE 0
425 #endif
426 #ifndef METH_STACKLESS
427  #define METH_STACKLESS 0
428 #endif
429 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
430  #ifndef METH_FASTCALL
431  #define METH_FASTCALL 0x80
432  #endif
433  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
434  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
435  Py_ssize_t nargs, PyObject *kwnames);
436 #else
437  #define __Pyx_PyCFunctionFast _PyCFunctionFast
438  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
439 #endif
440 #if CYTHON_FAST_PYCCALL
441 #define __Pyx_PyFastCFunction_Check(func)\
442  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
443 #else
444 #define __Pyx_PyFastCFunction_Check(func) 0
445 #endif
446 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
447  #define PyObject_Malloc(s) PyMem_Malloc(s)
448  #define PyObject_Free(p) PyMem_Free(p)
449  #define PyObject_Realloc(p) PyMem_Realloc(p)
450 #endif
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
452  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
453  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
454  #define PyMem_RawFree(p) PyMem_Free(p)
455 #endif
456 #if CYTHON_COMPILING_IN_PYSTON
457  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
458  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
459 #else
460  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
461  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
462 #endif
463 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
464  #define __Pyx_PyThreadState_Current PyThreadState_GET()
465 #elif PY_VERSION_HEX >= 0x03060000
466  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
467 #elif PY_VERSION_HEX >= 0x03000000
468  #define __Pyx_PyThreadState_Current PyThreadState_GET()
469 #else
470  #define __Pyx_PyThreadState_Current _PyThreadState_Current
471 #endif
472 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
473 #include "pythread.h"
474 #define Py_tss_NEEDS_INIT 0
475 typedef int Py_tss_t;
476 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
477  *key = PyThread_create_key();
478  return 0;
479 }
480 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
481  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
482  *key = Py_tss_NEEDS_INIT;
483  return key;
484 }
485 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
486  PyObject_Free(key);
487 }
488 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
489  return *key != Py_tss_NEEDS_INIT;
490 }
491 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
492  PyThread_delete_key(*key);
493  *key = Py_tss_NEEDS_INIT;
494 }
495 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
496  return PyThread_set_key_value(*key, value);
497 }
498 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
499  return PyThread_get_key_value(*key);
500 }
501 #endif
502 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
503 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
504 #else
505 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
506 #endif
507 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
508  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
509  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
510 #else
511  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
512  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
513 #endif
514 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
515 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
516 #else
517 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
518 #endif
519 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
520  #define CYTHON_PEP393_ENABLED 1
521  #if defined(PyUnicode_IS_READY)
522  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
523  0 : _PyUnicode_Ready((PyObject *)(op)))
524  #else
525  #define __Pyx_PyUnicode_READY(op) (0)
526  #endif
527  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
528  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
529  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
530  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
531  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
532  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
533  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
534  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
535  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
536  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
537  #else
538  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
539  #endif
540  #else
541  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
542  #endif
543 #else
544  #define CYTHON_PEP393_ENABLED 0
545  #define PyUnicode_1BYTE_KIND 1
546  #define PyUnicode_2BYTE_KIND 2
547  #define PyUnicode_4BYTE_KIND 4
548  #define __Pyx_PyUnicode_READY(op) (0)
549  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
550  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
551  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
552  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
553  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
554  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
555  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
556  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
557 #endif
558 #if CYTHON_COMPILING_IN_PYPY
559  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
560  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
561 #else
562  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
563  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
564  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
565 #endif
566 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
567  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
568 #endif
569 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
570  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
571 #endif
572 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
573  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
574 #endif
575 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
576 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
577 #if PY_MAJOR_VERSION >= 3
578  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
579 #else
580  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
581 #endif
582 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
583  #define PyObject_ASCII(o) PyObject_Repr(o)
584 #endif
585 #if PY_MAJOR_VERSION >= 3
586  #define PyBaseString_Type PyUnicode_Type
587  #define PyStringObject PyUnicodeObject
588  #define PyString_Type PyUnicode_Type
589  #define PyString_Check PyUnicode_Check
590  #define PyString_CheckExact PyUnicode_CheckExact
591 #ifndef PyObject_Unicode
592  #define PyObject_Unicode PyObject_Str
593 #endif
594 #endif
595 #if PY_MAJOR_VERSION >= 3
596  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
597  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
598 #else
599  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
600  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
601 #endif
602 #ifndef PySet_CheckExact
603  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
604 #endif
605 #if PY_VERSION_HEX >= 0x030900A4
606  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
607  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
608 #else
609  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
610  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
611 #endif
612 #if CYTHON_ASSUME_SAFE_MACROS
613  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
614 #else
615  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
616 #endif
617 #if PY_MAJOR_VERSION >= 3
618  #define PyIntObject PyLongObject
619  #define PyInt_Type PyLong_Type
620  #define PyInt_Check(op) PyLong_Check(op)
621  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
622  #define PyInt_FromString PyLong_FromString
623  #define PyInt_FromUnicode PyLong_FromUnicode
624  #define PyInt_FromLong PyLong_FromLong
625  #define PyInt_FromSize_t PyLong_FromSize_t
626  #define PyInt_FromSsize_t PyLong_FromSsize_t
627  #define PyInt_AsLong PyLong_AsLong
628  #define PyInt_AS_LONG PyLong_AS_LONG
629  #define PyInt_AsSsize_t PyLong_AsSsize_t
630  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
631  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
632  #define PyNumber_Int PyNumber_Long
633 #endif
634 #if PY_MAJOR_VERSION >= 3
635  #define PyBoolObject PyLongObject
636 #endif
637 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
638  #ifndef PyUnicode_InternFromString
639  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
640  #endif
641 #endif
642 #if PY_VERSION_HEX < 0x030200A4
643  typedef long Py_hash_t;
644  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
645  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
646 #else
647  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
648  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
649 #endif
650 #if PY_MAJOR_VERSION >= 3
651  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
652 #else
653  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
654 #endif
655 #if CYTHON_USE_ASYNC_SLOTS
656  #if PY_VERSION_HEX >= 0x030500B1
657  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
658  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
659  #else
660  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
661  #endif
662 #else
663  #define __Pyx_PyType_AsAsync(obj) NULL
664 #endif
665 #ifndef __Pyx_PyAsyncMethodsStruct
666  typedef struct {
667  unaryfunc am_await;
668  unaryfunc am_aiter;
669  unaryfunc am_anext;
670  } __Pyx_PyAsyncMethodsStruct;
671 #endif
672 
673 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
674  #if !defined(_USE_MATH_DEFINES)
675  #define _USE_MATH_DEFINES
676  #endif
677 #endif
678 #include <math.h>
679 #ifdef NAN
680 #define __PYX_NAN() ((float) NAN)
681 #else
682 static CYTHON_INLINE float __PYX_NAN() {
683  float value;
684  memset(&value, 0xFF, sizeof(value));
685  return value;
686 }
687 #endif
688 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
689 #define __Pyx_truncl trunc
690 #else
691 #define __Pyx_truncl truncl
692 #endif
693 
694 #define __PYX_MARK_ERR_POS(f_index, lineno) \
695  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
696 #define __PYX_ERR(f_index, lineno, Ln_error) \
697  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
698 
699 #ifndef __PYX_EXTERN_C
700  #ifdef __cplusplus
701  #define __PYX_EXTERN_C extern "C"
702  #else
703  #define __PYX_EXTERN_C extern
704  #endif
705 #endif
706 
707 #define __PYX_HAVE__mprans__MeshSmoothing
708 #define __PYX_HAVE_API__mprans__MeshSmoothing
709 /* Early includes */
710 #include <string.h>
711 #include <stdio.h>
712 #include "numpy/arrayobject.h"
713 #include "numpy/ndarrayobject.h"
714 #include "numpy/ndarraytypes.h"
715 #include "numpy/arrayscalars.h"
716 #include "numpy/ufuncobject.h"
717 
718  /* NumPy API declarations from "numpy/__init__.pxd" */
719 
720 #include <math.h>
721 #include "pythread.h"
722 #include <stdlib.h>
723 #include "pystate.h"
724 #ifdef _OPENMP
725 #include <omp.h>
726 #endif /* _OPENMP */
727 
728 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
729 #define CYTHON_WITHOUT_ASSERTIONS
730 #endif
731 
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;
734 
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;
755 }
756 #if defined (__cplusplus) && __cplusplus >= 201103L
757  #include <cstdlib>
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)
769 #else
770  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
771 #endif
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
782 #else
783  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
784  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
785 #endif
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;
804  while (*u_end++) ;
805  return (size_t)(u_end - u - 1);
806 }
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))
823 #else
824 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
825 #endif
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))
829 #else
830 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
831 #endif
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) {
836  PyObject* sys;
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");
842  if (!sys) goto bad;
843  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
844  Py_DECREF(sys);
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;
850  } else {
851  char ascii_chars[128];
852  int c;
853  for (c = 0; c < 128; c++) {
854  ascii_chars[c] = c;
855  }
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) {
861  PyErr_Format(
862  PyExc_ValueError,
863  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
864  default_encoding_c);
865  goto bad;
866  }
867  Py_DECREF(ascii_chars_u);
868  Py_DECREF(ascii_chars_b);
869  }
870  Py_DECREF(default_encoding);
871  return 0;
872 bad:
873  Py_XDECREF(default_encoding);
874  Py_XDECREF(ascii_chars_u);
875  Py_XDECREF(ascii_chars_b);
876  return -1;
877 }
878 #endif
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)
881 #else
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) {
886  PyObject* sys;
887  PyObject* default_encoding = NULL;
888  char* default_encoding_c;
889  sys = PyImport_ImportModule("sys");
890  if (!sys) goto bad;
891  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
892  Py_DECREF(sys);
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);
900  return 0;
901 bad:
902  Py_XDECREF(default_encoding);
903  return -1;
904 }
905 #endif
906 #endif
907 
908 
909 /* Test for GCC > 2.95 */
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)
913 #else /* !__GNUC__ or GCC < 2.95 */
914  #define likely(x) (x)
915  #define unlikely(x) (x)
916 #endif /* __GNUC__ */
917 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
918 
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;
930 
931 /* Header.proto */
932 #if !defined(CYTHON_CCOMPLEX)
933  #if defined(__cplusplus)
934  #define CYTHON_CCOMPLEX 1
935  #elif defined(_Complex_I)
936  #define CYTHON_CCOMPLEX 1
937  #else
938  #define CYTHON_CCOMPLEX 0
939  #endif
940 #endif
941 #if CYTHON_CCOMPLEX
942  #ifdef __cplusplus
943  #include <complex>
944  #else
945  #include <complex.h>
946  #endif
947 #endif
948 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
949  #undef _Complex_I
950  #define _Complex_I 1.0fj
951 #endif
952 
953 
954 static const char *__pyx_f[] = {
955  "proteus/mprans/MeshSmoothing.pyx",
956  "__init__.pxd",
957  "stringsource",
958  "type.pxd",
959 };
960 /* MemviewSliceStruct.proto */
961 struct __pyx_memoryview_obj;
962 typedef struct {
963  struct __pyx_memoryview_obj *memview;
964  char *data;
965  Py_ssize_t shape[8];
966  Py_ssize_t strides[8];
967  Py_ssize_t suboffsets[8];
968 } __Pyx_memviewslice;
969 #define __Pyx_MemoryView_Len(m) (m.shape[0])
970 
971 /* Atomics.proto */
972 #include <pythread.h>
973 #ifndef CYTHON_ATOMICS
974  #define CYTHON_ATOMICS 1
975 #endif
976 #define __pyx_atomic_int_type int
977 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
978  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
979  !defined(__i386__)
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"
984  #endif
985 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
986  #include <Windows.h>
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")
993  #endif
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"
999  #endif
1000 #else
1001  #undef CYTHON_ATOMICS
1002  #define CYTHON_ATOMICS 0
1003  #ifdef __PYX_DEBUG_ATOMICS
1004  #warning "Not using atomics"
1005  #endif
1006 #endif
1007 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1008 #if CYTHON_ATOMICS
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)
1013 #else
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)
1018 #endif
1019 
1020 /* ForceInitThreads.proto */
1021 #ifndef __PYX_FORCE_INIT_THREADS
1022  #define __PYX_FORCE_INIT_THREADS 0
1023 #endif
1024 
1025 /* NoFastGil.proto */
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()
1031 
1032 /* BufferFormatStructs.proto */
1033 #define IS_UNSIGNED(type) (((type) -1) > 0)
1034 struct __Pyx_StructField_;
1035 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1036 typedef struct {
1037  const char* name;
1038  struct __Pyx_StructField_* fields;
1039  size_t size;
1040  size_t arraysize[8];
1041  int ndim;
1042  char typegroup;
1043  char is_unsigned;
1044  int flags;
1045 } __Pyx_TypeInfo;
1046 typedef struct __Pyx_StructField_ {
1047  __Pyx_TypeInfo* type;
1048  const char* name;
1049  size_t offset;
1050 } __Pyx_StructField;
1051 typedef struct {
1052  __Pyx_StructField* field;
1053  size_t parent_offset;
1054 } __Pyx_BufFmt_StackElem;
1055 typedef struct {
1056  __Pyx_StructField root;
1057  __Pyx_BufFmt_StackElem* head;
1058  size_t fmt_offset;
1059  size_t new_count, enc_count;
1060  size_t struct_alignment;
1061  int is_complex;
1062  char enc_type;
1063  char new_packmode;
1064  char enc_packmode;
1065  char is_valid_array;
1066 } __Pyx_BufFmt_Context;
1067 
1068 
1069 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
1070  * # in Cython to enable them only on the right systems.
1071  *
1072  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1073  * ctypedef npy_int16 int16_t
1074  * ctypedef npy_int32 int32_t
1075  */
1076 typedef npy_int8 __pyx_t_5numpy_int8_t;
1077 
1078 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
1079  *
1080  * ctypedef npy_int8 int8_t
1081  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1082  * ctypedef npy_int32 int32_t
1083  * ctypedef npy_int64 int64_t
1084  */
1085 typedef npy_int16 __pyx_t_5numpy_int16_t;
1086 
1087 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
1088  * ctypedef npy_int8 int8_t
1089  * ctypedef npy_int16 int16_t
1090  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1091  * ctypedef npy_int64 int64_t
1092  * #ctypedef npy_int96 int96_t
1093  */
1094 typedef npy_int32 __pyx_t_5numpy_int32_t;
1095 
1096 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
1097  * ctypedef npy_int16 int16_t
1098  * ctypedef npy_int32 int32_t
1099  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1100  * #ctypedef npy_int96 int96_t
1101  * #ctypedef npy_int128 int128_t
1102  */
1103 typedef npy_int64 __pyx_t_5numpy_int64_t;
1104 
1105 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
1106  * #ctypedef npy_int128 int128_t
1107  *
1108  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1109  * ctypedef npy_uint16 uint16_t
1110  * ctypedef npy_uint32 uint32_t
1111  */
1112 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1113 
1114 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1115  *
1116  * ctypedef npy_uint8 uint8_t
1117  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1118  * ctypedef npy_uint32 uint32_t
1119  * ctypedef npy_uint64 uint64_t
1120  */
1121 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1122 
1123 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1124  * ctypedef npy_uint8 uint8_t
1125  * ctypedef npy_uint16 uint16_t
1126  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1127  * ctypedef npy_uint64 uint64_t
1128  * #ctypedef npy_uint96 uint96_t
1129  */
1130 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1131 
1132 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1133  * ctypedef npy_uint16 uint16_t
1134  * ctypedef npy_uint32 uint32_t
1135  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1136  * #ctypedef npy_uint96 uint96_t
1137  * #ctypedef npy_uint128 uint128_t
1138  */
1139 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1140 
1141 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1142  * #ctypedef npy_uint128 uint128_t
1143  *
1144  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1145  * ctypedef npy_float64 float64_t
1146  * #ctypedef npy_float80 float80_t
1147  */
1148 typedef npy_float32 __pyx_t_5numpy_float32_t;
1149 
1150 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1151  *
1152  * ctypedef npy_float32 float32_t
1153  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1154  * #ctypedef npy_float80 float80_t
1155  * #ctypedef npy_float128 float128_t
1156  */
1157 typedef npy_float64 __pyx_t_5numpy_float64_t;
1158 
1159 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1160  * # The int types are mapped a bit surprising --
1161  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1162  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1163  * ctypedef npy_longlong long_t
1164  * ctypedef npy_longlong longlong_t
1165  */
1166 typedef npy_long __pyx_t_5numpy_int_t;
1167 
1168 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1169  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1170  * ctypedef npy_long int_t
1171  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1172  * ctypedef npy_longlong longlong_t
1173  *
1174  */
1175 typedef npy_longlong __pyx_t_5numpy_long_t;
1176 
1177 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1178  * ctypedef npy_long int_t
1179  * ctypedef npy_longlong long_t
1180  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1181  *
1182  * ctypedef npy_ulong uint_t
1183  */
1184 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1185 
1186 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1187  * ctypedef npy_longlong longlong_t
1188  *
1189  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1190  * ctypedef npy_ulonglong ulong_t
1191  * ctypedef npy_ulonglong ulonglong_t
1192  */
1193 typedef npy_ulong __pyx_t_5numpy_uint_t;
1194 
1195 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1196  *
1197  * ctypedef npy_ulong uint_t
1198  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1199  * ctypedef npy_ulonglong ulonglong_t
1200  *
1201  */
1202 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1203 
1204 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1205  * ctypedef npy_ulong uint_t
1206  * ctypedef npy_ulonglong ulong_t
1207  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1208  *
1209  * ctypedef npy_intp intp_t
1210  */
1211 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1212 
1213 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1214  * ctypedef npy_ulonglong ulonglong_t
1215  *
1216  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1217  * ctypedef npy_uintp uintp_t
1218  *
1219  */
1220 typedef npy_intp __pyx_t_5numpy_intp_t;
1221 
1222 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1223  *
1224  * ctypedef npy_intp intp_t
1225  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1226  *
1227  * ctypedef npy_double float_t
1228  */
1229 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1230 
1231 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1232  * ctypedef npy_uintp uintp_t
1233  *
1234  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1235  * ctypedef npy_double double_t
1236  * ctypedef npy_longdouble longdouble_t
1237  */
1238 typedef npy_double __pyx_t_5numpy_float_t;
1239 
1240 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1241  *
1242  * ctypedef npy_double float_t
1243  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1244  * ctypedef npy_longdouble longdouble_t
1245  *
1246  */
1247 typedef npy_double __pyx_t_5numpy_double_t;
1248 
1249 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1250  * ctypedef npy_double float_t
1251  * ctypedef npy_double double_t
1252  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1253  *
1254  * ctypedef npy_cfloat cfloat_t
1255  */
1256 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1257 /* Declarations.proto */
1258 #if CYTHON_CCOMPLEX
1259  #ifdef __cplusplus
1260  typedef ::std::complex< float > __pyx_t_float_complex;
1261  #else
1262  typedef float _Complex __pyx_t_float_complex;
1263  #endif
1264 #else
1265  typedef struct { float real, imag; } __pyx_t_float_complex;
1266 #endif
1267 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1268 
1269 /* Declarations.proto */
1270 #if CYTHON_CCOMPLEX
1271  #ifdef __cplusplus
1272  typedef ::std::complex< double > __pyx_t_double_complex;
1273  #else
1274  typedef double _Complex __pyx_t_double_complex;
1275  #endif
1276 #else
1277  typedef struct { double real, imag; } __pyx_t_double_complex;
1278 #endif
1279 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1280 
1281 
1282 /*--- Type declarations ---*/
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;
1290 
1291 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1292  * ctypedef npy_longdouble longdouble_t
1293  *
1294  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1295  * ctypedef npy_cdouble cdouble_t
1296  * ctypedef npy_clongdouble clongdouble_t
1297  */
1298 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1299 
1300 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1301  *
1302  * ctypedef npy_cfloat cfloat_t
1303  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1304  * ctypedef npy_clongdouble clongdouble_t
1305  *
1306  */
1307 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1308 
1309 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1310  * ctypedef npy_cfloat cfloat_t
1311  * ctypedef npy_cdouble cdouble_t
1312  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1313  *
1314  * ctypedef npy_cdouble complex_t
1315  */
1316 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1317 
1318 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1319  * ctypedef npy_clongdouble clongdouble_t
1320  *
1321  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1322  *
1323  * cdef inline object PyArray_MultiIterNew1(a):
1324  */
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;
1331 
1332 /* "mprans/MeshSmoothing.pxd":6
1333  * from libcpp cimport bool
1334  *
1335  * cdef void cySmoothNodesLaplace(double[:,:] nodeArray_, # <<<<<<<<<<<<<<
1336  * int[:] nodeStarOffsets,
1337  * int[:] nodeStarArray,
1338  */
1339 struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesLaplace {
1340  int __pyx_n;
1341  bool simultaneous;
1342  bool smoothBoundaries;
1343  __Pyx_memviewslice fixedNodesBoolArray;
1344  double alpha;
1345 };
1346 
1347 /* "mprans/MeshSmoothing.pxd":17
1348  * double alpha=*)
1349  *
1350  * cdef void cySmoothNodesCentroid(double[:,:] nodeArray_, # <<<<<<<<<<<<<<
1351  * int[:] nodeElementOffsets,
1352  * int[:] nodeElementsArray,
1353  */
1354 struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesCentroid {
1355  int __pyx_n;
1356  bool simultaneous;
1357  bool smoothBoundaries;
1358  double alpha;
1359 };
1360 
1361 /* "mprans/MeshSmoothing.pxd":41
1362  * int nElements)
1363  *
1364  * cdef void cyUpdateInverseMeanRatioTriangleNodes(double[:] IMRNodesArray_, # <<<<<<<<<<<<<<
1365  * double[:,:] nodeArray,
1366  * int[:,:] elementNodesArray,
1367  */
1368 struct __pyx_opt_args_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleNodes {
1369  int __pyx_n;
1370  bool el_average;
1371 };
1372 
1373 /* "mprans/MeshSmoothing.pxd":55
1374  * int nElements)
1375  *
1376  * cdef double cyGetInverseMeanRatioSingleTriangle(int node0, # <<<<<<<<<<<<<<
1377  * double[:,:] nodeArray,
1378  * int[:,:] elementNodesArray,
1379  */
1380 struct __pyx_opt_args_6mprans_13MeshSmoothing_cyGetInverseMeanRatioSingleTriangle {
1381  int __pyx_n;
1382  bool el_average;
1383 };
1384 
1385 /* "mprans/MeshSmoothing.pxd":62
1386  * bool el_average=*)
1387  *
1388  * cdef double[:,:] cySmoothNodesQuality(double[:] distortion, # <<<<<<<<<<<<<<
1389  * double[:] dilation,
1390  * double[:,:] nodeArray,
1391  */
1392 struct __pyx_opt_args_6mprans_13MeshSmoothing_cySmoothNodesQuality {
1393  int __pyx_n;
1394  bool apply_directly;
1395 };
1396 
1397 /* "mprans/MeshSmoothing.pyx":559
1398  * nNodes=nNodes)
1399  *
1400  * def getNonOwnedNodeValues(args_, # <<<<<<<<<<<<<<
1401  * int nNodes_owned,
1402  * int nNodes_global,
1403  */
1404 struct __pyx_obj_6mprans_13MeshSmoothing___pyx_scope_struct__getNonOwnedNodeValues {
1405  PyObject_HEAD
1406  int __pyx_v_comm_size;
1407 };
1408 
1409 
1410 /* "mprans/MeshSmoothing.pyx":625
1411  * comm.Gatherv(my_size,
1412  * [counts_in,
1413  * tuple(1 for i in range(comm_size)), # <<<<<<<<<<<<<<
1414  * tuple(i for i in range(comm_size)),
1415  * MPI.INT],
1416  */
1417 struct __pyx_obj_6mprans_13MeshSmoothing___pyx_scope_struct_1_genexpr {
1418  PyObject_HEAD
1419  struct __pyx_obj_6mprans_13MeshSmoothing___pyx_scope_struct__getNonOwnedNodeValues *__pyx_outer_scope;
1420  int __pyx_v_i;
1421  int __pyx_t_0;
1422  int __pyx_t_1;
1423  int __pyx_t_2;
1424 };
1425 
1426 
1427 /* "mprans/MeshSmoothing.pyx":626
1428  * [counts_in,
1429  * tuple(1 for i in range(comm_size)),
1430  * tuple(i for i in range(comm_size)), # <<<<<<<<<<<<<<
1431  * MPI.INT],
1432  * root=rank_recv
1433  */
1434 struct __pyx_obj_6mprans_13MeshSmoothing___pyx_scope_struct_2_genexpr {
1435  PyObject_HEAD
1436  struct __pyx_obj_6mprans_13MeshSmoothing___pyx_scope_struct__getNonOwnedNodeValues *__pyx_outer_scope;
1437  int __pyx_v_i;
1438  int __pyx_t_0;
1439  int __pyx_t_1;
1440  int __pyx_t_2;
1441 };
1442 
1443 
1444 /* "View.MemoryView":105
1445  *
1446  * @cname("__pyx_array")
1447  * cdef class array: # <<<<<<<<<<<<<<
1448  *
1449  * cdef:
1450  */
1451 struct __pyx_array_obj {
1452  PyObject_HEAD
1453  struct __pyx_vtabstruct_array *__pyx_vtab;
1454  char *data;
1455  Py_ssize_t len;
1456  char *format;
1457  int ndim;
1458  Py_ssize_t *_shape;
1459  Py_ssize_t *_strides;
1460  Py_ssize_t itemsize;
1461  PyObject *mode;
1462  PyObject *_format;
1463  void (*callback_free_data)(void *);
1464  int free_data;
1465  int dtype_is_object;
1466 };
1467 
1468 
1469 /* "View.MemoryView":279
1470  *
1471  * @cname('__pyx_MemviewEnum')
1472  * cdef class Enum(object): # <<<<<<<<<<<<<<
1473  * cdef object name
1474  * def __init__(self, name):
1475  */
1476 struct __pyx_MemviewEnum_obj {
1477  PyObject_HEAD
1478  PyObject *name;
1479 };
1480 
1481 
1482 /* "View.MemoryView":330
1483  *
1484  * @cname('__pyx_memoryview')
1485  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1486  *
1487  * cdef object obj
1488  */
1489 struct __pyx_memoryview_obj {
1490  PyObject_HEAD
1491  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1492  PyObject *obj;
1493  PyObject *_size;
1494  PyObject *_array_interface;
1495  PyThread_type_lock lock;
1496  __pyx_atomic_int acquisition_count[2];
1497  __pyx_atomic_int *acquisition_count_aligned_p;
1498  Py_buffer view;
1499  int flags;
1500  int dtype_is_object;
1501  __Pyx_TypeInfo *typeinfo;
1502 };
1503 
1504 
1505 /* "View.MemoryView":965
1506  *
1507  * @cname('__pyx_memoryviewslice')
1508  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1509  * "Internal class for passing memoryview slices to Python"
1510  *
1511  */
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 *);
1518 };
1519 
1520 
1521 
1522 /* "View.MemoryView":105
1523  *
1524  * @cname("__pyx_array")
1525  * cdef class array: # <<<<<<<<<<<<<<
1526  *
1527  * cdef:
1528  */
1529 
1530 struct __pyx_vtabstruct_array {
1531  PyObject *(*get_memview)(struct __pyx_array_obj *);
1532 };
1533 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1534 
1535 
1536 /* "View.MemoryView":330
1537  *
1538  * @cname('__pyx_memoryview')
1539  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1540  *
1541  * cdef object obj
1542  */
1543 
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 *);
1552 };
1553 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1554 
1555 
1556 /* "View.MemoryView":965
1557  *
1558  * @cname('__pyx_memoryviewslice')
1559  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1560  * "Internal class for passing memoryview slices to Python"
1561  *
1562  */
1563 
1564 struct __pyx_vtabstruct__memoryviewslice {
1565  struct __pyx_vtabstruct_memoryview __pyx_base;
1566 };
1567 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1568 
1569 /* --- Runtime support code (head) --- */
1570 /* Refnanny.proto */
1571 #ifndef CYTHON_REFNANNY
1572  #define CYTHON_REFNANNY 0
1573 #endif
1574 #if CYTHON_REFNANNY
1575  typedef struct {
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;
1586 #ifdef WITH_THREAD
1587  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1588  if (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);\
1592  } else {\
1593  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1594  }
1595 #else
1596  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1597  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1598 #endif
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)
1609 #else
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)
1621 #endif
1622 #define __Pyx_XDECREF_SET(r, v) do {\
1623  PyObject *tmp = (PyObject *) r;\
1624  r = v; __Pyx_XDECREF(tmp);\
1625  } while (0)
1626 #define __Pyx_DECREF_SET(r, v) do {\
1627  PyObject *tmp = (PyObject *) r;\
1628  r = v; __Pyx_DECREF(tmp);\
1629  } while (0)
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)
1632 
1633 /* PyObjectGetAttrStr.proto */
1634 #if CYTHON_USE_TYPE_SLOTS
1635 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1636 #else
1637 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1638 #endif
1639 
1640 /* GetBuiltinName.proto */
1641 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1642 
1643 /* RaiseArgTupleInvalid.proto */
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);
1646 
1647 /* RaiseDoubleKeywords.proto */
1648 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1649 
1650 /* ParseKeywords.proto */
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);
1654 
1655 /* MemviewSliceInit.proto */
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,
1667  int ndim,
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);
1680 
1681 /* PyDictVersioning.proto */
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;\
1693  } else {\
1694  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1695  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1696  }\
1697 }
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);
1701 #else
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);
1705 #endif
1706 
1707 /* GetModuleGlobalName.proto */
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);\
1715 }
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);\
1720 }
1721 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1722 #else
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);
1726 #endif
1727 
1728 /* PyCFunctionFastCall.proto */
1729 #if CYTHON_FAST_PYCCALL
1730 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1731 #else
1732 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1733 #endif
1734 
1735 /* PyFunctionFastCall.proto */
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);
1741 #else
1742 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1743 #endif
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)
1748 #endif
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
1755  #endif
1756  #include "internal/pycore_frame.h"
1757 #endif
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
1764 #endif
1765 
1766 /* PyObjectCall.proto */
1767 #if CYTHON_COMPILING_IN_CPYTHON
1768 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1769 #else
1770 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1771 #endif
1772 
1773 /* PyObjectCall2Args.proto */
1774 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1775 
1776 /* PyObjectCallMethO.proto */
1777 #if CYTHON_COMPILING_IN_CPYTHON
1778 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1779 #endif
1780 
1781 /* PyObjectCallOneArg.proto */
1782 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1783 
1784 /* PyIntBinop.proto */
1785 #if !CYTHON_COMPILING_IN_PYPY
1786 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1787 #else
1788 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1789  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1790 #endif
1791 
1792 /* GetItemInt.proto */
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);
1813 
1814 /* ObjectGetItem.proto */
1815 #if CYTHON_USE_TYPE_SLOTS
1816 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1817 #else
1818 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1819 #endif
1820 
1821 /* ListAppend.proto */
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))) {
1827  Py_INCREF(x);
1828  PyList_SET_ITEM(list, len, x);
1829  __Pyx_SET_SIZE(list, len + 1);
1830  return 0;
1831  }
1832  return PyList_Append(list, x);
1833 }
1834 #else
1835 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1836 #endif
1837 
1838 /* IterFinish.proto */
1839 static CYTHON_INLINE int __Pyx_IterFinish(void);
1840 
1841 /* set_iter.proto */
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,
1847  int source_is_set);
1848 
1849 /* PySequenceContains.proto */
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));
1853 }
1854 
1855 /* Import.proto */
1856 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1857 
1858 /* ImportFrom.proto */
1859 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1860 
1861 /* PyObjectCallNoArg.proto */
1862 #if CYTHON_COMPILING_IN_CPYTHON
1863 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1864 #else
1865 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1866 #endif
1867 
1868 /* DictGetItem.proto */
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))
1874 #else
1875 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1876 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1877 #endif
1878 
1879 /* SliceObject.proto */
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);
1884 
1885 /* SetItemInt.proto */
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);
1894 
1895 /* PyThreadStateGet.proto */
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
1900 #else
1901 #define __Pyx_PyThreadState_declare
1902 #define __Pyx_PyThreadState_assign
1903 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1904 #endif
1905 
1906 /* PyErrFetchRestore.proto */
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))
1917 #else
1918 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1919 #endif
1920 #else
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)
1929 #endif
1930 
1931 /* WriteUnraisableException.proto */
1932 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1933  int lineno, const char *filename,
1934  int full_traceback, int nogil);
1935 
1936 /* ExtTypeTest.proto */
1937 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1938 
1939 /* IncludeStringH.proto */
1940 #include <string.h>
1941 
1942 /* GetTopmostException.proto */
1943 #if CYTHON_USE_EXC_INFO_STACK
1944 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1945 #endif
1946 
1947 /* SaveResetException.proto */
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);
1953 #else
1954 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1955 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1956 #endif
1957 
1958 /* PyErrExceptionMatches.proto */
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);
1962 #else
1963 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1964 #endif
1965 
1966 /* GetException.proto */
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);
1970 #else
1971 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1972 #endif
1973 
1974 /* RaiseException.proto */
1975 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1976 
1977 /* ArgTypeTest.proto */
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);
1982 
1983 /* BytesEquals.proto */
1984 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1985 
1986 /* UnicodeEquals.proto */
1987 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1988 
1989 /* StrEquals.proto */
1990 #if PY_MAJOR_VERSION >= 3
1991 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1992 #else
1993 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1994 #endif
1995 
1996 /* UnaryNegOverflows.proto */
1997 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1998  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1999 
2000 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2001 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2002 /* GetAttr.proto */
2003 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2004 
2005 /* decode_c_string_utf16.proto */
2006 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2007  int byteorder = 0;
2008  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2009 }
2010 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2011  int byteorder = -1;
2012  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2013 }
2014 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2015  int byteorder = 1;
2016  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2017 }
2018 
2019 /* decode_c_string.proto */
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));
2024 
2025 /* GetAttr3.proto */
2026 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2027 
2028 /* RaiseTooManyValuesToUnpack.proto */
2029 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2030 
2031 /* RaiseNeedMoreValuesToUnpack.proto */
2032 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2033 
2034 /* RaiseNoneIterError.proto */
2035 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2036 
2037 /* SwapException.proto */
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);
2041 #else
2042 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2043 #endif
2044 
2045 /* FastTypeChecks.proto */
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);
2051 #else
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))
2055 #endif
2056 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2057 
2058 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2059 /* ListCompAppend.proto */
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)) {
2065  Py_INCREF(x);
2066  PyList_SET_ITEM(list, len, x);
2067  __Pyx_SET_SIZE(list, len + 1);
2068  return 0;
2069  }
2070  return PyList_Append(list, x);
2071 }
2072 #else
2073 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2074 #endif
2075 
2076 /* ListExtend.proto */
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))
2081  return -1;
2082  Py_DECREF(none);
2083  return 0;
2084 #else
2085  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2086 #endif
2087 }
2088 
2089 /* None.proto */
2090 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2091 
2092 /* HasAttr.proto */
2093 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2094 
2095 /* StringJoin.proto */
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))
2099 #else
2100 #define __Pyx_PyString_Join PyUnicode_Join
2101 #define __Pyx_PyBaseString_Join PyUnicode_Join
2102 #endif
2103 #if CYTHON_COMPILING_IN_CPYTHON
2104  #if PY_MAJOR_VERSION < 3
2105  #define __Pyx_PyBytes_Join _PyString_Join
2106  #else
2107  #define __Pyx_PyBytes_Join _PyBytes_Join
2108  #endif
2109 #else
2110 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2111 #endif
2112 
2113 /* PyObject_Unicode.proto */
2114 #if PY_MAJOR_VERSION >= 3
2115 #define __Pyx_PyObject_Unicode(obj)\
2116  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2117 #else
2118 #define __Pyx_PyObject_Unicode(obj)\
2119  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2120 #endif
2121 
2122 /* PyObject_GenericGetAttrNoDict.proto */
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);
2125 #else
2126 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2127 #endif
2128 
2129 /* PyObject_GenericGetAttr.proto */
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);
2132 #else
2133 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2134 #endif
2135 
2136 /* SetVTable.proto */
2137 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2138 
2139 /* PyObjectGetAttrStrNoError.proto */
2140 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2141 
2142 /* SetupReduce.proto */
2143 static int __Pyx_setup_reduce(PyObject* type_obj);
2144 
2145 /* TypeImport.proto */
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
2152 };
2153 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2154 #endif
2155 
2156 /* CLineInTraceback.proto */
2157 #ifdef CYTHON_CLINE_IN_TRACEBACK
2158 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2159 #else
2160 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2161 #endif
2162 
2163 /* CodeObjectCache.proto */
2164 typedef struct {
2165  PyCodeObject* code_object;
2166  int code_line;
2167 } __Pyx_CodeObjectCacheEntry;
2168 struct __Pyx_CodeObjectCache {
2169  int count;
2170  int max_count;
2171  __Pyx_CodeObjectCacheEntry* entries;
2172 };
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);
2177 
2178 /* AddTraceback.proto */
2179 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2180  int py_line, const char *filename);
2181 
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);
2185 #else
2186  #define __Pyx_GetBuffer PyObject_GetBuffer
2187  #define __Pyx_ReleaseBuffer PyBuffer_Release
2188 #endif
2189 
2190 
2191 /* BufferStructDeclare.proto */
2192 typedef struct {
2193  Py_ssize_t shape, strides, suboffsets;
2194 } __Pyx_Buf_DimInfo;
2195 typedef struct {
2196  size_t refcount;
2197  Py_buffer pybuffer;
2198 } __Pyx_Buffer;
2199 typedef struct {
2200  __Pyx_Buffer *rcbuffer;
2201  char *data;
2202  __Pyx_Buf_DimInfo diminfo[8];
2203 } __Pyx_LocalBuf_ND;
2204 
2205 /* MemviewSliceIsContig.proto */
2206 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2207 
2208 /* OverlappingSlices.proto */
2209 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2210  __Pyx_memviewslice *slice2,
2211  int ndim, size_t itemsize);
2212 
2213 /* Capsule.proto */
2214 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2215 
2216 /* IsLittleEndian.proto */
2217 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2218 
2219 /* BufferFormatCheck.proto */
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);
2224 
2225 /* TypeInfoCompare.proto */
2226 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2227 
2228 /* MemviewSliceValidateAndInit.proto */
2229 static int __Pyx_ValidateAndInit_memviewslice(
2230  int *axes_specs,
2231  int c_or_f_flag,
2232  int buf_flags,
2233  int ndim,
2234  __Pyx_TypeInfo *dtype,
2235  __Pyx_BufFmt_StackElem stack[],
2236  __Pyx_memviewslice *memviewslice,
2237  PyObject *original_obj);
2238 
2239 /* ObjectToMemviewSlice.proto */
2240 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2241 
2242 /* ObjectToMemviewSlice.proto */
2243 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *, int writable_flag);
2244 
2245 /* GCCDiagnostics.proto */
2246 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2247 #define __Pyx_HAS_GCC_DIAGNOSTIC
2248 #endif
2249 
2250 /* ObjectToMemviewSlice.proto */
2251 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2252 
2253 /* ObjectToMemviewSlice.proto */
2254 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *, int writable_flag);
2255 
2256 /* ObjectToMemviewSlice.proto */
2257 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_double(PyObject *, int writable_flag);
2258 
2259 /* ObjectToMemviewSlice.proto */
2260 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(PyObject *, int writable_flag);
2261 
2262 /* MemviewDtypeToObject.proto */
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);
2265 
2266 /* MemviewDtypeToObject.proto */
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);
2269 
2270 /* RealImag.proto */
2271 #if CYTHON_CCOMPLEX
2272  #ifdef __cplusplus
2273  #define __Pyx_CREAL(z) ((z).real())
2274  #define __Pyx_CIMAG(z) ((z).imag())
2275  #else
2276  #define __Pyx_CREAL(z) (__real__(z))
2277  #define __Pyx_CIMAG(z) (__imag__(z))
2278  #endif
2279 #else
2280  #define __Pyx_CREAL(z) ((z).real)
2281  #define __Pyx_CIMAG(z) ((z).imag)
2282 #endif
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))
2287 #else
2288  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2289  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2290 #endif
2291 
2292 /* Arithmetic.proto */
2293 #if CYTHON_CCOMPLEX
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))
2300  #ifdef __cplusplus
2301  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2302  #define __Pyx_c_conj_float(z) (::std::conj(z))
2303  #if 1
2304  #define __Pyx_c_abs_float(z) (::std::abs(z))
2305  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2306  #endif
2307  #else
2308  #define __Pyx_c_is_zero_float(z) ((z)==0)
2309  #define __Pyx_c_conj_float(z) (conjf(z))
2310  #if 1
2311  #define __Pyx_c_abs_float(z) (cabsf(z))
2312  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2313  #endif
2314  #endif
2315 #else
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);
2324  #if 1
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);
2327  #endif
2328 #endif
2329 
2330 /* Arithmetic.proto */
2331 #if CYTHON_CCOMPLEX
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))
2338  #ifdef __cplusplus
2339  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2340  #define __Pyx_c_conj_double(z) (::std::conj(z))
2341  #if 1
2342  #define __Pyx_c_abs_double(z) (::std::abs(z))
2343  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2344  #endif
2345  #else
2346  #define __Pyx_c_is_zero_double(z) ((z)==0)
2347  #define __Pyx_c_conj_double(z) (conj(z))
2348  #if 1
2349  #define __Pyx_c_abs_double(z) (cabs(z))
2350  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2351  #endif
2352  #endif
2353 #else
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);
2362  #if 1
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);
2365  #endif
2366 #endif
2367 
2368 /* MemviewSliceCopyTemplate.proto */
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);
2374 
2375 /* CIntFromPy.proto */
2376 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2377 
2378 /* CIntToPy.proto */
2379 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2380 
2381 /* CIntFromPy.proto */
2382 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2383 
2384 /* TypeInfoToFormat.proto */
2385 struct __pyx_typeinfo_string {
2386  char string[3];
2387 };
2388 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2389 
2390 /* CIntToPy.proto */
2391 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2392 
2393 /* CopyContentsUtility.proto */
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),\
2397  0)
2398 
2399 /* CopyContentsUtility.proto */
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),\
2403  0)
2404 
2405 /* CIntFromPy.proto */
2406 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2407 
2408 /* FetchCommonType.proto */
2409 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2410 
2411 /* PyObjectGetMethod.proto */
2412 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2413 
2414 /* PyObjectCallMethod1.proto */
2415 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
2416 
2417 /* CoroutineBase.proto */
2418 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
2419 #if CYTHON_USE_EXC_INFO_STACK
2420 #define __Pyx_ExcInfoStruct _PyErr_StackItem
2421 #else
2422 typedef struct {
2423  PyObject *exc_type;
2424  PyObject *exc_value;
2425  PyObject *exc_traceback;
2426 } __Pyx_ExcInfoStruct;
2427 #endif
2428 typedef struct {
2429  PyObject_HEAD
2430  __pyx_coroutine_body_t body;
2431  PyObject *closure;
2432  __Pyx_ExcInfoStruct gi_exc_state;
2433  PyObject *gi_weakreflist;
2434  PyObject *classobj;
2435  PyObject *yieldfrom;
2436  PyObject *gi_name;
2437  PyObject *gi_qualname;
2438  PyObject *gi_modulename;
2439  PyObject *gi_code;
2440  PyObject *gi_frame;
2441  int resume_label;
2442  char is_running;
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)
2458 #else
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);\
2462  }
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;\
2466  }
2467 #endif
2468 #if CYTHON_FAST_THREAD_STATE
2469 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2470  __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
2471 #else
2472 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2473  __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
2474 #endif
2475 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
2476 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
2477 
2478 /* PatchModuleWithCoroutine.proto */
2479 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
2480 
2481 /* PatchGeneratorABC.proto */
2482 static int __Pyx_patch_abc(void);
2483 
2484 /* Generator.proto */
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);
2492 
2493 /* CheckBinaryVersion.proto */
2494 static int __Pyx_check_binary_version(void);
2495 
2496 /* FunctionExport.proto */
2497 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
2498 
2499 /* InitStrings.proto */
2500 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2501 
2502 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2503 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2504 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2505 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
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); /* proto*/
2507 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2508 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2509 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2510 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2511 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2512 
2513 /* Module declarations from 'cython.view' */
2514 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2515 
2516 /* Module declarations from 'cython' */
2517 
2518 /* Module declarations from 'cpython.buffer' */
2519 
2520 /* Module declarations from 'libc.string' */
2521 
2522 /* Module declarations from 'libc.stdio' */
2523 
2524 /* Module declarations from '__builtin__' */
2525 
2526 /* Module declarations from 'cpython.type' */
2527 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2528 
2529 /* Module declarations from 'cpython' */
2530 
2531 /* Module declarations from 'cpython.object' */
2532 
2533 /* Module declarations from 'cpython.ref' */
2534 
2535 /* Module declarations from 'cpython.mem' */
2536 
2537 /* Module declarations from 'numpy' */
2538 
2539 /* Module declarations from 'numpy' */
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;
2555 
2556 /* Module declarations from 'libcpp' */
2557 
2558 /* Module declarations from 'libc.math' */
2559 
2560 /* Module declarations from 'mprans.MeshSmoothing' */
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); /*proto*/
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); /*proto*/
2577 static void __pyx_f_6mprans_13MeshSmoothing_cyUpdateDilationElements(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2578 static void __pyx_f_6mprans_13MeshSmoothing_cyUpdateDistortionElements(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int); /*proto*/
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); /*proto*/
2580 static void __pyx_f_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleElements(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
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); /*proto*/
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); /*proto*/
2583 static int __pyx_f_6mprans_13MeshSmoothing_pyxGetLocalNearestNode(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2584 static int __pyx_f_6mprans_13MeshSmoothing_pyxGetLocalNearestElement(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2585 static __Pyx_memviewslice __pyx_f_6mprans_13MeshSmoothing_pyxGetLocalNearestElementIntersection(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2586 static int __pyx_f_6mprans_13MeshSmoothing_pyxGetLocalNearestElementAroundNode(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2587 static void __pyx_f_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTetra(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2588 static void __pyx_f_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTriangle(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2589 static void __pyx_f_6mprans_13MeshSmoothing_cyUpdateElementVolumesTriangle(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2590 static void __pyx_f_6mprans_13MeshSmoothing_cyUpdateElementVolumesTetra(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2591 static void __pyx_f_6mprans_13MeshSmoothing_cyUpdateElementBarycenters(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2592 static PyArrayObject *__pyx_f_6mprans_13MeshSmoothing_cyGetCornerNodesTriangle(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2593 static __Pyx_memviewslice __pyx_f_6mprans_13MeshSmoothing_cyCheckOwnedVariable(int, int, int, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2594 static __Pyx_memviewslice __pyx_f_6mprans_13MeshSmoothing_cyScalarRecoveryAtNodes(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2595 static __Pyx_memviewslice __pyx_f_6mprans_13MeshSmoothing_cyScalarRecoveryAtNodesWeighted(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2596 static __Pyx_memviewslice __pyx_f_6mprans_13MeshSmoothing_cyVectorRecoveryAtNodesWeighted(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2597 static __Pyx_memviewslice __pyx_f_6mprans_13MeshSmoothing_cyVectorRecoveryAtNodes(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2598 static void __pyx_f_6mprans_13MeshSmoothing_cyFindBoundaryDirectionTriangle(__Pyx_memviewslice, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2599 static void __pyx_f_6mprans_13MeshSmoothing_cyFindBoundaryDirectionTetra(__Pyx_memviewslice, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2600 static double __pyx_f_6mprans_13MeshSmoothing_cyGetElementVolumeTriangle(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2601 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2602 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2603 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2604 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2605 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2606 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2607 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
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); /*proto*/
2609 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2610 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2611 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2612 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2613 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2614 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2615 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2616 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2617 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2618 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2619 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2620 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2621 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2622 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2623 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2624 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2625 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2626 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2627 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2628 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2629 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2630 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2631 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2632 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2633 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2634 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
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;
2640 
2641 /* Implementation of 'mprans.MeshSmoothing' */
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); /* proto */
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); /* proto */
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); /* proto */
3210 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_6getDilationElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_elementVolumeArray, __Pyx_memviewslice __pyx_v_elementVolumeTargetArray); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
3214 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_14getInverseMeanRatioTriangleElements(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_elementNodesArray); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
3233 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_21getNonOwnedNodeValues_genexpr(PyObject *__pyx_self); /* proto */
3234 static PyObject *__pyx_pf_6mprans_13MeshSmoothing_21getNonOwnedNodeValues_3genexpr(PyObject *__pyx_self); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
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); /* proto */
3243 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3244 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3245 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3246 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3247 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
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); /* proto */
3249 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
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); /* proto */
3251 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3252 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3253 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3254 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
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); /* proto */
3256 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3257 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
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); /* proto */
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); /* proto */
3260 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3261 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3262 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3263 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3264 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3265 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3266 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3267 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3268 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3269 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3270 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3271 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3272 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3273 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3274 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3275 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3276 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
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); /* proto */
3278 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3279 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3280 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
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); /* proto */
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); /* proto */
3283 static PyObject *__pyx_tp_new_6mprans_13MeshSmoothing___pyx_scope_struct__getNonOwnedNodeValues(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3284 static PyObject *__pyx_tp_new_6mprans_13MeshSmoothing___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3285 static PyObject *__pyx_tp_new_6mprans_13MeshSmoothing___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3286 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3287 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3288 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3289 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
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;
3399 /* Late includes */
3400 
3401 /* "mprans/MeshSmoothing.pyx":11
3402  * from proteus.Profiling import logEvent
3403  *
3404  * def smoothNodesLaplace(double[:,:] nodeArray_, # <<<<<<<<<<<<<<
3405  * int[:] nodeStarOffsets,
3406  * int[:] nodeStarArray,
3407  */
3408 
3409 /* Python wrapper */
3410 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_1smoothNodesLaplace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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;
3419  int __pyx_v_nd;
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);
3430  {
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)) {
3434  Py_ssize_t kw_args;
3435  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3436  switch (pos_args) {
3437  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3438  CYTHON_FALLTHROUGH;
3439  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3440  CYTHON_FALLTHROUGH;
3441  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3442  CYTHON_FALLTHROUGH;
3443  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3444  CYTHON_FALLTHROUGH;
3445  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3446  CYTHON_FALLTHROUGH;
3447  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3448  CYTHON_FALLTHROUGH;
3449  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3450  CYTHON_FALLTHROUGH;
3451  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3452  CYTHON_FALLTHROUGH;
3453  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3454  CYTHON_FALLTHROUGH;
3455  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3456  CYTHON_FALLTHROUGH;
3457  case 0: break;
3458  default: goto __pyx_L5_argtuple_error;
3459  }
3460  kw_args = PyDict_Size(__pyx_kwds);
3461  switch (pos_args) {
3462  case 0:
3463  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray)) != 0)) kw_args--;
3464  else goto __pyx_L5_argtuple_error;
3465  CYTHON_FALLTHROUGH;
3466  case 1:
3467  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeStarOffsets)) != 0)) kw_args--;
3468  else {
3469  __Pyx_RaiseArgtupleInvalid("smoothNodesLaplace", 0, 6, 10, 1); __PYX_ERR(0, 11, __pyx_L3_error)
3470  }
3471  CYTHON_FALLTHROUGH;
3472  case 2:
3473  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeStarArray)) != 0)) kw_args--;
3474  else {
3475  __Pyx_RaiseArgtupleInvalid("smoothNodesLaplace", 0, 6, 10, 2); __PYX_ERR(0, 11, __pyx_L3_error)
3476  }
3477  CYTHON_FALLTHROUGH;
3478  case 3:
3479  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeMaterialTypes)) != 0)) kw_args--;
3480  else {
3481  __Pyx_RaiseArgtupleInvalid("smoothNodesLaplace", 0, 6, 10, 3); __PYX_ERR(0, 11, __pyx_L3_error)
3482  }
3483  CYTHON_FALLTHROUGH;
3484  case 4:
3485  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes_owned)) != 0)) kw_args--;
3486  else {
3487  __Pyx_RaiseArgtupleInvalid("smoothNodesLaplace", 0, 6, 10, 4); __PYX_ERR(0, 11, __pyx_L3_error)
3488  }
3489  CYTHON_FALLTHROUGH;
3490  case 5:
3491  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
3492  else {
3493  __Pyx_RaiseArgtupleInvalid("smoothNodesLaplace", 0, 6, 10, 5); __PYX_ERR(0, 11, __pyx_L3_error)
3494  }
3495  CYTHON_FALLTHROUGH;
3496  case 6:
3497  if (kw_args > 0) {
3498  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_simultaneous);
3499  if (value) { values[6] = value; kw_args--; }
3500  }
3501  CYTHON_FALLTHROUGH;
3502  case 7:
3503  if (kw_args > 0) {
3504  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_smoothBoundaries);
3505  if (value) { values[7] = value; kw_args--; }
3506  }
3507  CYTHON_FALLTHROUGH;
3508  case 8:
3509  if (kw_args > 0) {
3510  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fixedNodesBoolArray);
3511  if (value) { values[8] = value; kw_args--; }
3512  }
3513  CYTHON_FALLTHROUGH;
3514  case 9:
3515  if (kw_args > 0) {
3516  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha);
3517  if (value) { values[9] = value; kw_args--; }
3518  }
3519  }
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)
3522  }
3523  } else {
3524  switch (PyTuple_GET_SIZE(__pyx_args)) {
3525  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3526  CYTHON_FALLTHROUGH;
3527  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3528  CYTHON_FALLTHROUGH;
3529  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3530  CYTHON_FALLTHROUGH;
3531  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3532  CYTHON_FALLTHROUGH;
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);
3539  break;
3540  default: goto __pyx_L5_argtuple_error;
3541  }
3542  }
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)
3549  if (values[6]) {
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)
3551  } else {
3552 
3553  /* "mprans/MeshSmoothing.pyx":17
3554  * int nNodes_owned,
3555  * int nd,
3556  * bool simultaneous=False, # <<<<<<<<<<<<<<
3557  * bool smoothBoundaries=True,
3558  * int[:] fixedNodesBoolArray=None,
3559  */
3560  __pyx_v_simultaneous = ((bool)0);
3561  }
3562  if (values[7]) {
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)
3564  } else {
3565 
3566  /* "mprans/MeshSmoothing.pyx":18
3567  * int nd,
3568  * bool simultaneous=False,
3569  * bool smoothBoundaries=True, # <<<<<<<<<<<<<<
3570  * int[:] fixedNodesBoolArray=None,
3571  * double alpha=0.):
3572  */
3573  __pyx_v_smoothBoundaries = ((bool)1);
3574  }
3575  if (values[8]) {
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)
3577  } else {
3578  __pyx_v_fixedNodesBoolArray = __pyx_k_;
3579  __PYX_INC_MEMVIEW(&__pyx_v_fixedNodesBoolArray, 1);
3580  }
3581  if (values[9]) {
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)
3583  } else {
3584  __pyx_v_alpha = ((double)0.);
3585  }
3586  }
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)
3590  __pyx_L3_error:;
3591  __Pyx_AddTraceback("mprans.MeshSmoothing.smoothNodesLaplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
3592  __Pyx_RefNannyFinishContext();
3593  return NULL;
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);
3596 
3597  /* "mprans/MeshSmoothing.pyx":11
3598  * from proteus.Profiling import logEvent
3599  *
3600  * def smoothNodesLaplace(double[:,:] nodeArray_, # <<<<<<<<<<<<<<
3601  * int[:] nodeStarOffsets,
3602  * int[:] nodeStarArray,
3603  */
3604 
3605  /* function exit code */
3606  __Pyx_RefNannyFinishContext();
3607  return __pyx_r;
3608 }
3609 
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);
3615 
3616  /* "mprans/MeshSmoothing.pyx":53
3617  * penalty term related to original position of nodes (0 <= alpha <= 1)
3618  * """
3619  * cySmoothNodesLaplace(nodeArray_=nodeArray_, # <<<<<<<<<<<<<<
3620  * nodeStarOffsets=nodeStarOffsets,
3621  * nodeStarArray=nodeStarArray,
3622  */
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);
3629 
3630  /* "mprans/MeshSmoothing.pyx":11
3631  * from proteus.Profiling import logEvent
3632  *
3633  * def smoothNodesLaplace(double[:,:] nodeArray_, # <<<<<<<<<<<<<<
3634  * int[:] nodeStarOffsets,
3635  * int[:] nodeStarArray,
3636  */
3637 
3638  /* function exit code */
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();
3647  return __pyx_r;
3648 }
3649 
3650 /* "mprans/MeshSmoothing.pyx":64
3651  * alpha=alpha)
3652  *
3653  * def smoothNodesCentroid(double[:,:] nodeArray_, # <<<<<<<<<<<<<<
3654  * int[:] nodeElementOffsets,
3655  * int[:] nodeElementsArray,
3656  */
3657 
3658 /* Python wrapper */
3659 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_3smoothNodesCentroid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
3681  {
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)) {
3685  Py_ssize_t kw_args;
3686  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3687  switch (pos_args) {
3688  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3689  CYTHON_FALLTHROUGH;
3690  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3691  CYTHON_FALLTHROUGH;
3692  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3693  CYTHON_FALLTHROUGH;
3694  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3695  CYTHON_FALLTHROUGH;
3696  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3697  CYTHON_FALLTHROUGH;
3698  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3699  CYTHON_FALLTHROUGH;
3700  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3701  CYTHON_FALLTHROUGH;
3702  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3703  CYTHON_FALLTHROUGH;
3704  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3705  CYTHON_FALLTHROUGH;
3706  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3707  CYTHON_FALLTHROUGH;
3708  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3709  CYTHON_FALLTHROUGH;
3710  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3711  CYTHON_FALLTHROUGH;
3712  case 0: break;
3713  default: goto __pyx_L5_argtuple_error;
3714  }
3715  kw_args = PyDict_Size(__pyx_kwds);
3716  switch (pos_args) {
3717  case 0:
3718  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray)) != 0)) kw_args--;
3719  else goto __pyx_L5_argtuple_error;
3720  CYTHON_FALLTHROUGH;
3721  case 1:
3722  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
3723  else {
3724  __Pyx_RaiseArgtupleInvalid("smoothNodesCentroid", 0, 8, 12, 1); __PYX_ERR(0, 64, __pyx_L3_error)
3725  }
3726  CYTHON_FALLTHROUGH;
3727  case 2:
3728  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
3729  else {
3730  __Pyx_RaiseArgtupleInvalid("smoothNodesCentroid", 0, 8, 12, 2); __PYX_ERR(0, 64, __pyx_L3_error)
3731  }
3732  CYTHON_FALLTHROUGH;
3733  case 3:
3734  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeMaterialTypes)) != 0)) kw_args--;
3735  else {
3736  __Pyx_RaiseArgtupleInvalid("smoothNodesCentroid", 0, 8, 12, 3); __PYX_ERR(0, 64, __pyx_L3_error)
3737  }
3738  CYTHON_FALLTHROUGH;
3739  case 4:
3740  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
3741  else {
3742  __Pyx_RaiseArgtupleInvalid("smoothNodesCentroid", 0, 8, 12, 4); __PYX_ERR(0, 64, __pyx_L3_error)
3743  }
3744  CYTHON_FALLTHROUGH;
3745  case 5:
3746  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementVolumesArray)) != 0)) kw_args--;
3747  else {
3748  __Pyx_RaiseArgtupleInvalid("smoothNodesCentroid", 0, 8, 12, 5); __PYX_ERR(0, 64, __pyx_L3_error)
3749  }
3750  CYTHON_FALLTHROUGH;
3751  case 6:
3752  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
3753  else {
3754  __Pyx_RaiseArgtupleInvalid("smoothNodesCentroid", 0, 8, 12, 6); __PYX_ERR(0, 64, __pyx_L3_error)
3755  }
3756  CYTHON_FALLTHROUGH;
3757  case 7:
3758  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes_owned)) != 0)) kw_args--;
3759  else {
3760  __Pyx_RaiseArgtupleInvalid("smoothNodesCentroid", 0, 8, 12, 7); __PYX_ERR(0, 64, __pyx_L3_error)
3761  }
3762  CYTHON_FALLTHROUGH;
3763  case 8:
3764  if (kw_args > 0) {
3765  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_simultaneous);
3766  if (value) { values[8] = value; kw_args--; }
3767  }
3768  CYTHON_FALLTHROUGH;
3769  case 9:
3770  if (kw_args > 0) {
3771  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_smoothBoundaries);
3772  if (value) { values[9] = value; kw_args--; }
3773  }
3774  CYTHON_FALLTHROUGH;
3775  case 10:
3776  if (kw_args > 0) {
3777  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fixedNodesBoolArray);
3778  if (value) { values[10] = value; kw_args--; }
3779  }
3780  CYTHON_FALLTHROUGH;
3781  case 11:
3782  if (kw_args > 0) {
3783  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha);
3784  if (value) { values[11] = value; kw_args--; }
3785  }
3786  }
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)
3789  }
3790  } else {
3791  switch (PyTuple_GET_SIZE(__pyx_args)) {
3792  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3793  CYTHON_FALLTHROUGH;
3794  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3795  CYTHON_FALLTHROUGH;
3796  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3797  CYTHON_FALLTHROUGH;
3798  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3799  CYTHON_FALLTHROUGH;
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);
3808  break;
3809  default: goto __pyx_L5_argtuple_error;
3810  }
3811  }
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)
3820  if (values[8]) {
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)
3822  } else {
3823 
3824  /* "mprans/MeshSmoothing.pyx":72
3825  * int[:,:] elementNodesArray,
3826  * int nNodes_owned,
3827  * bool simultaneous=True, # <<<<<<<<<<<<<<
3828  * bool smoothBoundaries=True,
3829  * int[:] fixedNodesBoolArray=None,
3830  */
3831  __pyx_v_simultaneous = ((bool)1);
3832  }
3833  if (values[9]) {
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)
3835  } else {
3836 
3837  /* "mprans/MeshSmoothing.pyx":73
3838  * int nNodes_owned,
3839  * bool simultaneous=True,
3840  * bool smoothBoundaries=True, # <<<<<<<<<<<<<<
3841  * int[:] fixedNodesBoolArray=None,
3842  * double alpha=0.):
3843  */
3844  __pyx_v_smoothBoundaries = ((bool)1);
3845  }
3846  if (values[10]) {
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)
3848  } else {
3849  __pyx_v_fixedNodesBoolArray = __pyx_k__2;
3850  __PYX_INC_MEMVIEW(&__pyx_v_fixedNodesBoolArray, 1);
3851  }
3852  if (values[11]) {
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)
3854  } else {
3855  __pyx_v_alpha = ((double)0.);
3856  }
3857  }
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)
3861  __pyx_L3_error:;
3862  __Pyx_AddTraceback("mprans.MeshSmoothing.smoothNodesCentroid", __pyx_clineno, __pyx_lineno, __pyx_filename);
3863  __Pyx_RefNannyFinishContext();
3864  return NULL;
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);
3867 
3868  /* "mprans/MeshSmoothing.pyx":64
3869  * alpha=alpha)
3870  *
3871  * def smoothNodesCentroid(double[:,:] nodeArray_, # <<<<<<<<<<<<<<
3872  * int[:] nodeElementOffsets,
3873  * int[:] nodeElementsArray,
3874  */
3875 
3876  /* function exit code */
3877  __Pyx_RefNannyFinishContext();
3878  return __pyx_r;
3879 }
3880 
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);
3886 
3887  /* "mprans/MeshSmoothing.pyx":114
3888  * penalty term related to original position of nodes (0 <= alpha <= 1)
3889  * """
3890  * cySmoothNodesCentroid(nodeArray_=nodeArray_, # <<<<<<<<<<<<<<
3891  * nodeElementOffsets=nodeElementOffsets,
3892  * nodeElementsArray=nodeElementsArray,
3893  */
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);
3899 
3900  /* "mprans/MeshSmoothing.pyx":64
3901  * alpha=alpha)
3902  *
3903  * def smoothNodesCentroid(double[:,:] nodeArray_, # <<<<<<<<<<<<<<
3904  * int[:] nodeElementOffsets,
3905  * int[:] nodeElementsArray,
3906  */
3907 
3908  /* function exit code */
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();
3920  return __pyx_r;
3921 }
3922 
3923 /* "mprans/MeshSmoothing.pyx":127
3924  * alpha=alpha)
3925  *
3926  * def updateDilationElements(double[:] elementDilationArray_, # <<<<<<<<<<<<<<
3927  * double[:] elementVolumeArray,
3928  * double[:] elementVolumeTargetArray,
3929  */
3930 
3931 /* Python wrapper */
3932 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_5updateDilationElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
3945  {
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)) {
3949  Py_ssize_t kw_args;
3950  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3951  switch (pos_args) {
3952  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3953  CYTHON_FALLTHROUGH;
3954  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3955  CYTHON_FALLTHROUGH;
3956  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3957  CYTHON_FALLTHROUGH;
3958  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3959  CYTHON_FALLTHROUGH;
3960  case 0: break;
3961  default: goto __pyx_L5_argtuple_error;
3962  }
3963  kw_args = PyDict_Size(__pyx_kwds);
3964  switch (pos_args) {
3965  case 0:
3966  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDilationArray)) != 0)) kw_args--;
3967  else goto __pyx_L5_argtuple_error;
3968  CYTHON_FALLTHROUGH;
3969  case 1:
3970  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementVolumeArray)) != 0)) kw_args--;
3971  else {
3972  __Pyx_RaiseArgtupleInvalid("updateDilationElements", 1, 4, 4, 1); __PYX_ERR(0, 127, __pyx_L3_error)
3973  }
3974  CYTHON_FALLTHROUGH;
3975  case 2:
3976  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementVolumeTargetArray)) != 0)) kw_args--;
3977  else {
3978  __Pyx_RaiseArgtupleInvalid("updateDilationElements", 1, 4, 4, 2); __PYX_ERR(0, 127, __pyx_L3_error)
3979  }
3980  CYTHON_FALLTHROUGH;
3981  case 3:
3982  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements)) != 0)) kw_args--;
3983  else {
3984  __Pyx_RaiseArgtupleInvalid("updateDilationElements", 1, 4, 4, 3); __PYX_ERR(0, 127, __pyx_L3_error)
3985  }
3986  }
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)
3989  }
3990  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3991  goto __pyx_L5_argtuple_error;
3992  } else {
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);
3997  }
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)
4002  }
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)
4006  __pyx_L3_error:;
4007  __Pyx_AddTraceback("mprans.MeshSmoothing.updateDilationElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4008  __Pyx_RefNannyFinishContext();
4009  return NULL;
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);
4012 
4013  /* function exit code */
4014  __Pyx_RefNannyFinishContext();
4015  return __pyx_r;
4016 }
4017 
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);
4022 
4023  /* "mprans/MeshSmoothing.pyx":131
4024  * double[:] elementVolumeTargetArray,
4025  * int nElements):
4026  * cyUpdateDilationElements(elementDilationArray_=elementDilationArray_, # <<<<<<<<<<<<<<
4027  * elementVolumeArray=elementVolumeArray,
4028  * elementVolumeTargetArray=elementVolumeTargetArray,
4029  */
4030  __pyx_f_6mprans_13MeshSmoothing_cyUpdateDilationElements(__pyx_v_elementDilationArray_, __pyx_v_elementVolumeArray, __pyx_v_elementVolumeTargetArray, __pyx_v_nElements);
4031 
4032  /* "mprans/MeshSmoothing.pyx":127
4033  * alpha=alpha)
4034  *
4035  * def updateDilationElements(double[:] elementDilationArray_, # <<<<<<<<<<<<<<
4036  * double[:] elementVolumeArray,
4037  * double[:] elementVolumeTargetArray,
4038  */
4039 
4040  /* function exit code */
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();
4047  return __pyx_r;
4048 }
4049 
4050 /* "mprans/MeshSmoothing.pyx":136
4051  * nElements=nElements)
4052  *
4053  * def getDilationElements(double[:] elementVolumeArray, # <<<<<<<<<<<<<<
4054  * double[:] elementVolumeTargetArray):
4055  * cdef int nElements = len(elementVolumeArray)
4056  */
4057 
4058 /* Python wrapper */
4059 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_7getDilationElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
4070  {
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)) {
4074  Py_ssize_t kw_args;
4075  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4076  switch (pos_args) {
4077  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4078  CYTHON_FALLTHROUGH;
4079  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4080  CYTHON_FALLTHROUGH;
4081  case 0: break;
4082  default: goto __pyx_L5_argtuple_error;
4083  }
4084  kw_args = PyDict_Size(__pyx_kwds);
4085  switch (pos_args) {
4086  case 0:
4087  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementVolumeArray)) != 0)) kw_args--;
4088  else goto __pyx_L5_argtuple_error;
4089  CYTHON_FALLTHROUGH;
4090  case 1:
4091  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementVolumeTargetArray)) != 0)) kw_args--;
4092  else {
4093  __Pyx_RaiseArgtupleInvalid("getDilationElements", 1, 2, 2, 1); __PYX_ERR(0, 136, __pyx_L3_error)
4094  }
4095  }
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)
4098  }
4099  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4100  goto __pyx_L5_argtuple_error;
4101  } else {
4102  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4103  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4104  }
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)
4107  }
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)
4111  __pyx_L3_error:;
4112  __Pyx_AddTraceback("mprans.MeshSmoothing.getDilationElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4113  __Pyx_RefNannyFinishContext();
4114  return NULL;
4115  __pyx_L4_argument_unpacking_done:;
4116  __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_6getDilationElements(__pyx_self, __pyx_v_elementVolumeArray, __pyx_v_elementVolumeTargetArray);
4117 
4118  /* function exit code */
4119  __Pyx_RefNannyFinishContext();
4120  return __pyx_r;
4121 }
4122 
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
4128  size_t __pyx_t_1;
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);
4138 
4139  /* "mprans/MeshSmoothing.pyx":138
4140  * def getDilationElements(double[:] elementVolumeArray,
4141  * double[:] elementVolumeTargetArray):
4142  * cdef int nElements = len(elementVolumeArray) # <<<<<<<<<<<<<<
4143  * elementDilationArray_ = np.zeros(nElements)
4144  * cyUpdateDilationElements(elementDilationArray_=elementDilationArray_,
4145  */
4146  __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_elementVolumeArray);
4147  __pyx_v_nElements = __pyx_t_1;
4148 
4149  /* "mprans/MeshSmoothing.pyx":139
4150  * double[:] elementVolumeTargetArray):
4151  * cdef int nElements = len(elementVolumeArray)
4152  * elementDilationArray_ = np.zeros(nElements) # <<<<<<<<<<<<<<
4153  * cyUpdateDilationElements(elementDilationArray_=elementDilationArray_,
4154  * elementVolumeArray=elementVolumeArray,
4155  */
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);
4163  __pyx_t_5 = NULL;
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);
4171  }
4172  }
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;
4180  __pyx_t_2 = 0;
4181 
4182  /* "mprans/MeshSmoothing.pyx":140
4183  * cdef int nElements = len(elementVolumeArray)
4184  * elementDilationArray_ = np.zeros(nElements)
4185  * cyUpdateDilationElements(elementDilationArray_=elementDilationArray_, # <<<<<<<<<<<<<<
4186  * elementVolumeArray=elementVolumeArray,
4187  * elementVolumeTargetArray=elementVolumeTargetArray,
4188  */
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)
4190 
4191  /* "mprans/MeshSmoothing.pyx":143
4192  * elementVolumeArray=elementVolumeArray,
4193  * elementVolumeTargetArray=elementVolumeTargetArray,
4194  * nElements=nElements) # <<<<<<<<<<<<<<
4195  * return elementDilationArray_
4196  *
4197  */
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;
4202 
4203  /* "mprans/MeshSmoothing.pyx":144
4204  * elementVolumeTargetArray=elementVolumeTargetArray,
4205  * nElements=nElements)
4206  * return elementDilationArray_ # <<<<<<<<<<<<<<
4207  *
4208  * def updateDistortionElements(double[:] elementDistortionArray_,
4209  */
4210  __Pyx_XDECREF(__pyx_r);
4211  __Pyx_INCREF(__pyx_v_elementDilationArray_);
4212  __pyx_r = __pyx_v_elementDilationArray_;
4213  goto __pyx_L0;
4214 
4215  /* "mprans/MeshSmoothing.pyx":136
4216  * nElements=nElements)
4217  *
4218  * def getDilationElements(double[:] elementVolumeArray, # <<<<<<<<<<<<<<
4219  * double[:] elementVolumeTargetArray):
4220  * cdef int nElements = len(elementVolumeArray)
4221  */
4222 
4223  /* function exit code */
4224  __pyx_L1_error:;
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);
4231  __pyx_r = NULL;
4232  __pyx_L0:;
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();
4238  return __pyx_r;
4239 }
4240 
4241 /* "mprans/MeshSmoothing.pyx":146
4242  * return elementDilationArray_
4243  *
4244  * def updateDistortionElements(double[:] elementDistortionArray_, # <<<<<<<<<<<<<<
4245  * double[:,:,:,:] J_array,
4246  * double[:,:] detJ_array,
4247  */
4248 
4249 /* Python wrapper */
4250 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_9updateDistortionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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 } };
4256  int __pyx_v_nd;
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);
4264  {
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)) {
4268  Py_ssize_t kw_args;
4269  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4270  switch (pos_args) {
4271  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4272  CYTHON_FALLTHROUGH;
4273  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4274  CYTHON_FALLTHROUGH;
4275  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4276  CYTHON_FALLTHROUGH;
4277  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4278  CYTHON_FALLTHROUGH;
4279  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4280  CYTHON_FALLTHROUGH;
4281  case 0: break;
4282  default: goto __pyx_L5_argtuple_error;
4283  }
4284  kw_args = PyDict_Size(__pyx_kwds);
4285  switch (pos_args) {
4286  case 0:
4287  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementDistortionArray)) != 0)) kw_args--;
4288  else goto __pyx_L5_argtuple_error;
4289  CYTHON_FALLTHROUGH;
4290  case 1:
4291  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J_array)) != 0)) kw_args--;
4292  else {
4293  __Pyx_RaiseArgtupleInvalid("updateDistortionElements", 1, 5, 5, 1); __PYX_ERR(0, 146, __pyx_L3_error)
4294  }
4295  CYTHON_FALLTHROUGH;
4296  case 2:
4297  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_detJ_array)) != 0)) kw_args--;
4298  else {
4299  __Pyx_RaiseArgtupleInvalid("updateDistortionElements", 1, 5, 5, 2); __PYX_ERR(0, 146, __pyx_L3_error)
4300  }
4301  CYTHON_FALLTHROUGH;
4302  case 3:
4303  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
4304  else {
4305  __Pyx_RaiseArgtupleInvalid("updateDistortionElements", 1, 5, 5, 3); __PYX_ERR(0, 146, __pyx_L3_error)
4306  }
4307  CYTHON_FALLTHROUGH;
4308  case 4:
4309  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements)) != 0)) kw_args--;
4310  else {
4311  __Pyx_RaiseArgtupleInvalid("updateDistortionElements", 1, 5, 5, 4); __PYX_ERR(0, 146, __pyx_L3_error)
4312  }
4313  }
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)
4316  }
4317  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4318  goto __pyx_L5_argtuple_error;
4319  } else {
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);
4325  }
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)
4331  }
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)
4335  __pyx_L3_error:;
4336  __Pyx_AddTraceback("mprans.MeshSmoothing.updateDistortionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4337  __Pyx_RefNannyFinishContext();
4338  return NULL;
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);
4341 
4342  /* function exit code */
4343  __Pyx_RefNannyFinishContext();
4344  return __pyx_r;
4345 }
4346 
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);
4351 
4352  /* "mprans/MeshSmoothing.pyx":151
4353  * int nd,
4354  * int nElements):
4355  * cyUpdateDistortionElements(elementDistortionArray_=elementDistortionArray_, # <<<<<<<<<<<<<<
4356  * J_array=J_array,
4357  * detJ_array=detJ_array,
4358  */
4359  __pyx_f_6mprans_13MeshSmoothing_cyUpdateDistortionElements(__pyx_v_elementDistortionArray_, __pyx_v_J_array, __pyx_v_detJ_array, __pyx_v_nd, __pyx_v_nElements);
4360 
4361  /* "mprans/MeshSmoothing.pyx":146
4362  * return elementDilationArray_
4363  *
4364  * def updateDistortionElements(double[:] elementDistortionArray_, # <<<<<<<<<<<<<<
4365  * double[:,:,:,:] J_array,
4366  * double[:,:] detJ_array,
4367  */
4368 
4369  /* function exit code */
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();
4376  return __pyx_r;
4377 }
4378 
4379 /* "mprans/MeshSmoothing.pyx":157
4380  * nElements=nElements)
4381  *
4382  * def getDistortionElements(double[:,:,:,:] J_array, # <<<<<<<<<<<<<<
4383  * double[:,:] detJ_array,
4384  * int nd):
4385  */
4386 
4387 /* Python wrapper */
4388 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_11getDistortionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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 } };
4393  int __pyx_v_nd;
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);
4400  {
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)) {
4404  Py_ssize_t kw_args;
4405  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4406  switch (pos_args) {
4407  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4408  CYTHON_FALLTHROUGH;
4409  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4410  CYTHON_FALLTHROUGH;
4411  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4412  CYTHON_FALLTHROUGH;
4413  case 0: break;
4414  default: goto __pyx_L5_argtuple_error;
4415  }
4416  kw_args = PyDict_Size(__pyx_kwds);
4417  switch (pos_args) {
4418  case 0:
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;
4421  CYTHON_FALLTHROUGH;
4422  case 1:
4423  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_detJ_array)) != 0)) kw_args--;
4424  else {
4425  __Pyx_RaiseArgtupleInvalid("getDistortionElements", 1, 3, 3, 1); __PYX_ERR(0, 157, __pyx_L3_error)
4426  }
4427  CYTHON_FALLTHROUGH;
4428  case 2:
4429  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
4430  else {
4431  __Pyx_RaiseArgtupleInvalid("getDistortionElements", 1, 3, 3, 2); __PYX_ERR(0, 157, __pyx_L3_error)
4432  }
4433  }
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)
4436  }
4437  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4438  goto __pyx_L5_argtuple_error;
4439  } else {
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);
4443  }
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)
4447  }
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)
4451  __pyx_L3_error:;
4452  __Pyx_AddTraceback("mprans.MeshSmoothing.getDistortionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4453  __Pyx_RefNannyFinishContext();
4454  return NULL;
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);
4457 
4458  /* function exit code */
4459  __Pyx_RefNannyFinishContext();
4460  return __pyx_r;
4461 }
4462 
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
4468  size_t __pyx_t_1;
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);
4478 
4479  /* "mprans/MeshSmoothing.pyx":160
4480  * double[:,:] detJ_array,
4481  * int nd):
4482  * nElements = len(detJ_array) # <<<<<<<<<<<<<<
4483  * elementDistortionArray_ = np.zeros(nElements)
4484  * cyUpdateDistortionElements(elementDistortionArray_=elementDistortionArray_,
4485  */
4486  __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_detJ_array);
4487  __pyx_v_nElements = __pyx_t_1;
4488 
4489  /* "mprans/MeshSmoothing.pyx":161
4490  * int nd):
4491  * nElements = len(detJ_array)
4492  * elementDistortionArray_ = np.zeros(nElements) # <<<<<<<<<<<<<<
4493  * cyUpdateDistortionElements(elementDistortionArray_=elementDistortionArray_,
4494  * J_array=J_array,
4495  */
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);
4503  __pyx_t_5 = NULL;
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);
4511  }
4512  }
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;
4520  __pyx_t_2 = 0;
4521 
4522  /* "mprans/MeshSmoothing.pyx":162
4523  * nElements = len(detJ_array)
4524  * elementDistortionArray_ = np.zeros(nElements)
4525  * cyUpdateDistortionElements(elementDistortionArray_=elementDistortionArray_, # <<<<<<<<<<<<<<
4526  * J_array=J_array,
4527  * detJ_array=detJ_array,
4528  */
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)
4530 
4531  /* "mprans/MeshSmoothing.pyx":166
4532  * detJ_array=detJ_array,
4533  * nd=nd,
4534  * nElements=nElements) # <<<<<<<<<<<<<<
4535  * return elementDistortionArray_
4536  *
4537  */
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;
4542 
4543  /* "mprans/MeshSmoothing.pyx":167
4544  * nd=nd,
4545  * nElements=nElements)
4546  * return elementDistortionArray_ # <<<<<<<<<<<<<<
4547  *
4548  * def updateInverseMeanRatioTriangleElements(double[:] IMRElementsArray_,
4549  */
4550  __Pyx_XDECREF(__pyx_r);
4551  __Pyx_INCREF(__pyx_v_elementDistortionArray_);
4552  __pyx_r = __pyx_v_elementDistortionArray_;
4553  goto __pyx_L0;
4554 
4555  /* "mprans/MeshSmoothing.pyx":157
4556  * nElements=nElements)
4557  *
4558  * def getDistortionElements(double[:,:,:,:] J_array, # <<<<<<<<<<<<<<
4559  * double[:,:] detJ_array,
4560  * int nd):
4561  */
4562 
4563  /* function exit code */
4564  __pyx_L1_error:;
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);
4571  __pyx_r = NULL;
4572  __pyx_L0:;
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();
4578  return __pyx_r;
4579 }
4580 
4581 /* "mprans/MeshSmoothing.pyx":169
4582  * return elementDistortionArray_
4583  *
4584  * def updateInverseMeanRatioTriangleElements(double[:] IMRElementsArray_, # <<<<<<<<<<<<<<
4585  * double[:,:] nodeArray,
4586  * int[:,:] elementNodesArray,
4587  */
4588 
4589 /* Python wrapper */
4590 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_13updateInverseMeanRatioTriangleElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
4603  {
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)) {
4607  Py_ssize_t kw_args;
4608  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4609  switch (pos_args) {
4610  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4611  CYTHON_FALLTHROUGH;
4612  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4613  CYTHON_FALLTHROUGH;
4614  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4615  CYTHON_FALLTHROUGH;
4616  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4617  CYTHON_FALLTHROUGH;
4618  case 0: break;
4619  default: goto __pyx_L5_argtuple_error;
4620  }
4621  kw_args = PyDict_Size(__pyx_kwds);
4622  switch (pos_args) {
4623  case 0:
4624  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_IMRElementsArray)) != 0)) kw_args--;
4625  else goto __pyx_L5_argtuple_error;
4626  CYTHON_FALLTHROUGH;
4627  case 1:
4628  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray_2)) != 0)) kw_args--;
4629  else {
4630  __Pyx_RaiseArgtupleInvalid("updateInverseMeanRatioTriangleElements", 1, 4, 4, 1); __PYX_ERR(0, 169, __pyx_L3_error)
4631  }
4632  CYTHON_FALLTHROUGH;
4633  case 2:
4634  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
4635  else {
4636  __Pyx_RaiseArgtupleInvalid("updateInverseMeanRatioTriangleElements", 1, 4, 4, 2); __PYX_ERR(0, 169, __pyx_L3_error)
4637  }
4638  CYTHON_FALLTHROUGH;
4639  case 3:
4640  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements)) != 0)) kw_args--;
4641  else {
4642  __Pyx_RaiseArgtupleInvalid("updateInverseMeanRatioTriangleElements", 1, 4, 4, 3); __PYX_ERR(0, 169, __pyx_L3_error)
4643  }
4644  }
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)
4647  }
4648  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4649  goto __pyx_L5_argtuple_error;
4650  } else {
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);
4655  }
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)
4660  }
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)
4664  __pyx_L3_error:;
4665  __Pyx_AddTraceback("mprans.MeshSmoothing.updateInverseMeanRatioTriangleElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4666  __Pyx_RefNannyFinishContext();
4667  return NULL;
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);
4670 
4671  /* function exit code */
4672  __Pyx_RefNannyFinishContext();
4673  return __pyx_r;
4674 }
4675 
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);
4680 
4681  /* "mprans/MeshSmoothing.pyx":173
4682  * int[:,:] elementNodesArray,
4683  * int nElements):
4684  * cyUpdateInverseMeanRatioTriangleElements(IMRElementsArray_=IMRElementsArray_, # <<<<<<<<<<<<<<
4685  * nodeArray=nodeArray,
4686  * elementNodesArray=elementNodesArray,
4687  */
4688  __pyx_f_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleElements(__pyx_v_IMRElementsArray_, __pyx_v_nodeArray, __pyx_v_elementNodesArray, __pyx_v_nElements);
4689 
4690  /* "mprans/MeshSmoothing.pyx":169
4691  * return elementDistortionArray_
4692  *
4693  * def updateInverseMeanRatioTriangleElements(double[:] IMRElementsArray_, # <<<<<<<<<<<<<<
4694  * double[:,:] nodeArray,
4695  * int[:,:] elementNodesArray,
4696  */
4697 
4698  /* function exit code */
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();
4705  return __pyx_r;
4706 }
4707 
4708 /* "mprans/MeshSmoothing.pyx":178
4709  * nElements=nElements)
4710  *
4711  * def getInverseMeanRatioTriangleElements(double[:,:] nodeArray, # <<<<<<<<<<<<<<
4712  * int[:,:] elementNodesArray):
4713  * cdef int nElements = len(elementNodesArray)
4714  */
4715 
4716 /* Python wrapper */
4717 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_15getInverseMeanRatioTriangleElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
4728  {
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)) {
4732  Py_ssize_t kw_args;
4733  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4734  switch (pos_args) {
4735  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4736  CYTHON_FALLTHROUGH;
4737  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4738  CYTHON_FALLTHROUGH;
4739  case 0: break;
4740  default: goto __pyx_L5_argtuple_error;
4741  }
4742  kw_args = PyDict_Size(__pyx_kwds);
4743  switch (pos_args) {
4744  case 0:
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;
4747  CYTHON_FALLTHROUGH;
4748  case 1:
4749  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
4750  else {
4751  __Pyx_RaiseArgtupleInvalid("getInverseMeanRatioTriangleElements", 1, 2, 2, 1); __PYX_ERR(0, 178, __pyx_L3_error)
4752  }
4753  }
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)
4756  }
4757  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4758  goto __pyx_L5_argtuple_error;
4759  } else {
4760  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4761  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4762  }
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)
4765  }
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)
4769  __pyx_L3_error:;
4770  __Pyx_AddTraceback("mprans.MeshSmoothing.getInverseMeanRatioTriangleElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4771  __Pyx_RefNannyFinishContext();
4772  return NULL;
4773  __pyx_L4_argument_unpacking_done:;
4774  __pyx_r = __pyx_pf_6mprans_13MeshSmoothing_14getInverseMeanRatioTriangleElements(__pyx_self, __pyx_v_nodeArray, __pyx_v_elementNodesArray);
4775 
4776  /* function exit code */
4777  __Pyx_RefNannyFinishContext();
4778  return __pyx_r;
4779 }
4780 
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
4786  size_t __pyx_t_1;
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);
4796 
4797  /* "mprans/MeshSmoothing.pyx":180
4798  * def getInverseMeanRatioTriangleElements(double[:,:] nodeArray,
4799  * int[:,:] elementNodesArray):
4800  * cdef int nElements = len(elementNodesArray) # <<<<<<<<<<<<<<
4801  * IMRElementsArray_ = np.zeros(nElements)
4802  * cyUpdateInverseMeanRatioTriangleElements(IMRElementsArray_=IMRElementsArray_,
4803  */
4804  __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_elementNodesArray);
4805  __pyx_v_nElements = __pyx_t_1;
4806 
4807  /* "mprans/MeshSmoothing.pyx":181
4808  * int[:,:] elementNodesArray):
4809  * cdef int nElements = len(elementNodesArray)
4810  * IMRElementsArray_ = np.zeros(nElements) # <<<<<<<<<<<<<<
4811  * cyUpdateInverseMeanRatioTriangleElements(IMRElementsArray_=IMRElementsArray_,
4812  * nodeArray=nodeArray,
4813  */
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);
4821  __pyx_t_5 = NULL;
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);
4829  }
4830  }
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;
4838  __pyx_t_2 = 0;
4839 
4840  /* "mprans/MeshSmoothing.pyx":182
4841  * cdef int nElements = len(elementNodesArray)
4842  * IMRElementsArray_ = np.zeros(nElements)
4843  * cyUpdateInverseMeanRatioTriangleElements(IMRElementsArray_=IMRElementsArray_, # <<<<<<<<<<<<<<
4844  * nodeArray=nodeArray,
4845  * elementNodesArray=elementNodesArray,
4846  */
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)
4848 
4849  /* "mprans/MeshSmoothing.pyx":185
4850  * nodeArray=nodeArray,
4851  * elementNodesArray=elementNodesArray,
4852  * nElements=nElements) # <<<<<<<<<<<<<<
4853  * return IMRElementsArray_
4854  *
4855  */
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;
4860 
4861  /* "mprans/MeshSmoothing.pyx":186
4862  * elementNodesArray=elementNodesArray,
4863  * nElements=nElements)
4864  * return IMRElementsArray_ # <<<<<<<<<<<<<<
4865  *
4866  * def updateInverseMeanRatioTriangleNodes(double[:] IMRNodesArray_,
4867  */
4868  __Pyx_XDECREF(__pyx_r);
4869  __Pyx_INCREF(__pyx_v_IMRElementsArray_);
4870  __pyx_r = __pyx_v_IMRElementsArray_;
4871  goto __pyx_L0;
4872 
4873  /* "mprans/MeshSmoothing.pyx":178
4874  * nElements=nElements)
4875  *
4876  * def getInverseMeanRatioTriangleElements(double[:,:] nodeArray, # <<<<<<<<<<<<<<
4877  * int[:,:] elementNodesArray):
4878  * cdef int nElements = len(elementNodesArray)
4879  */
4880 
4881  /* function exit code */
4882  __pyx_L1_error:;
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);
4889  __pyx_r = NULL;
4890  __pyx_L0:;
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();
4896  return __pyx_r;
4897 }
4898 
4899 /* "mprans/MeshSmoothing.pyx":188
4900  * return IMRElementsArray_
4901  *
4902  * def updateInverseMeanRatioTriangleNodes(double[:] IMRNodesArray_, # <<<<<<<<<<<<<<
4903  * double[:,:] nodeArray,
4904  * int[:,:] elementNodesArray,
4905  */
4906 
4907 /* Python wrapper */
4908 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_17updateInverseMeanRatioTriangleNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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 } };
4916  int __pyx_v_nNodes;
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);
4925  {
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)) {
4929  Py_ssize_t kw_args;
4930  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4931  switch (pos_args) {
4932  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4933  CYTHON_FALLTHROUGH;
4934  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4935  CYTHON_FALLTHROUGH;
4936  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4937  CYTHON_FALLTHROUGH;
4938  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4939  CYTHON_FALLTHROUGH;
4940  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4941  CYTHON_FALLTHROUGH;
4942  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4943  CYTHON_FALLTHROUGH;
4944  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4945  CYTHON_FALLTHROUGH;
4946  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4947  CYTHON_FALLTHROUGH;
4948  case 0: break;
4949  default: goto __pyx_L5_argtuple_error;
4950  }
4951  kw_args = PyDict_Size(__pyx_kwds);
4952  switch (pos_args) {
4953  case 0:
4954  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_IMRNodesArray)) != 0)) kw_args--;
4955  else goto __pyx_L5_argtuple_error;
4956  CYTHON_FALLTHROUGH;
4957  case 1:
4958  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray_2)) != 0)) kw_args--;
4959  else {
4960  __Pyx_RaiseArgtupleInvalid("updateInverseMeanRatioTriangleNodes", 0, 7, 8, 1); __PYX_ERR(0, 188, __pyx_L3_error)
4961  }
4962  CYTHON_FALLTHROUGH;
4963  case 2:
4964  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
4965  else {
4966  __Pyx_RaiseArgtupleInvalid("updateInverseMeanRatioTriangleNodes", 0, 7, 8, 2); __PYX_ERR(0, 188, __pyx_L3_error)
4967  }
4968  CYTHON_FALLTHROUGH;
4969  case 3:
4970  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
4971  else {
4972  __Pyx_RaiseArgtupleInvalid("updateInverseMeanRatioTriangleNodes", 0, 7, 8, 3); __PYX_ERR(0, 188, __pyx_L3_error)
4973  }
4974  CYTHON_FALLTHROUGH;
4975  case 4:
4976  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
4977  else {
4978  __Pyx_RaiseArgtupleInvalid("updateInverseMeanRatioTriangleNodes", 0, 7, 8, 4); __PYX_ERR(0, 188, __pyx_L3_error)
4979  }
4980  CYTHON_FALLTHROUGH;
4981  case 5:
4982  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes)) != 0)) kw_args--;
4983  else {
4984  __Pyx_RaiseArgtupleInvalid("updateInverseMeanRatioTriangleNodes", 0, 7, 8, 5); __PYX_ERR(0, 188, __pyx_L3_error)
4985  }
4986  CYTHON_FALLTHROUGH;
4987  case 6:
4988  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements)) != 0)) kw_args--;
4989  else {
4990  __Pyx_RaiseArgtupleInvalid("updateInverseMeanRatioTriangleNodes", 0, 7, 8, 6); __PYX_ERR(0, 188, __pyx_L3_error)
4991  }
4992  CYTHON_FALLTHROUGH;
4993  case 7:
4994  if (kw_args > 0) {
4995  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_el_average);
4996  if (value) { values[7] = value; kw_args--; }
4997  }
4998  }
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)
5001  }
5002  } else {
5003  switch (PyTuple_GET_SIZE(__pyx_args)) {
5004  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5005  CYTHON_FALLTHROUGH;
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);
5013  break;
5014  default: goto __pyx_L5_argtuple_error;
5015  }
5016  }
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)
5024  if (values[7]) {
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)
5026  } else {
5027 
5028  /* "mprans/MeshSmoothing.pyx":195
5029  * int nNodes,
5030  * int nElements,
5031  * bool el_average=False): # <<<<<<<<<<<<<<
5032  * cyUpdateInverseMeanRatioTriangleNodes(IMRNodesArray_=IMRNodesArray_,
5033  * nodeArray=nodeArray,
5034  */
5035  __pyx_v_el_average = ((bool)0);
5036  }
5037  }
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)
5041  __pyx_L3_error:;
5042  __Pyx_AddTraceback("mprans.MeshSmoothing.updateInverseMeanRatioTriangleNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
5043  __Pyx_RefNannyFinishContext();
5044  return NULL;
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);
5047 
5048  /* "mprans/MeshSmoothing.pyx":188
5049  * return IMRElementsArray_
5050  *
5051  * def updateInverseMeanRatioTriangleNodes(double[:] IMRNodesArray_, # <<<<<<<<<<<<<<
5052  * double[:,:] nodeArray,
5053  * int[:,:] elementNodesArray,
5054  */
5055 
5056  /* function exit code */
5057  __Pyx_RefNannyFinishContext();
5058  return __pyx_r;
5059 }
5060 
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);
5066 
5067  /* "mprans/MeshSmoothing.pyx":196
5068  * int nElements,
5069  * bool el_average=False):
5070  * cyUpdateInverseMeanRatioTriangleNodes(IMRNodesArray_=IMRNodesArray_, # <<<<<<<<<<<<<<
5071  * nodeArray=nodeArray,
5072  * elementNodesArray=elementNodesArray,
5073  */
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);
5077 
5078  /* "mprans/MeshSmoothing.pyx":188
5079  * return IMRElementsArray_
5080  *
5081  * def updateInverseMeanRatioTriangleNodes(double[:] IMRNodesArray_, # <<<<<<<<<<<<<<
5082  * double[:,:] nodeArray,
5083  * int[:,:] elementNodesArray,
5084  */
5085 
5086  /* function exit code */
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();
5095  return __pyx_r;
5096 }
5097 
5098 /* "mprans/MeshSmoothing.pyx":205
5099  * nElements=nElements)
5100  *
5101  * def getInverseMeanRatioTriangleNodes(double[:,:] nodeArray, # <<<<<<<<<<<<<<
5102  * int[:,:] elementNodesArray,
5103  * int[:] nodeElementOffsets,
5104  */
5105 
5106 /* Python wrapper */
5107 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_19getInverseMeanRatioTriangleNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
5121  {
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)) {
5125  Py_ssize_t kw_args;
5126  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5127  switch (pos_args) {
5128  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5129  CYTHON_FALLTHROUGH;
5130  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5131  CYTHON_FALLTHROUGH;
5132  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5133  CYTHON_FALLTHROUGH;
5134  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5135  CYTHON_FALLTHROUGH;
5136  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5137  CYTHON_FALLTHROUGH;
5138  case 0: break;
5139  default: goto __pyx_L5_argtuple_error;
5140  }
5141  kw_args = PyDict_Size(__pyx_kwds);
5142  switch (pos_args) {
5143  case 0:
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;
5146  CYTHON_FALLTHROUGH;
5147  case 1:
5148  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
5149  else {
5150  __Pyx_RaiseArgtupleInvalid("getInverseMeanRatioTriangleNodes", 0, 4, 5, 1); __PYX_ERR(0, 205, __pyx_L3_error)
5151  }
5152  CYTHON_FALLTHROUGH;
5153  case 2:
5154  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
5155  else {
5156  __Pyx_RaiseArgtupleInvalid("getInverseMeanRatioTriangleNodes", 0, 4, 5, 2); __PYX_ERR(0, 205, __pyx_L3_error)
5157  }
5158  CYTHON_FALLTHROUGH;
5159  case 3:
5160  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
5161  else {
5162  __Pyx_RaiseArgtupleInvalid("getInverseMeanRatioTriangleNodes", 0, 4, 5, 3); __PYX_ERR(0, 205, __pyx_L3_error)
5163  }
5164  CYTHON_FALLTHROUGH;
5165  case 4:
5166  if (kw_args > 0) {
5167  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_el_average);
5168  if (value) { values[4] = value; kw_args--; }
5169  }
5170  }
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)
5173  }
5174  } else {
5175  switch (PyTuple_GET_SIZE(__pyx_args)) {
5176  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5177  CYTHON_FALLTHROUGH;
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);
5182  break;
5183  default: goto __pyx_L5_argtuple_error;
5184  }
5185  }
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)
5190  if (values[4]) {
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)
5192  } else {
5193 
5194  /* "mprans/MeshSmoothing.pyx":209
5195  * int[:] nodeElementOffsets,
5196  * int[:] nodeElementsArray,
5197  * bool el_average=False): # <<<<<<<<<<<<<<
5198  * cdef int nNodes = len(nodeArray)
5199  * cdef int nElements = len(elementNodesArray)
5200  */
5201  __pyx_v_el_average = ((bool)0);
5202  }
5203  }
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)
5207  __pyx_L3_error:;
5208  __Pyx_AddTraceback("mprans.MeshSmoothing.getInverseMeanRatioTriangleNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
5209  __Pyx_RefNannyFinishContext();
5210  return NULL;
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);
5213 
5214  /* "mprans/MeshSmoothing.pyx":205
5215  * nElements=nElements)
5216  *
5217  * def getInverseMeanRatioTriangleNodes(double[:,:] nodeArray, # <<<<<<<<<<<<<<
5218  * int[:,:] elementNodesArray,
5219  * int[:] nodeElementOffsets,
5220  */
5221 
5222  /* function exit code */
5223  __Pyx_RefNannyFinishContext();
5224  return __pyx_r;
5225 }
5226 
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) {
5228  int __pyx_v_nNodes;
5229  int __pyx_v_nElements;
5230  PyObject *__pyx_v_IMRNodesArray_ = NULL;
5231  PyObject *__pyx_r = NULL;
5232  __Pyx_RefNannyDeclarations
5233  size_t __pyx_t_1;
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);
5244 
5245  /* "mprans/MeshSmoothing.pyx":210
5246  * int[:] nodeElementsArray,
5247  * bool el_average=False):
5248  * cdef int nNodes = len(nodeArray) # <<<<<<<<<<<<<<
5249  * cdef int nElements = len(elementNodesArray)
5250  * IMRNodesArray_ = np.zeros(nNodes)
5251  */
5252  __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_nodeArray);
5253  __pyx_v_nNodes = __pyx_t_1;
5254 
5255  /* "mprans/MeshSmoothing.pyx":211
5256  * bool el_average=False):
5257  * cdef int nNodes = len(nodeArray)
5258  * cdef int nElements = len(elementNodesArray) # <<<<<<<<<<<<<<
5259  * IMRNodesArray_ = np.zeros(nNodes)
5260  * cyUpdateInverseMeanRatioTriangleNodes(IMRNodesArray_=IMRNodesArray_,
5261  */
5262  __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_elementNodesArray);
5263  __pyx_v_nElements = __pyx_t_1;
5264 
5265  /* "mprans/MeshSmoothing.pyx":212
5266  * cdef int nNodes = len(nodeArray)
5267  * cdef int nElements = len(elementNodesArray)
5268  * IMRNodesArray_ = np.zeros(nNodes) # <<<<<<<<<<<<<<
5269  * cyUpdateInverseMeanRatioTriangleNodes(IMRNodesArray_=IMRNodesArray_,
5270  * nodeArray=nodeArray,
5271  */
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);
5279  __pyx_t_5 = NULL;
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);
5287  }
5288  }
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;
5296  __pyx_t_2 = 0;
5297 
5298  /* "mprans/MeshSmoothing.pyx":213
5299  * cdef int nElements = len(elementNodesArray)
5300  * IMRNodesArray_ = np.zeros(nNodes)
5301  * cyUpdateInverseMeanRatioTriangleNodes(IMRNodesArray_=IMRNodesArray_, # <<<<<<<<<<<<<<
5302  * nodeArray=nodeArray,
5303  * elementNodesArray=elementNodesArray,
5304  */
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)
5306 
5307  /* "mprans/MeshSmoothing.pyx":218
5308  * nodeElementOffsets=nodeElementOffsets,
5309  * nodeElementsArray=nodeElementsArray,
5310  * el_average=el_average, # <<<<<<<<<<<<<<
5311  * nNodes=nNodes,
5312  * nElements=nElements)
5313  */
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;
5320 
5321  /* "mprans/MeshSmoothing.pyx":221
5322  * nNodes=nNodes,
5323  * nElements=nElements)
5324  * return IMRNodesArray_ # <<<<<<<<<<<<<<
5325  *
5326  * def getInverseMeanRatioSingleTriangle(int node0,
5327  */
5328  __Pyx_XDECREF(__pyx_r);
5329  __Pyx_INCREF(__pyx_v_IMRNodesArray_);
5330  __pyx_r = __pyx_v_IMRNodesArray_;
5331  goto __pyx_L0;
5332 
5333  /* "mprans/MeshSmoothing.pyx":205
5334  * nElements=nElements)
5335  *
5336  * def getInverseMeanRatioTriangleNodes(double[:,:] nodeArray, # <<<<<<<<<<<<<<
5337  * int[:,:] elementNodesArray,
5338  * int[:] nodeElementOffsets,
5339  */
5340 
5341  /* function exit code */
5342  __pyx_L1_error:;
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);
5349  __pyx_r = NULL;
5350  __pyx_L0:;
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();
5358  return __pyx_r;
5359 }
5360 
5361 /* "mprans/MeshSmoothing.pyx":223
5362  * return IMRNodesArray_
5363  *
5364  * def getInverseMeanRatioSingleTriangle(int node0, # <<<<<<<<<<<<<<
5365  * double[:,:] nodeArray,
5366  * int[:,:] elementNodesArray,
5367  */
5368 
5369 /* Python wrapper */
5370 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_21getInverseMeanRatioSingleTriangle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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) {
5373  int __pyx_v_node0;
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);
5384  {
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)) {
5388  Py_ssize_t kw_args;
5389  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5390  switch (pos_args) {
5391  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5392  CYTHON_FALLTHROUGH;
5393  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5394  CYTHON_FALLTHROUGH;
5395  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5396  CYTHON_FALLTHROUGH;
5397  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5398  CYTHON_FALLTHROUGH;
5399  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5400  CYTHON_FALLTHROUGH;
5401  case 0: break;
5402  default: goto __pyx_L5_argtuple_error;
5403  }
5404  kw_args = PyDict_Size(__pyx_kwds);
5405  switch (pos_args) {
5406  case 0:
5407  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node0)) != 0)) kw_args--;
5408  else goto __pyx_L5_argtuple_error;
5409  CYTHON_FALLTHROUGH;
5410  case 1:
5411  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray_2)) != 0)) kw_args--;
5412  else {
5413  __Pyx_RaiseArgtupleInvalid("getInverseMeanRatioSingleTriangle", 1, 5, 5, 1); __PYX_ERR(0, 223, __pyx_L3_error)
5414  }
5415  CYTHON_FALLTHROUGH;
5416  case 2:
5417  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
5418  else {
5419  __Pyx_RaiseArgtupleInvalid("getInverseMeanRatioSingleTriangle", 1, 5, 5, 2); __PYX_ERR(0, 223, __pyx_L3_error)
5420  }
5421  CYTHON_FALLTHROUGH;
5422  case 3:
5423  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
5424  else {
5425  __Pyx_RaiseArgtupleInvalid("getInverseMeanRatioSingleTriangle", 1, 5, 5, 3); __PYX_ERR(0, 223, __pyx_L3_error)
5426  }
5427  CYTHON_FALLTHROUGH;
5428  case 4:
5429  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
5430  else {
5431  __Pyx_RaiseArgtupleInvalid("getInverseMeanRatioSingleTriangle", 1, 5, 5, 4); __PYX_ERR(0, 223, __pyx_L3_error)
5432  }
5433  }
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)
5436  }
5437  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5438  goto __pyx_L5_argtuple_error;
5439  } else {
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);
5445  }
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)
5451  }
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)
5455  __pyx_L3_error:;
5456  __Pyx_AddTraceback("mprans.MeshSmoothing.getInverseMeanRatioSingleTriangle", __pyx_clineno, __pyx_lineno, __pyx_filename);
5457  __Pyx_RefNannyFinishContext();
5458  return NULL;
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);
5461 
5462  /* function exit code */
5463  __Pyx_RefNannyFinishContext();
5464  return __pyx_r;
5465 }
5466 
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);
5475 
5476  /* "mprans/MeshSmoothing.pyx":228
5477  * int[:] nodeElementOffsets,
5478  * int[:] nodeElementsArray):
5479  * return cyGetInverseMeanRatioSingleTriangle(node0=node0, # <<<<<<<<<<<<<<
5480  * nodeArray=nodeArray,
5481  * elementNodesArray=elementNodesArray,
5482  */
5483  __Pyx_XDECREF(__pyx_r);
5484 
5485  /* "mprans/MeshSmoothing.pyx":232
5486  * elementNodesArray=elementNodesArray,
5487  * nodeElementOffsets=nodeElementOffsets,
5488  * nodeElementsArray=nodeElementsArray) # <<<<<<<<<<<<<<
5489  *
5490  * def smoothNodesQuality(double[:] distortion,
5491  */
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;
5495  __pyx_t_1 = 0;
5496  goto __pyx_L0;
5497 
5498  /* "mprans/MeshSmoothing.pyx":223
5499  * return IMRNodesArray_
5500  *
5501  * def getInverseMeanRatioSingleTriangle(int node0, # <<<<<<<<<<<<<<
5502  * double[:,:] nodeArray,
5503  * int[:,:] elementNodesArray,
5504  */
5505 
5506  /* function exit code */
5507  __pyx_L1_error:;
5508  __Pyx_XDECREF(__pyx_t_1);
5509  __Pyx_AddTraceback("mprans.MeshSmoothing.getInverseMeanRatioSingleTriangle", __pyx_clineno, __pyx_lineno, __pyx_filename);
5510  __pyx_r = NULL;
5511  __pyx_L0:;
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();
5518  return __pyx_r;
5519 }
5520 
5521 /* "mprans/MeshSmoothing.pyx":234
5522  * nodeElementsArray=nodeElementsArray)
5523  *
5524  * def smoothNodesQuality(double[:] distortion, # <<<<<<<<<<<<<<
5525  * double[:] dilation,
5526  * double[:,:] nodeArray,
5527  */
5528 
5529 /* Python wrapper */
5530 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_23smoothNodesQuality(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
5548  {
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)) {
5552  Py_ssize_t kw_args;
5553  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5554  switch (pos_args) {
5555  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5556  CYTHON_FALLTHROUGH;
5557  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5558  CYTHON_FALLTHROUGH;
5559  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5560  CYTHON_FALLTHROUGH;
5561  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5562  CYTHON_FALLTHROUGH;
5563  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5564  CYTHON_FALLTHROUGH;
5565  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5566  CYTHON_FALLTHROUGH;
5567  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5568  CYTHON_FALLTHROUGH;
5569  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5570  CYTHON_FALLTHROUGH;
5571  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5572  CYTHON_FALLTHROUGH;
5573  case 0: break;
5574  default: goto __pyx_L5_argtuple_error;
5575  }
5576  kw_args = PyDict_Size(__pyx_kwds);
5577  switch (pos_args) {
5578  case 0:
5579  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_distortion)) != 0)) kw_args--;
5580  else goto __pyx_L5_argtuple_error;
5581  CYTHON_FALLTHROUGH;
5582  case 1:
5583  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dilation)) != 0)) kw_args--;
5584  else {
5585  __Pyx_RaiseArgtupleInvalid("smoothNodesQuality", 0, 8, 9, 1); __PYX_ERR(0, 234, __pyx_L3_error)
5586  }
5587  CYTHON_FALLTHROUGH;
5588  case 2:
5589  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray_2)) != 0)) kw_args--;
5590  else {
5591  __Pyx_RaiseArgtupleInvalid("smoothNodesQuality", 0, 8, 9, 2); __PYX_ERR(0, 234, __pyx_L3_error)
5592  }
5593  CYTHON_FALLTHROUGH;
5594  case 3:
5595  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes_owned)) != 0)) kw_args--;
5596  else {
5597  __Pyx_RaiseArgtupleInvalid("smoothNodesQuality", 0, 8, 9, 3); __PYX_ERR(0, 234, __pyx_L3_error)
5598  }
5599  CYTHON_FALLTHROUGH;
5600  case 4:
5601  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeMaterialTypes)) != 0)) kw_args--;
5602  else {
5603  __Pyx_RaiseArgtupleInvalid("smoothNodesQuality", 0, 8, 9, 4); __PYX_ERR(0, 234, __pyx_L3_error)
5604  }
5605  CYTHON_FALLTHROUGH;
5606  case 5:
5607  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
5608  else {
5609  __Pyx_RaiseArgtupleInvalid("smoothNodesQuality", 0, 8, 9, 5); __PYX_ERR(0, 234, __pyx_L3_error)
5610  }
5611  CYTHON_FALLTHROUGH;
5612  case 6:
5613  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
5614  else {
5615  __Pyx_RaiseArgtupleInvalid("smoothNodesQuality", 0, 8, 9, 6); __PYX_ERR(0, 234, __pyx_L3_error)
5616  }
5617  CYTHON_FALLTHROUGH;
5618  case 7:
5619  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNodesArray)) != 0)) kw_args--;
5620  else {
5621  __Pyx_RaiseArgtupleInvalid("smoothNodesQuality", 0, 8, 9, 7); __PYX_ERR(0, 234, __pyx_L3_error)
5622  }
5623  CYTHON_FALLTHROUGH;
5624  case 8:
5625  if (kw_args > 0) {
5626  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_apply_directly);
5627  if (value) { values[8] = value; kw_args--; }
5628  }
5629  }
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)
5632  }
5633  } else {
5634  switch (PyTuple_GET_SIZE(__pyx_args)) {
5635  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5636  CYTHON_FALLTHROUGH;
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);
5645  break;
5646  default: goto __pyx_L5_argtuple_error;
5647  }
5648  }
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)
5657  if (values[8]) {
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)
5659  } else {
5660 
5661  /* "mprans/MeshSmoothing.pyx":242
5662  * int[:] nodeElementsArray,
5663  * int[:,:] elementNodesArray,
5664  * bool apply_directly=False): # <<<<<<<<<<<<<<
5665  * assert 1>2, 'smoothNodesQuality is work in progress, do not use'
5666  * return cySmoothNodesQuality(distortion=distortion,
5667  */
5668  __pyx_v_apply_directly = ((bool)0);
5669  }
5670  }
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)
5674  __pyx_L3_error:;
5675  __Pyx_AddTraceback("mprans.MeshSmoothing.smoothNodesQuality", __pyx_clineno, __pyx_lineno, __pyx_filename);
5676  __Pyx_RefNannyFinishContext();
5677  return NULL;
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);
5680 
5681  /* "mprans/MeshSmoothing.pyx":234
5682  * nodeElementsArray=nodeElementsArray)
5683  *
5684  * def smoothNodesQuality(double[:] distortion, # <<<<<<<<<<<<<<
5685  * double[:] dilation,
5686  * double[:,:] nodeArray,
5687  */
5688 
5689  /* function exit code */
5690  __Pyx_RefNannyFinishContext();
5691  return __pyx_r;
5692 }
5693 
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);
5704 
5705  /* "mprans/MeshSmoothing.pyx":243
5706  * int[:,:] elementNodesArray,
5707  * bool apply_directly=False):
5708  * assert 1>2, 'smoothNodesQuality is work in progress, do not use' # <<<<<<<<<<<<<<
5709  * return cySmoothNodesQuality(distortion=distortion,
5710  * dilation=dilation,
5711  */
5712  #ifndef CYTHON_WITHOUT_ASSERTIONS
5713  if (unlikely(!Py_OptimizeFlag)) {
5714  if (unlikely(!0)) {
5715  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_smoothNodesQuality_is_work_in_pr);
5716  __PYX_ERR(0, 243, __pyx_L1_error)
5717  }
5718  }
5719  #endif
5720 
5721  /* "mprans/MeshSmoothing.pyx":244
5722  * bool apply_directly=False):
5723  * assert 1>2, 'smoothNodesQuality is work in progress, do not use'
5724  * return cySmoothNodesQuality(distortion=distortion, # <<<<<<<<<<<<<<
5725  * dilation=dilation,
5726  * nodeArray=nodeArray,
5727  */
5728  __Pyx_XDECREF(__pyx_r);
5729 
5730  /* "mprans/MeshSmoothing.pyx":252
5731  * nodeElementsArray=nodeElementsArray,
5732  * elementNodesArray=elementNodesArray,
5733  * apply_directly=False) # <<<<<<<<<<<<<<
5734  *
5735  * def getLocalNearestNode(double[:] coords,
5736  */
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)
5740 
5741  /* "mprans/MeshSmoothing.pyx":244
5742  * bool apply_directly=False):
5743  * assert 1>2, 'smoothNodesQuality is work in progress, do not use'
5744  * return cySmoothNodesQuality(distortion=distortion, # <<<<<<<<<<<<<<
5745  * dilation=dilation,
5746  * nodeArray=nodeArray,
5747  */
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;
5754  __pyx_t_3 = 0;
5755  goto __pyx_L0;
5756 
5757  /* "mprans/MeshSmoothing.pyx":234
5758  * nodeElementsArray=nodeElementsArray)
5759  *
5760  * def smoothNodesQuality(double[:] distortion, # <<<<<<<<<<<<<<
5761  * double[:] dilation,
5762  * double[:,:] nodeArray,
5763  */
5764 
5765  /* function exit code */
5766  __pyx_L1_error:;
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);
5770  __pyx_r = NULL;
5771  __pyx_L0:;
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();
5781  return __pyx_r;
5782 }
5783 
5784 /* "mprans/MeshSmoothing.pyx":254
5785  * apply_directly=False)
5786  *
5787  * def getLocalNearestNode(double[:] coords, # <<<<<<<<<<<<<<
5788  * double[:,:] nodeArray,
5789  * int[:] nodeStarOffsets,
5790  */
5791 
5792 /* Python wrapper */
5793 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_25getLocalNearestNode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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 } };
5801  int __pyx_v_node;
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);
5808  {
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)) {
5812  Py_ssize_t kw_args;
5813  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5814  switch (pos_args) {
5815  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5816  CYTHON_FALLTHROUGH;
5817  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5818  CYTHON_FALLTHROUGH;
5819  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5820  CYTHON_FALLTHROUGH;
5821  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5822  CYTHON_FALLTHROUGH;
5823  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5824  CYTHON_FALLTHROUGH;
5825  case 0: break;
5826  default: goto __pyx_L5_argtuple_error;
5827  }
5828  kw_args = PyDict_Size(__pyx_kwds);
5829  switch (pos_args) {
5830  case 0:
5831  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
5832  else goto __pyx_L5_argtuple_error;
5833  CYTHON_FALLTHROUGH;
5834  case 1:
5835  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeArray_2)) != 0)) kw_args--;
5836  else {
5837  __Pyx_RaiseArgtupleInvalid("getLocalNearestNode", 1, 5, 5, 1); __PYX_ERR(0, 254, __pyx_L3_error)
5838  }
5839  CYTHON_FALLTHROUGH;
5840  case 2:
5841  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeStarOffsets)) != 0)) kw_args--;
5842  else {
5843  __Pyx_RaiseArgtupleInvalid("getLocalNearestNode", 1, 5, 5, 2); __PYX_ERR(0, 254, __pyx_L3_error)
5844  }
5845  CYTHON_FALLTHROUGH;
5846  case 3:
5847  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeStarArray)) != 0)) kw_args--;
5848  else {
5849  __Pyx_RaiseArgtupleInvalid("getLocalNearestNode", 1, 5, 5, 3); __PYX_ERR(0, 254, __pyx_L3_error)
5850  }
5851  CYTHON_FALLTHROUGH;
5852  case 4:
5853  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node)) != 0)) kw_args--;
5854  else {
5855  __Pyx_RaiseArgtupleInvalid("getLocalNearestNode", 1, 5, 5, 4); __PYX_ERR(0, 254, __pyx_L3_error)
5856  }
5857  }
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)
5860  }
5861  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5862  goto __pyx_L5_argtuple_error;
5863  } else {
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);
5869  }
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)
5875  }
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)
5879  __pyx_L3_error:;
5880  __Pyx_AddTraceback("mprans.MeshSmoothing.getLocalNearestNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
5881  __Pyx_RefNannyFinishContext();
5882  return NULL;
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);
5885 
5886  /* function exit code */
5887  __Pyx_RefNannyFinishContext();
5888  return __pyx_r;
5889 }
5890 
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);
5899 
5900  /* "mprans/MeshSmoothing.pyx":279
5901  * nearest node index
5902  * """
5903  * return pyxGetLocalNearestNode(coords, # <<<<<<<<<<<<<<
5904  * nodeArray,
5905  * nodeStarOffsets,
5906  */
5907  __Pyx_XDECREF(__pyx_r);
5908 
5909  /* "mprans/MeshSmoothing.pyx":283
5910  * nodeStarOffsets,
5911  * nodeStarArray,
5912  * node) # <<<<<<<<<<<<<<
5913  *
5914  * def getLocalNearestElement(double[:] coords,
5915  */
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;
5919  __pyx_t_1 = 0;
5920  goto __pyx_L0;
5921 
5922  /* "mprans/MeshSmoothing.pyx":254
5923  * apply_directly=False)
5924  *
5925  * def getLocalNearestNode(double[:] coords, # <<<<<<<<<<<<<<
5926  * double[:,:] nodeArray,
5927  * int[:] nodeStarOffsets,
5928  */
5929 
5930  /* function exit code */
5931  __pyx_L1_error:;
5932  __Pyx_XDECREF(__pyx_t_1);
5933  __Pyx_AddTraceback("mprans.MeshSmoothing.getLocalNearestNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
5934  __pyx_r = NULL;
5935  __pyx_L0:;
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();
5942  return __pyx_r;
5943 }
5944 
5945 /* "mprans/MeshSmoothing.pyx":285
5946  * node)
5947  *
5948  * def getLocalNearestElement(double[:] coords, # <<<<<<<<<<<<<<
5949  * double[:,:] elementBarycentersArray,
5950  * int[:,:] elementNeighborsArray,
5951  */
5952 
5953 /* Python wrapper */
5954 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_27getLocalNearestElement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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 } };
5961  int __pyx_v_eN;
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);
5968  {
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)) {
5972  Py_ssize_t kw_args;
5973  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5974  switch (pos_args) {
5975  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5976  CYTHON_FALLTHROUGH;
5977  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5978  CYTHON_FALLTHROUGH;
5979  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5980  CYTHON_FALLTHROUGH;
5981  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5982  CYTHON_FALLTHROUGH;
5983  case 0: break;
5984  default: goto __pyx_L5_argtuple_error;
5985  }
5986  kw_args = PyDict_Size(__pyx_kwds);
5987  switch (pos_args) {
5988  case 0:
5989  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
5990  else goto __pyx_L5_argtuple_error;
5991  CYTHON_FALLTHROUGH;
5992  case 1:
5993  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
5994  else {
5995  __Pyx_RaiseArgtupleInvalid("getLocalNearestElement", 1, 4, 4, 1); __PYX_ERR(0, 285, __pyx_L3_error)
5996  }
5997  CYTHON_FALLTHROUGH;
5998  case 2:
5999  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
6000  else {
6001  __Pyx_RaiseArgtupleInvalid("getLocalNearestElement", 1, 4, 4, 2); __PYX_ERR(0, 285, __pyx_L3_error)
6002  }
6003  CYTHON_FALLTHROUGH;
6004  case 3:
6005  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eN)) != 0)) kw_args--;
6006  else {
6007  __Pyx_RaiseArgtupleInvalid("getLocalNearestElement", 1, 4, 4, 3); __PYX_ERR(0, 285, __pyx_L3_error)
6008  }
6009  }
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)
6012  }
6013  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
6014  goto __pyx_L5_argtuple_error;
6015  } else {
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);
6020  }
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)
6025  }
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)
6029  __pyx_L3_error:;
6030  __Pyx_AddTraceback("mprans.MeshSmoothing.getLocalNearestElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
6031  __Pyx_RefNannyFinishContext();
6032  return NULL;
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);
6035 
6036  /* function exit code */
6037  __Pyx_RefNannyFinishContext();
6038  return __pyx_r;
6039 }
6040 
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);
6049 
6050  /* "mprans/MeshSmoothing.pyx":307
6051  * nearest element index
6052  * """
6053  * return pyxGetLocalNearestElement(coords, # <<<<<<<<<<<<<<
6054  * elementBarycentersArray,
6055  * elementNeighborsArray,
6056  */
6057  __Pyx_XDECREF(__pyx_r);
6058 
6059  /* "mprans/MeshSmoothing.pyx":310
6060  * elementBarycentersArray,
6061  * elementNeighborsArray,
6062  * eN) # <<<<<<<<<<<<<<
6063  *
6064  * def getLocalNearestElementAroundNode(double[:] coords,
6065  */
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;
6069  __pyx_t_1 = 0;
6070  goto __pyx_L0;
6071 
6072  /* "mprans/MeshSmoothing.pyx":285
6073  * node)
6074  *
6075  * def getLocalNearestElement(double[:] coords, # <<<<<<<<<<<<<<
6076  * double[:,:] elementBarycentersArray,
6077  * int[:,:] elementNeighborsArray,
6078  */
6079 
6080  /* function exit code */
6081  __pyx_L1_error:;
6082  __Pyx_XDECREF(__pyx_t_1);
6083  __Pyx_AddTraceback("mprans.MeshSmoothing.getLocalNearestElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
6084  __pyx_r = NULL;
6085  __pyx_L0:;
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();
6091  return __pyx_r;
6092 }
6093 
6094 /* "mprans/MeshSmoothing.pyx":312
6095  * eN)
6096  *
6097  * def getLocalNearestElementAroundNode(double[:] coords, # <<<<<<<<<<<<<<
6098  * int[:] nodeElementOffsets,
6099  * int[:] nodeElementsArray,
6100  */
6101 
6102 /* Python wrapper */
6103 static PyObject *__pyx_pw_6mprans_13MeshSmoothing_29getLocalNearestElementAroundNode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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 } };
6111  int __pyx_v_node;
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);
6118  {
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)) {
6122  Py_ssize_t kw_args;
6123  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6124  switch (pos_args) {
6125  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6126  CYTHON_FALLTHROUGH;
6127  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6128  CYTHON_FALLTHROUGH;
6129  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6130  CYTHON_FALLTHROUGH;
6131  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6132  CYTHON_FALLTHROUGH;
6133  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6134  CYTHON_FALLTHROUGH;
6135  case 0: break;
6136  default: goto __pyx_L5_argtuple_error;
6137  }
6138  kw_args = PyDict_Size(__pyx_kwds);
6139  switch (pos_args) {
6140  case 0:
6141  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
6142  else goto __pyx_L5_argtuple_error;
6143  CYTHON_FALLTHROUGH;
6144  case 1:
6145  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
6146  else {
6147  __Pyx_RaiseArgtupleInvalid("getLocalNearestElementAroundNode", 1, 5, 5, 1); __PYX_ERR(0, 312, __pyx_L3_error)
6148  }