proteus  1.8.1
C/C++/Fortran libraries
cMoveMeshMonitor.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__cMoveMeshMonitor
708 #define __PYX_HAVE_API__mprans__cMoveMeshMonitor
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 "pythread.h"
721 #include <stdlib.h>
722 #include "pystate.h"
723 #ifdef _OPENMP
724 #include <omp.h>
725 #endif /* _OPENMP */
726 
727 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
728 #define CYTHON_WITHOUT_ASSERTIONS
729 #endif
730 
731 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
732  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
733 
734 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
735 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
736 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
737 #define __PYX_DEFAULT_STRING_ENCODING ""
738 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
739 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
740 #define __Pyx_uchar_cast(c) ((unsigned char)c)
741 #define __Pyx_long_cast(x) ((long)x)
742 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
743  (sizeof(type) < sizeof(Py_ssize_t)) ||\
744  (sizeof(type) > sizeof(Py_ssize_t) &&\
745  likely(v < (type)PY_SSIZE_T_MAX ||\
746  v == (type)PY_SSIZE_T_MAX) &&\
747  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
748  v == (type)PY_SSIZE_T_MIN))) ||\
749  (sizeof(type) == sizeof(Py_ssize_t) &&\
750  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
751  v == (type)PY_SSIZE_T_MAX))) )
752 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
753  return (size_t) i < (size_t) limit;
754 }
755 #if defined (__cplusplus) && __cplusplus >= 201103L
756  #include <cstdlib>
757  #define __Pyx_sst_abs(value) std::abs(value)
758 #elif SIZEOF_INT >= SIZEOF_SIZE_T
759  #define __Pyx_sst_abs(value) abs(value)
760 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
761  #define __Pyx_sst_abs(value) labs(value)
762 #elif defined (_MSC_VER)
763  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
764 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
765  #define __Pyx_sst_abs(value) llabs(value)
766 #elif defined (__GNUC__)
767  #define __Pyx_sst_abs(value) __builtin_llabs(value)
768 #else
769  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
770 #endif
771 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
772 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
773 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
774 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
775 #define __Pyx_PyBytes_FromString PyBytes_FromString
776 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
777 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
778 #if PY_MAJOR_VERSION < 3
779  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
780  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
781 #else
782  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
783  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
784 #endif
785 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
786 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
787 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
788 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
790 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
792 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
793 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
794 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
795 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
796 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
797 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
798 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
799 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
800 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
801 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
802  const Py_UNICODE *u_end = u;
803  while (*u_end++) ;
804  return (size_t)(u_end - u - 1);
805 }
806 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
807 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
808 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
809 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
810 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
811 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
812 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
813 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
814 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
815 #define __Pyx_PySequence_Tuple(obj)\
816  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
817 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
818 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
819 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
820 #if CYTHON_ASSUME_SAFE_MACROS
821 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
822 #else
823 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
824 #endif
825 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
826 #if PY_MAJOR_VERSION >= 3
827 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
828 #else
829 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
830 #endif
831 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
832 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
833 static int __Pyx_sys_getdefaultencoding_not_ascii;
834 static int __Pyx_init_sys_getdefaultencoding_params(void) {
835  PyObject* sys;
836  PyObject* default_encoding = NULL;
837  PyObject* ascii_chars_u = NULL;
838  PyObject* ascii_chars_b = NULL;
839  const char* default_encoding_c;
840  sys = PyImport_ImportModule("sys");
841  if (!sys) goto bad;
842  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
843  Py_DECREF(sys);
844  if (!default_encoding) goto bad;
845  default_encoding_c = PyBytes_AsString(default_encoding);
846  if (!default_encoding_c) goto bad;
847  if (strcmp(default_encoding_c, "ascii") == 0) {
848  __Pyx_sys_getdefaultencoding_not_ascii = 0;
849  } else {
850  char ascii_chars[128];
851  int c;
852  for (c = 0; c < 128; c++) {
853  ascii_chars[c] = c;
854  }
855  __Pyx_sys_getdefaultencoding_not_ascii = 1;
856  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
857  if (!ascii_chars_u) goto bad;
858  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
859  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
860  PyErr_Format(
861  PyExc_ValueError,
862  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
863  default_encoding_c);
864  goto bad;
865  }
866  Py_DECREF(ascii_chars_u);
867  Py_DECREF(ascii_chars_b);
868  }
869  Py_DECREF(default_encoding);
870  return 0;
871 bad:
872  Py_XDECREF(default_encoding);
873  Py_XDECREF(ascii_chars_u);
874  Py_XDECREF(ascii_chars_b);
875  return -1;
876 }
877 #endif
878 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
879 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
880 #else
881 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
882 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
883 static char* __PYX_DEFAULT_STRING_ENCODING;
884 static int __Pyx_init_sys_getdefaultencoding_params(void) {
885  PyObject* sys;
886  PyObject* default_encoding = NULL;
887  char* default_encoding_c;
888  sys = PyImport_ImportModule("sys");
889  if (!sys) goto bad;
890  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
891  Py_DECREF(sys);
892  if (!default_encoding) goto bad;
893  default_encoding_c = PyBytes_AsString(default_encoding);
894  if (!default_encoding_c) goto bad;
895  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
896  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
897  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
898  Py_DECREF(default_encoding);
899  return 0;
900 bad:
901  Py_XDECREF(default_encoding);
902  return -1;
903 }
904 #endif
905 #endif
906 
907 
908 /* Test for GCC > 2.95 */
909 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
910  #define likely(x) __builtin_expect(!!(x), 1)
911  #define unlikely(x) __builtin_expect(!!(x), 0)
912 #else /* !__GNUC__ or GCC < 2.95 */
913  #define likely(x) (x)
914  #define unlikely(x) (x)
915 #endif /* __GNUC__ */
916 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
917 
918 static PyObject *__pyx_m = NULL;
919 static PyObject *__pyx_d;
920 static PyObject *__pyx_b;
921 static PyObject *__pyx_cython_runtime = NULL;
922 static PyObject *__pyx_empty_tuple;
923 static PyObject *__pyx_empty_bytes;
924 static PyObject *__pyx_empty_unicode;
925 static int __pyx_lineno;
926 static int __pyx_clineno = 0;
927 static const char * __pyx_cfilenm= __FILE__;
928 static const char *__pyx_filename;
929 
930 /* Header.proto */
931 #if !defined(CYTHON_CCOMPLEX)
932  #if defined(__cplusplus)
933  #define CYTHON_CCOMPLEX 1
934  #elif defined(_Complex_I)
935  #define CYTHON_CCOMPLEX 1
936  #else
937  #define CYTHON_CCOMPLEX 0
938  #endif
939 #endif
940 #if CYTHON_CCOMPLEX
941  #ifdef __cplusplus
942  #include <complex>
943  #else
944  #include <complex.h>
945  #endif
946 #endif
947 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
948  #undef _Complex_I
949  #define _Complex_I 1.0fj
950 #endif
951 
952 
953 static const char *__pyx_f[] = {
954  "proteus/mprans/cMoveMeshMonitor.pyx",
955  "stringsource",
956  "__init__.pxd",
957  "type.pxd",
958 };
959 /* MemviewSliceStruct.proto */
960 struct __pyx_memoryview_obj;
961 typedef struct {
962  struct __pyx_memoryview_obj *memview;
963  char *data;
964  Py_ssize_t shape[8];
965  Py_ssize_t strides[8];
966  Py_ssize_t suboffsets[8];
967 } __Pyx_memviewslice;
968 #define __Pyx_MemoryView_Len(m) (m.shape[0])
969 
970 /* Atomics.proto */
971 #include <pythread.h>
972 #ifndef CYTHON_ATOMICS
973  #define CYTHON_ATOMICS 1
974 #endif
975 #define __pyx_atomic_int_type int
976 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
977  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
978  !defined(__i386__)
979  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
980  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
981  #ifdef __PYX_DEBUG_ATOMICS
982  #warning "Using GNU atomics"
983  #endif
984 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
985  #include <Windows.h>
986  #undef __pyx_atomic_int_type
987  #define __pyx_atomic_int_type LONG
988  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
989  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
990  #ifdef __PYX_DEBUG_ATOMICS
991  #pragma message ("Using MSVC atomics")
992  #endif
993 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
994  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
995  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
996  #ifdef __PYX_DEBUG_ATOMICS
997  #warning "Using Intel atomics"
998  #endif
999 #else
1000  #undef CYTHON_ATOMICS
1001  #define CYTHON_ATOMICS 0
1002  #ifdef __PYX_DEBUG_ATOMICS
1003  #warning "Not using atomics"
1004  #endif
1005 #endif
1006 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1007 #if CYTHON_ATOMICS
1008  #define __pyx_add_acquisition_count(memview)\
1009  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1010  #define __pyx_sub_acquisition_count(memview)\
1011  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1012 #else
1013  #define __pyx_add_acquisition_count(memview)\
1014  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1015  #define __pyx_sub_acquisition_count(memview)\
1016  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1017 #endif
1018 
1019 /* ForceInitThreads.proto */
1020 #ifndef __PYX_FORCE_INIT_THREADS
1021  #define __PYX_FORCE_INIT_THREADS 0
1022 #endif
1023 
1024 /* NoFastGil.proto */
1025 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1026 #define __Pyx_PyGILState_Release PyGILState_Release
1027 #define __Pyx_FastGIL_Remember()
1028 #define __Pyx_FastGIL_Forget()
1029 #define __Pyx_FastGilFuncInit()
1030 
1031 /* BufferFormatStructs.proto */
1032 #define IS_UNSIGNED(type) (((type) -1) > 0)
1033 struct __Pyx_StructField_;
1034 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1035 typedef struct {
1036  const char* name;
1037  struct __Pyx_StructField_* fields;
1038  size_t size;
1039  size_t arraysize[8];
1040  int ndim;
1041  char typegroup;
1042  char is_unsigned;
1043  int flags;
1044 } __Pyx_TypeInfo;
1045 typedef struct __Pyx_StructField_ {
1046  __Pyx_TypeInfo* type;
1047  const char* name;
1048  size_t offset;
1049 } __Pyx_StructField;
1050 typedef struct {
1051  __Pyx_StructField* field;
1052  size_t parent_offset;
1053 } __Pyx_BufFmt_StackElem;
1054 typedef struct {
1055  __Pyx_StructField root;
1056  __Pyx_BufFmt_StackElem* head;
1057  size_t fmt_offset;
1058  size_t new_count, enc_count;
1059  size_t struct_alignment;
1060  int is_complex;
1061  char enc_type;
1062  char new_packmode;
1063  char enc_packmode;
1064  char is_valid_array;
1065 } __Pyx_BufFmt_Context;
1066 
1067 
1068 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
1069  * # in Cython to enable them only on the right systems.
1070  *
1071  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1072  * ctypedef npy_int16 int16_t
1073  * ctypedef npy_int32 int32_t
1074  */
1075 typedef npy_int8 __pyx_t_5numpy_int8_t;
1076 
1077 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
1078  *
1079  * ctypedef npy_int8 int8_t
1080  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1081  * ctypedef npy_int32 int32_t
1082  * ctypedef npy_int64 int64_t
1083  */
1084 typedef npy_int16 __pyx_t_5numpy_int16_t;
1085 
1086 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
1087  * ctypedef npy_int8 int8_t
1088  * ctypedef npy_int16 int16_t
1089  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1090  * ctypedef npy_int64 int64_t
1091  * #ctypedef npy_int96 int96_t
1092  */
1093 typedef npy_int32 __pyx_t_5numpy_int32_t;
1094 
1095 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
1096  * ctypedef npy_int16 int16_t
1097  * ctypedef npy_int32 int32_t
1098  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1099  * #ctypedef npy_int96 int96_t
1100  * #ctypedef npy_int128 int128_t
1101  */
1102 typedef npy_int64 __pyx_t_5numpy_int64_t;
1103 
1104 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
1105  * #ctypedef npy_int128 int128_t
1106  *
1107  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1108  * ctypedef npy_uint16 uint16_t
1109  * ctypedef npy_uint32 uint32_t
1110  */
1111 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1112 
1113 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1114  *
1115  * ctypedef npy_uint8 uint8_t
1116  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1117  * ctypedef npy_uint32 uint32_t
1118  * ctypedef npy_uint64 uint64_t
1119  */
1120 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1121 
1122 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1123  * ctypedef npy_uint8 uint8_t
1124  * ctypedef npy_uint16 uint16_t
1125  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1126  * ctypedef npy_uint64 uint64_t
1127  * #ctypedef npy_uint96 uint96_t
1128  */
1129 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1130 
1131 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1132  * ctypedef npy_uint16 uint16_t
1133  * ctypedef npy_uint32 uint32_t
1134  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1135  * #ctypedef npy_uint96 uint96_t
1136  * #ctypedef npy_uint128 uint128_t
1137  */
1138 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1139 
1140 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1141  * #ctypedef npy_uint128 uint128_t
1142  *
1143  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1144  * ctypedef npy_float64 float64_t
1145  * #ctypedef npy_float80 float80_t
1146  */
1147 typedef npy_float32 __pyx_t_5numpy_float32_t;
1148 
1149 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1150  *
1151  * ctypedef npy_float32 float32_t
1152  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1153  * #ctypedef npy_float80 float80_t
1154  * #ctypedef npy_float128 float128_t
1155  */
1156 typedef npy_float64 __pyx_t_5numpy_float64_t;
1157 
1158 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1159  * # The int types are mapped a bit surprising --
1160  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1161  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1162  * ctypedef npy_longlong long_t
1163  * ctypedef npy_longlong longlong_t
1164  */
1165 typedef npy_long __pyx_t_5numpy_int_t;
1166 
1167 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1168  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1169  * ctypedef npy_long int_t
1170  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1171  * ctypedef npy_longlong longlong_t
1172  *
1173  */
1174 typedef npy_longlong __pyx_t_5numpy_long_t;
1175 
1176 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1177  * ctypedef npy_long int_t
1178  * ctypedef npy_longlong long_t
1179  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1180  *
1181  * ctypedef npy_ulong uint_t
1182  */
1183 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1184 
1185 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1186  * ctypedef npy_longlong longlong_t
1187  *
1188  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1189  * ctypedef npy_ulonglong ulong_t
1190  * ctypedef npy_ulonglong ulonglong_t
1191  */
1192 typedef npy_ulong __pyx_t_5numpy_uint_t;
1193 
1194 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1195  *
1196  * ctypedef npy_ulong uint_t
1197  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1198  * ctypedef npy_ulonglong ulonglong_t
1199  *
1200  */
1201 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1202 
1203 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1204  * ctypedef npy_ulong uint_t
1205  * ctypedef npy_ulonglong ulong_t
1206  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1207  *
1208  * ctypedef npy_intp intp_t
1209  */
1210 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1211 
1212 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1213  * ctypedef npy_ulonglong ulonglong_t
1214  *
1215  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1216  * ctypedef npy_uintp uintp_t
1217  *
1218  */
1219 typedef npy_intp __pyx_t_5numpy_intp_t;
1220 
1221 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1222  *
1223  * ctypedef npy_intp intp_t
1224  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1225  *
1226  * ctypedef npy_double float_t
1227  */
1228 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1229 
1230 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1231  * ctypedef npy_uintp uintp_t
1232  *
1233  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1234  * ctypedef npy_double double_t
1235  * ctypedef npy_longdouble longdouble_t
1236  */
1237 typedef npy_double __pyx_t_5numpy_float_t;
1238 
1239 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1240  *
1241  * ctypedef npy_double float_t
1242  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1243  * ctypedef npy_longdouble longdouble_t
1244  *
1245  */
1246 typedef npy_double __pyx_t_5numpy_double_t;
1247 
1248 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1249  * ctypedef npy_double float_t
1250  * ctypedef npy_double double_t
1251  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1252  *
1253  * ctypedef npy_cfloat cfloat_t
1254  */
1255 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1256 /* Declarations.proto */
1257 #if CYTHON_CCOMPLEX
1258  #ifdef __cplusplus
1259  typedef ::std::complex< float > __pyx_t_float_complex;
1260  #else
1261  typedef float _Complex __pyx_t_float_complex;
1262  #endif
1263 #else
1264  typedef struct { float real, imag; } __pyx_t_float_complex;
1265 #endif
1266 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1267 
1268 /* Declarations.proto */
1269 #if CYTHON_CCOMPLEX
1270  #ifdef __cplusplus
1271  typedef ::std::complex< double > __pyx_t_double_complex;
1272  #else
1273  typedef double _Complex __pyx_t_double_complex;
1274  #endif
1275 #else
1276  typedef struct { double real, imag; } __pyx_t_double_complex;
1277 #endif
1278 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1279 
1280 
1281 /*--- Type declarations ---*/
1282 struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients;
1283 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel;
1284 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr;
1285 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr;
1286 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr;
1287 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr;
1288 struct __pyx_array_obj;
1289 struct __pyx_MemviewEnum_obj;
1290 struct __pyx_memoryview_obj;
1291 struct __pyx_memoryviewslice_obj;
1292 
1293 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1294  * ctypedef npy_longdouble longdouble_t
1295  *
1296  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1297  * ctypedef npy_cdouble cdouble_t
1298  * ctypedef npy_clongdouble clongdouble_t
1299  */
1300 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1301 
1302 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1303  *
1304  * ctypedef npy_cfloat cfloat_t
1305  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1306  * ctypedef npy_clongdouble clongdouble_t
1307  *
1308  */
1309 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1310 
1311 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1312  * ctypedef npy_cfloat cfloat_t
1313  * ctypedef npy_cdouble cdouble_t
1314  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1315  *
1316  * ctypedef npy_cdouble complex_t
1317  */
1318 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1319 
1320 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1321  * ctypedef npy_clongdouble clongdouble_t
1322  *
1323  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1324  *
1325  * cdef inline object PyArray_MultiIterNew1(a):
1326  */
1327 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1328 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cySmoothNodesLaplace;
1329 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cySmoothNodesCentroid;
1330 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleNodes;
1331 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cyGetInverseMeanRatioSingleTriangle;
1332 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cySmoothNodesQuality;
1333 
1334 /* "MeshSmoothing.pxd":6
1335  * from libcpp cimport bool
1336  *
1337  * cdef void cySmoothNodesLaplace(double[:,:] nodeArray_, # <<<<<<<<<<<<<<
1338  * int[:] nodeStarOffsets,
1339  * int[:] nodeStarArray,
1340  */
1341 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cySmoothNodesLaplace {
1342  int __pyx_n;
1343  bool simultaneous;
1344  bool smoothBoundaries;
1345  __Pyx_memviewslice fixedNodesBoolArray;
1346  double alpha;
1347 };
1348 
1349 /* "MeshSmoothing.pxd":17
1350  * double alpha=*)
1351  *
1352  * cdef void cySmoothNodesCentroid(double[:,:] nodeArray_, # <<<<<<<<<<<<<<
1353  * int[:] nodeElementOffsets,
1354  * int[:] nodeElementsArray,
1355  */
1356 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cySmoothNodesCentroid {
1357  int __pyx_n;
1358  bool simultaneous;
1359  bool smoothBoundaries;
1360  double alpha;
1361 };
1362 
1363 /* "MeshSmoothing.pxd":41
1364  * int nElements)
1365  *
1366  * cdef void cyUpdateInverseMeanRatioTriangleNodes(double[:] IMRNodesArray_, # <<<<<<<<<<<<<<
1367  * double[:,:] nodeArray,
1368  * int[:,:] elementNodesArray,
1369  */
1370 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cyUpdateInverseMeanRatioTriangleNodes {
1371  int __pyx_n;
1372  bool el_average;
1373 };
1374 
1375 /* "MeshSmoothing.pxd":55
1376  * int nElements)
1377  *
1378  * cdef double cyGetInverseMeanRatioSingleTriangle(int node0, # <<<<<<<<<<<<<<
1379  * double[:,:] nodeArray,
1380  * int[:,:] elementNodesArray,
1381  */
1382 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cyGetInverseMeanRatioSingleTriangle {
1383  int __pyx_n;
1384  bool el_average;
1385 };
1386 
1387 /* "MeshSmoothing.pxd":62
1388  * bool el_average=*)
1389  *
1390  * cdef double[:,:] cySmoothNodesQuality(double[:] distortion, # <<<<<<<<<<<<<<
1391  * double[:] dilation,
1392  * double[:,:] nodeArray,
1393  */
1394 struct __pyx_opt_args_7proteus_6mprans_13MeshSmoothing_cySmoothNodesQuality {
1395  int __pyx_n;
1396  bool apply_directly;
1397 };
1398 
1399 /* "mprans/cMoveMeshMonitor.pyx":15
1400  *
1401  *
1402  * cdef class cCoefficients: # <<<<<<<<<<<<<<
1403  * cdef public:
1404  * object pyCoefficients
1405  */
1406 struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients {
1407  PyObject_HEAD
1408  struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_vtab;
1409  PyObject *pyCoefficients;
1410  double C;
1411 };
1412 
1413 
1414 /* "mprans/cMoveMeshMonitor.pyx":202
1415  * eps=eps)
1416  *
1417  * cdef cppPseudoTimeSteppingParallel(self, # <<<<<<<<<<<<<<
1418  * double[:,:] xx,
1419  * double eps):
1420  */
1421 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel {
1422  PyObject_HEAD
1423  int __pyx_v_comm_size;
1424  __Pyx_memviewslice __pyx_v_coords_2doArray;
1425  __Pyx_memviewslice __pyx_v_counts_in;
1426  __Pyx_memviewslice __pyx_v_displacements_in;
1427 };
1428 
1429 
1430 /* "mprans/cMoveMeshMonitor.pyx":597
1431  * comm.Gatherv(coords_2rank[rank_recv],
1432  * [coords_2doArray,
1433  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)), # <<<<<<<<<<<<<<
1434  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
1435  * MPI.DOUBLE],
1436  */
1437 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr {
1438  PyObject_HEAD
1439  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *__pyx_outer_scope;
1440  int __pyx_v_i;
1441  int __pyx_t_0;
1442  int __pyx_t_1;
1443  int __pyx_t_2;
1444 };
1445 
1446 
1447 /* "mprans/cMoveMeshMonitor.pyx":598
1448  * [coords_2doArray,
1449  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
1450  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)), # <<<<<<<<<<<<<<
1451  * MPI.DOUBLE],
1452  * root=rank_recv)
1453  */
1454 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr {
1455  PyObject_HEAD
1456  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *__pyx_outer_scope;
1457  int __pyx_v_i;
1458  int __pyx_t_0;
1459  int __pyx_t_1;
1460  int __pyx_t_2;
1461 };
1462 
1463 
1464 /* "mprans/cMoveMeshMonitor.pyx":793
1465  * comm.Gatherv(coords_2rank[rank_recv],
1466  * [coords_2doArray,
1467  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)), # <<<<<<<<<<<<<<
1468  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
1469  * MPI.DOUBLE],
1470  */
1471 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr {
1472  PyObject_HEAD
1473  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *__pyx_outer_scope;
1474  int __pyx_v_i;
1475  int __pyx_t_0;
1476  int __pyx_t_1;
1477  int __pyx_t_2;
1478 };
1479 
1480 
1481 /* "mprans/cMoveMeshMonitor.pyx":794
1482  * [coords_2doArray,
1483  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
1484  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)), # <<<<<<<<<<<<<<
1485  * MPI.DOUBLE],
1486  * root=rank_recv)
1487  */
1488 struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr {
1489  PyObject_HEAD
1490  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *__pyx_outer_scope;
1491  int __pyx_v_i;
1492  int __pyx_t_0;
1493  int __pyx_t_1;
1494  int __pyx_t_2;
1495 };
1496 
1497 
1498 /* "View.MemoryView":105
1499  *
1500  * @cname("__pyx_array")
1501  * cdef class array: # <<<<<<<<<<<<<<
1502  *
1503  * cdef:
1504  */
1505 struct __pyx_array_obj {
1506  PyObject_HEAD
1507  struct __pyx_vtabstruct_array *__pyx_vtab;
1508  char *data;
1509  Py_ssize_t len;
1510  char *format;
1511  int ndim;
1512  Py_ssize_t *_shape;
1513  Py_ssize_t *_strides;
1514  Py_ssize_t itemsize;
1515  PyObject *mode;
1516  PyObject *_format;
1517  void (*callback_free_data)(void *);
1518  int free_data;
1519  int dtype_is_object;
1520 };
1521 
1522 
1523 /* "View.MemoryView":279
1524  *
1525  * @cname('__pyx_MemviewEnum')
1526  * cdef class Enum(object): # <<<<<<<<<<<<<<
1527  * cdef object name
1528  * def __init__(self, name):
1529  */
1530 struct __pyx_MemviewEnum_obj {
1531  PyObject_HEAD
1532  PyObject *name;
1533 };
1534 
1535 
1536 /* "View.MemoryView":330
1537  *
1538  * @cname('__pyx_memoryview')
1539  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1540  *
1541  * cdef object obj
1542  */
1543 struct __pyx_memoryview_obj {
1544  PyObject_HEAD
1545  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1546  PyObject *obj;
1547  PyObject *_size;
1548  PyObject *_array_interface;
1549  PyThread_type_lock lock;
1550  __pyx_atomic_int acquisition_count[2];
1551  __pyx_atomic_int *acquisition_count_aligned_p;
1552  Py_buffer view;
1553  int flags;
1554  int dtype_is_object;
1555  __Pyx_TypeInfo *typeinfo;
1556 };
1557 
1558 
1559 /* "View.MemoryView":965
1560  *
1561  * @cname('__pyx_memoryviewslice')
1562  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1563  * "Internal class for passing memoryview slices to Python"
1564  *
1565  */
1566 struct __pyx_memoryviewslice_obj {
1567  struct __pyx_memoryview_obj __pyx_base;
1568  __Pyx_memviewslice from_slice;
1569  PyObject *from_object;
1570  PyObject *(*to_object_func)(char *);
1571  int (*to_dtype_func)(char *, PyObject *);
1572 };
1573 
1574 
1575 
1576 /* "mprans/cMoveMeshMonitor.pyx":15
1577  *
1578  *
1579  * cdef class cCoefficients: # <<<<<<<<<<<<<<
1580  * cdef public:
1581  * object pyCoefficients
1582  */
1583 
1584 struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients {
1585  PyObject *(*cppPreStep)(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int);
1586  PyObject *(*cppPostStep)(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *);
1587  PyObject *(*cppPseudoTimeSteppingParallel)(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *, __Pyx_memviewslice, double);
1588 };
1589 static struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_vtabptr_6mprans_16cMoveMeshMonitor_cCoefficients;
1590 
1591 
1592 /* "View.MemoryView":105
1593  *
1594  * @cname("__pyx_array")
1595  * cdef class array: # <<<<<<<<<<<<<<
1596  *
1597  * cdef:
1598  */
1599 
1600 struct __pyx_vtabstruct_array {
1601  PyObject *(*get_memview)(struct __pyx_array_obj *);
1602 };
1603 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1604 
1605 
1606 /* "View.MemoryView":330
1607  *
1608  * @cname('__pyx_memoryview')
1609  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1610  *
1611  * cdef object obj
1612  */
1613 
1614 struct __pyx_vtabstruct_memoryview {
1615  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1616  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1617  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1618  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1619  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1620  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1621  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1622 };
1623 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1624 
1625 
1626 /* "View.MemoryView":965
1627  *
1628  * @cname('__pyx_memoryviewslice')
1629  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1630  * "Internal class for passing memoryview slices to Python"
1631  *
1632  */
1633 
1634 struct __pyx_vtabstruct__memoryviewslice {
1635  struct __pyx_vtabstruct_memoryview __pyx_base;
1636 };
1637 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1638 
1639 /* --- Runtime support code (head) --- */
1640 /* Refnanny.proto */
1641 #ifndef CYTHON_REFNANNY
1642  #define CYTHON_REFNANNY 0
1643 #endif
1644 #if CYTHON_REFNANNY
1645  typedef struct {
1646  void (*INCREF)(void*, PyObject*, int);
1647  void (*DECREF)(void*, PyObject*, int);
1648  void (*GOTREF)(void*, PyObject*, int);
1649  void (*GIVEREF)(void*, PyObject*, int);
1650  void* (*SetupContext)(const char*, int, const char*);
1651  void (*FinishContext)(void**);
1652  } __Pyx_RefNannyAPIStruct;
1653  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1654  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1655  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1656 #ifdef WITH_THREAD
1657  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1658  if (acquire_gil) {\
1659  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1660  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1661  PyGILState_Release(__pyx_gilstate_save);\
1662  } else {\
1663  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1664  }
1665 #else
1666  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1667  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1668 #endif
1669  #define __Pyx_RefNannyFinishContext()\
1670  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1671  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1672  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1673  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1674  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1675  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1676  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1677  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1678  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1679 #else
1680  #define __Pyx_RefNannyDeclarations
1681  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1682  #define __Pyx_RefNannyFinishContext()
1683  #define __Pyx_INCREF(r) Py_INCREF(r)
1684  #define __Pyx_DECREF(r) Py_DECREF(r)
1685  #define __Pyx_GOTREF(r)
1686  #define __Pyx_GIVEREF(r)
1687  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1688  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1689  #define __Pyx_XGOTREF(r)
1690  #define __Pyx_XGIVEREF(r)
1691 #endif
1692 #define __Pyx_XDECREF_SET(r, v) do {\
1693  PyObject *tmp = (PyObject *) r;\
1694  r = v; __Pyx_XDECREF(tmp);\
1695  } while (0)
1696 #define __Pyx_DECREF_SET(r, v) do {\
1697  PyObject *tmp = (PyObject *) r;\
1698  r = v; __Pyx_DECREF(tmp);\
1699  } while (0)
1700 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1701 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1702 
1703 /* PyObjectGetAttrStr.proto */
1704 #if CYTHON_USE_TYPE_SLOTS
1705 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1706 #else
1707 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1708 #endif
1709 
1710 /* GetBuiltinName.proto */
1711 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1712 
1713 /* RaiseArgTupleInvalid.proto */
1714 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1715  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1716 
1717 /* KeywordStringCheck.proto */
1718 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1719 
1720 /* DictGetItem.proto */
1721 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1722 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1723 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1724  (likely(PyDict_CheckExact(obj)) ?\
1725  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1726 #else
1727 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1728 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1729 #endif
1730 
1731 /* GetItemInt.proto */
1732 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1733  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1734  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1735  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1736  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1737 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1738  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1739  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1740  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1741 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1742  int wraparound, int boundscheck);
1743 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1744  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1745  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1746  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1747 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1748  int wraparound, int boundscheck);
1749 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1750 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1751  int is_list, int wraparound, int boundscheck);
1752 
1753 /* ObjectGetItem.proto */
1754 #if CYTHON_USE_TYPE_SLOTS
1755 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1756 #else
1757 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1758 #endif
1759 
1760 /* MemviewSliceInit.proto */
1761 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1762 #define __Pyx_MEMVIEW_DIRECT 1
1763 #define __Pyx_MEMVIEW_PTR 2
1764 #define __Pyx_MEMVIEW_FULL 4
1765 #define __Pyx_MEMVIEW_CONTIG 8
1766 #define __Pyx_MEMVIEW_STRIDED 16
1767 #define __Pyx_MEMVIEW_FOLLOW 32
1768 #define __Pyx_IS_C_CONTIG 1
1769 #define __Pyx_IS_F_CONTIG 2
1770 static int __Pyx_init_memviewslice(
1771  struct __pyx_memoryview_obj *memview,
1772  int ndim,
1773  __Pyx_memviewslice *memviewslice,
1774  int memview_is_new_reference);
1775 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1776  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1777 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1778  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1779 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1780 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1781 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1782 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1783 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1784 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1785 
1786 /* PyDictVersioning.proto */
1787 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1788 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1789 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1790 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1791  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1792  (cache_var) = (value);
1793 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1794  static PY_UINT64_T __pyx_dict_version = 0;\
1795  static PyObject *__pyx_dict_cached_value = NULL;\
1796  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1797  (VAR) = __pyx_dict_cached_value;\
1798  } else {\
1799  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1800  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1801  }\
1802 }
1803 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1804 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1805 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1806 #else
1807 #define __PYX_GET_DICT_VERSION(dict) (0)
1808 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1809 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1810 #endif
1811 
1812 /* GetModuleGlobalName.proto */
1813 #if CYTHON_USE_DICT_VERSIONS
1814 #define __Pyx_GetModuleGlobalName(var, name) {\
1815  static PY_UINT64_T __pyx_dict_version = 0;\
1816  static PyObject *__pyx_dict_cached_value = NULL;\
1817  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1818  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1819  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1820 }
1821 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1822  PY_UINT64_T __pyx_dict_version;\
1823  PyObject *__pyx_dict_cached_value;\
1824  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1825 }
1826 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1827 #else
1828 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1829 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1830 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1831 #endif
1832 
1833 /* PyFunctionFastCall.proto */
1834 #if CYTHON_FAST_PYCALL
1835 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1836  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1837 #if 1 || PY_VERSION_HEX < 0x030600B1
1838 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1839 #else
1840 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1841 #endif
1842 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1843  (sizeof(char [1 - 2*!(cond)]) - 1)
1844 #ifndef Py_MEMBER_SIZE
1845 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1846 #endif
1847 #if CYTHON_FAST_PYCALL
1848  static size_t __pyx_pyframe_localsplus_offset = 0;
1849  #include "frameobject.h"
1850 #if PY_VERSION_HEX >= 0x030b00a6
1851  #ifndef Py_BUILD_CORE
1852  #define Py_BUILD_CORE 1
1853  #endif
1854  #include "internal/pycore_frame.h"
1855 #endif
1856  #define __Pxy_PyFrame_Initialize_Offsets()\
1857  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1858  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1859  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1860  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1861 #endif // CYTHON_FAST_PYCALL
1862 #endif
1863 
1864 /* PyObjectCall.proto */
1865 #if CYTHON_COMPILING_IN_CPYTHON
1866 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1867 #else
1868 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1869 #endif
1870 
1871 /* PyObjectCallMethO.proto */
1872 #if CYTHON_COMPILING_IN_CPYTHON
1873 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1874 #endif
1875 
1876 /* PyObjectCallNoArg.proto */
1877 #if CYTHON_COMPILING_IN_CPYTHON
1878 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1879 #else
1880 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1881 #endif
1882 
1883 /* PyCFunctionFastCall.proto */
1884 #if CYTHON_FAST_PYCCALL
1885 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1886 #else
1887 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1888 #endif
1889 
1890 /* PyObjectCallOneArg.proto */
1891 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1892 
1893 /* RaiseDoubleKeywords.proto */
1894 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1895 
1896 /* ParseKeywords.proto */
1897 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1898  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1899  const char* function_name);
1900 
1901 /* PyIntFromDouble.proto */
1902 #if PY_MAJOR_VERSION < 3
1903 static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value);
1904 #else
1905 #define __Pyx_PyInt_FromDouble(value) PyLong_FromDouble(value)
1906 #endif
1907 
1908 /* SliceObject.proto */
1909 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1910  PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1911  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1912  int has_cstart, int has_cstop, int wraparound);
1913 
1914 /* PyObjectCall2Args.proto */
1915 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1916 
1917 /* ListCompAppend.proto */
1918 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1919 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1920  PyListObject* L = (PyListObject*) list;
1921  Py_ssize_t len = Py_SIZE(list);
1922  if (likely(L->allocated > len)) {
1923  Py_INCREF(x);
1924  PyList_SET_ITEM(list, len, x);
1925  __Pyx_SET_SIZE(list, len + 1);
1926  return 0;
1927  }
1928  return PyList_Append(list, x);
1929 }
1930 #else
1931 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1932 #endif
1933 
1934 /* PyThreadStateGet.proto */
1935 #if CYTHON_FAST_THREAD_STATE
1936 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1937 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1938 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1939 #else
1940 #define __Pyx_PyThreadState_declare
1941 #define __Pyx_PyThreadState_assign
1942 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1943 #endif
1944 
1945 /* PyErrFetchRestore.proto */
1946 #if CYTHON_FAST_THREAD_STATE
1947 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1948 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1949 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1950 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1951 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1952 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1953 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1954 #if CYTHON_COMPILING_IN_CPYTHON
1955 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1956 #else
1957 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1958 #endif
1959 #else
1960 #define __Pyx_PyErr_Clear() PyErr_Clear()
1961 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1962 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1963 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1964 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1965 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1966 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1967 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1968 #endif
1969 
1970 /* RaiseException.proto */
1971 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1972 
1973 /* GetTopmostException.proto */
1974 #if CYTHON_USE_EXC_INFO_STACK
1975 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1976 #endif
1977 
1978 /* SaveResetException.proto */
1979 #if CYTHON_FAST_THREAD_STATE
1980 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1981 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1982 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1983 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1984 #else
1985 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1986 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1987 #endif
1988 
1989 /* PyErrExceptionMatches.proto */
1990 #if CYTHON_FAST_THREAD_STATE
1991 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1992 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1993 #else
1994 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1995 #endif
1996 
1997 /* GetException.proto */
1998 #if CYTHON_FAST_THREAD_STATE
1999 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2000 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2001 #else
2002 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2003 #endif
2004 
2005 /* PyIntBinop.proto */
2006 #if !CYTHON_COMPILING_IN_PYPY
2007 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2008 #else
2009 #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
2010  (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
2011 #endif
2012 
2013 /* SliceObject.proto */
2014 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
2015  __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
2016 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
2017  PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
2018  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2019  int has_cstart, int has_cstop, int wraparound);
2020 
2021 /* PyIntCompare.proto */
2022 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
2023 
2024 /* None.proto */
2025 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2026 
2027 /* PyIntBinop.proto */
2028 #if !CYTHON_COMPILING_IN_PYPY
2029 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2030 #else
2031 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2032  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2033 #endif
2034 
2035 /* SetItemInt.proto */
2036 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2037  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2038  __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2039  (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2040  __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2041 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2042 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2043  int is_list, int wraparound, int boundscheck);
2044 
2045 /* ArgTypeTest.proto */
2046 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2047  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2048  __Pyx__ArgTypeTest(obj, type, name, exact))
2049 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2050 
2051 /* IncludeStringH.proto */
2052 #include <string.h>
2053 
2054 /* BytesEquals.proto */
2055 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2056 
2057 /* UnicodeEquals.proto */
2058 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2059 
2060 /* StrEquals.proto */
2061 #if PY_MAJOR_VERSION >= 3
2062 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2063 #else
2064 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2065 #endif
2066 
2067 /* UnaryNegOverflows.proto */
2068 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2069  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2070 
2071 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2072 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2073 /* GetAttr.proto */
2074 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2075 
2076 /* decode_c_string_utf16.proto */
2077 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2078  int byteorder = 0;
2079  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2080 }
2081 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2082  int byteorder = -1;
2083  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2084 }
2085 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2086  int byteorder = 1;
2087  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2088 }
2089 
2090 /* decode_c_string.proto */
2091 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2092  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2093  const char* encoding, const char* errors,
2094  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2095 
2096 /* GetAttr3.proto */
2097 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2098 
2099 /* RaiseTooManyValuesToUnpack.proto */
2100 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2101 
2102 /* RaiseNeedMoreValuesToUnpack.proto */
2103 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2104 
2105 /* RaiseNoneIterError.proto */
2106 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2107 
2108 /* ExtTypeTest.proto */
2109 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2110 
2111 /* SwapException.proto */
2112 #if CYTHON_FAST_THREAD_STATE
2113 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2114 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2115 #else
2116 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2117 #endif
2118 
2119 /* Import.proto */
2120 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2121 
2122 /* FastTypeChecks.proto */
2123 #if CYTHON_COMPILING_IN_CPYTHON
2124 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2125 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2126 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2127 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2128 #else
2129 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2130 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2131 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2132 #endif
2133 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2134 
2135 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2136 /* ListExtend.proto */
2137 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2138 #if CYTHON_COMPILING_IN_CPYTHON
2139  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2140  if (unlikely(!none))
2141  return -1;
2142  Py_DECREF(none);
2143  return 0;
2144 #else
2145  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2146 #endif
2147 }
2148 
2149 /* ListAppend.proto */
2150 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2151 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2152  PyListObject* L = (PyListObject*) list;
2153  Py_ssize_t len = Py_SIZE(list);
2154  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2155  Py_INCREF(x);
2156  PyList_SET_ITEM(list, len, x);
2157  __Pyx_SET_SIZE(list, len + 1);
2158  return 0;
2159  }
2160  return PyList_Append(list, x);
2161 }
2162 #else
2163 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2164 #endif
2165 
2166 /* PySequenceContains.proto */
2167 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2168  int result = PySequence_Contains(seq, item);
2169  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2170 }
2171 
2172 /* ImportFrom.proto */
2173 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2174 
2175 /* HasAttr.proto */
2176 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2177 
2178 /* StringJoin.proto */
2179 #if PY_MAJOR_VERSION < 3
2180 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
2181 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
2182 #else
2183 #define __Pyx_PyString_Join PyUnicode_Join
2184 #define __Pyx_PyBaseString_Join PyUnicode_Join
2185 #endif
2186 #if CYTHON_COMPILING_IN_CPYTHON
2187  #if PY_MAJOR_VERSION < 3
2188  #define __Pyx_PyBytes_Join _PyString_Join
2189  #else
2190  #define __Pyx_PyBytes_Join _PyBytes_Join
2191  #endif
2192 #else
2193 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2194 #endif
2195 
2196 /* PyObject_Unicode.proto */
2197 #if PY_MAJOR_VERSION >= 3
2198 #define __Pyx_PyObject_Unicode(obj)\
2199  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2200 #else
2201 #define __Pyx_PyObject_Unicode(obj)\
2202  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2203 #endif
2204 
2205 /* PyObject_GenericGetAttrNoDict.proto */
2206 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2207 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2208 #else
2209 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2210 #endif
2211 
2212 /* PyObject_GenericGetAttr.proto */
2213 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2214 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2215 #else
2216 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2217 #endif
2218 
2219 /* SetVTable.proto */
2220 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2221 
2222 /* PyObjectGetAttrStrNoError.proto */
2223 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2224 
2225 /* SetupReduce.proto */
2226 static int __Pyx_setup_reduce(PyObject* type_obj);
2227 
2228 /* TypeImport.proto */
2229 #ifndef __PYX_HAVE_RT_ImportType_proto
2230 #define __PYX_HAVE_RT_ImportType_proto
2231 enum __Pyx_ImportType_CheckSize {
2232  __Pyx_ImportType_CheckSize_Error = 0,
2233  __Pyx_ImportType_CheckSize_Warn = 1,
2234  __Pyx_ImportType_CheckSize_Ignore = 2
2235 };
2236 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2237 #endif
2238 
2239 /* CLineInTraceback.proto */
2240 #ifdef CYTHON_CLINE_IN_TRACEBACK
2241 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2242 #else
2243 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2244 #endif
2245 
2246 /* CodeObjectCache.proto */
2247 typedef struct {
2248  PyCodeObject* code_object;
2249  int code_line;
2250 } __Pyx_CodeObjectCacheEntry;
2251 struct __Pyx_CodeObjectCache {
2252  int count;
2253  int max_count;
2254  __Pyx_CodeObjectCacheEntry* entries;
2255 };
2256 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2257 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2258 static PyCodeObject *__pyx_find_code_object(int code_line);
2259 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2260 
2261 /* AddTraceback.proto */
2262 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2263  int py_line, const char *filename);
2264 
2265 #if PY_MAJOR_VERSION < 3
2266  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2267  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2268 #else
2269  #define __Pyx_GetBuffer PyObject_GetBuffer
2270  #define __Pyx_ReleaseBuffer PyBuffer_Release
2271 #endif
2272 
2273 
2274 /* BufferStructDeclare.proto */
2275 typedef struct {
2276  Py_ssize_t shape, strides, suboffsets;
2277 } __Pyx_Buf_DimInfo;
2278 typedef struct {
2279  size_t refcount;
2280  Py_buffer pybuffer;
2281 } __Pyx_Buffer;
2282 typedef struct {
2283  __Pyx_Buffer *rcbuffer;
2284  char *data;
2285  __Pyx_Buf_DimInfo diminfo[8];
2286 } __Pyx_LocalBuf_ND;
2287 
2288 /* MemviewSliceIsContig.proto */
2289 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2290 
2291 /* OverlappingSlices.proto */
2292 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2293  __Pyx_memviewslice *slice2,
2294  int ndim, size_t itemsize);
2295 
2296 /* Capsule.proto */
2297 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2298 
2299 /* IsLittleEndian.proto */
2300 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2301 
2302 /* BufferFormatCheck.proto */
2303 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2304 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2305  __Pyx_BufFmt_StackElem* stack,
2306  __Pyx_TypeInfo* type);
2307 
2308 /* TypeInfoCompare.proto */
2309 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2310 
2311 /* MemviewSliceValidateAndInit.proto */
2312 static int __Pyx_ValidateAndInit_memviewslice(
2313  int *axes_specs,
2314  int c_or_f_flag,
2315  int buf_flags,
2316  int ndim,
2317  __Pyx_TypeInfo *dtype,
2318  __Pyx_BufFmt_StackElem stack[],
2319  __Pyx_memviewslice *memviewslice,
2320  PyObject *original_obj);
2321 
2322 /* ObjectToMemviewSlice.proto */
2323 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2324 
2325 /* ObjectToMemviewSlice.proto */
2326 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2327 
2328 /* GCCDiagnostics.proto */
2329 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2330 #define __Pyx_HAS_GCC_DIAGNOSTIC
2331 #endif
2332 
2333 /* ObjectToMemviewSlice.proto */
2334 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(PyObject *, int writable_flag);
2335 
2336 /* ObjectToMemviewSlice.proto */
2337 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *, int writable_flag);
2338 
2339 /* MemviewDtypeToObject.proto */
2340 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
2341 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
2342 
2343 /* ObjectToMemviewSlice.proto */
2344 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *, int writable_flag);
2345 
2346 /* Print.proto */
2347 static int __Pyx_Print(PyObject*, PyObject *, int);
2348 #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
2349 static PyObject* __pyx_print = 0;
2350 static PyObject* __pyx_print_kwargs = 0;
2351 #endif
2352 
2353 /* MemviewDtypeToObject.proto */
2354 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp);
2355 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj);
2356 
2357 /* RealImag.proto */
2358 #if CYTHON_CCOMPLEX
2359  #ifdef __cplusplus
2360  #define __Pyx_CREAL(z) ((z).real())
2361  #define __Pyx_CIMAG(z) ((z).imag())
2362  #else
2363  #define __Pyx_CREAL(z) (__real__(z))
2364  #define __Pyx_CIMAG(z) (__imag__(z))
2365  #endif
2366 #else
2367  #define __Pyx_CREAL(z) ((z).real)
2368  #define __Pyx_CIMAG(z) ((z).imag)
2369 #endif
2370 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2371  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2372  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2373  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2374 #else
2375  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2376  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2377 #endif
2378 
2379 /* Arithmetic.proto */
2380 #if CYTHON_CCOMPLEX
2381  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2382  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2383  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2384  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2385  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2386  #define __Pyx_c_neg_float(a) (-(a))
2387  #ifdef __cplusplus
2388  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2389  #define __Pyx_c_conj_float(z) (::std::conj(z))
2390  #if 1
2391  #define __Pyx_c_abs_float(z) (::std::abs(z))
2392  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2393  #endif
2394  #else
2395  #define __Pyx_c_is_zero_float(z) ((z)==0)
2396  #define __Pyx_c_conj_float(z) (conjf(z))
2397  #if 1
2398  #define __Pyx_c_abs_float(z) (cabsf(z))
2399  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2400  #endif
2401  #endif
2402 #else
2403  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2404  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2405  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2406  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2407  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2408  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2409  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2410  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2411  #if 1
2412  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2413  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2414  #endif
2415 #endif
2416 
2417 /* Arithmetic.proto */
2418 #if CYTHON_CCOMPLEX
2419  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2420  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2421  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2422  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2423  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2424  #define __Pyx_c_neg_double(a) (-(a))
2425  #ifdef __cplusplus
2426  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2427  #define __Pyx_c_conj_double(z) (::std::conj(z))
2428  #if 1
2429  #define __Pyx_c_abs_double(z) (::std::abs(z))
2430  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2431  #endif
2432  #else
2433  #define __Pyx_c_is_zero_double(z) ((z)==0)
2434  #define __Pyx_c_conj_double(z) (conj(z))
2435  #if 1
2436  #define __Pyx_c_abs_double(z) (cabs(z))
2437  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2438  #endif
2439  #endif
2440 #else
2441  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2442  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2443  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2444  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2445  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2446  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2447  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2448  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2449  #if 1
2450  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2451  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2452  #endif
2453 #endif
2454 
2455 /* MemviewSliceCopyTemplate.proto */
2456 static __Pyx_memviewslice
2457 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2458  const char *mode, int ndim,
2459  size_t sizeof_dtype, int contig_flag,
2460  int dtype_is_object);
2461 
2462 /* CIntFromPy.proto */
2463 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2464 
2465 /* CIntToPy.proto */
2466 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2467 
2468 /* CIntToPy.proto */
2469 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2470 
2471 /* TypeInfoToFormat.proto */
2472 struct __pyx_typeinfo_string {
2473  char string[3];
2474 };
2475 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2476 
2477 /* PrintOne.proto */
2478 static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
2479 
2480 /* CIntFromPy.proto */
2481 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2482 
2483 /* CIntFromPy.proto */
2484 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2485 
2486 /* FetchCommonType.proto */
2487 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2488 
2489 /* PyObjectGetMethod.proto */
2490 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2491 
2492 /* PyObjectCallMethod1.proto */
2493 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
2494 
2495 /* CoroutineBase.proto */
2496 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
2497 #if CYTHON_USE_EXC_INFO_STACK
2498 #define __Pyx_ExcInfoStruct _PyErr_StackItem
2499 #else
2500 typedef struct {
2501  PyObject *exc_type;
2502  PyObject *exc_value;
2503  PyObject *exc_traceback;
2504 } __Pyx_ExcInfoStruct;
2505 #endif
2506 typedef struct {
2507  PyObject_HEAD
2508  __pyx_coroutine_body_t body;
2509  PyObject *closure;
2510  __Pyx_ExcInfoStruct gi_exc_state;
2511  PyObject *gi_weakreflist;
2512  PyObject *classobj;
2513  PyObject *yieldfrom;
2514  PyObject *gi_name;
2515  PyObject *gi_qualname;
2516  PyObject *gi_modulename;
2517  PyObject *gi_code;
2518  PyObject *gi_frame;
2519  int resume_label;
2520  char is_running;
2521 } __pyx_CoroutineObject;
2522 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
2523  PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2524  PyObject *name, PyObject *qualname, PyObject *module_name);
2525 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
2526  __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2527  PyObject *name, PyObject *qualname, PyObject *module_name);
2528 static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
2529 static int __Pyx_Coroutine_clear(PyObject *self);
2530 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
2531 static PyObject *__Pyx_Coroutine_Close(PyObject *self);
2532 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
2533 #if CYTHON_USE_EXC_INFO_STACK
2534 #define __Pyx_Coroutine_SwapException(self)
2535 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
2536 #else
2537 #define __Pyx_Coroutine_SwapException(self) {\
2538  __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
2539  __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
2540  }
2541 #define __Pyx_Coroutine_ResetAndClearException(self) {\
2542  __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
2543  (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
2544  }
2545 #endif
2546 #if CYTHON_FAST_THREAD_STATE
2547 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2548  __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
2549 #else
2550 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2551  __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
2552 #endif
2553 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
2554 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
2555 
2556 /* PatchModuleWithCoroutine.proto */
2557 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
2558 
2559 /* PatchGeneratorABC.proto */
2560 static int __Pyx_patch_abc(void);
2561 
2562 /* Generator.proto */
2563 #define __Pyx_Generator_USED
2564 static PyTypeObject *__pyx_GeneratorType = 0;
2565 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
2566 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
2567  __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
2568 static PyObject *__Pyx_Generator_Next(PyObject *self);
2569 static int __pyx_Generator_init(void);
2570 
2571 /* CheckBinaryVersion.proto */
2572 static int __Pyx_check_binary_version(void);
2573 
2574 /* FunctionImport.proto */
2575 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
2576 
2577 /* InitStrings.proto */
2578 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2579 
2580 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPreStep(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, __Pyx_memviewslice __pyx_v_q_uOfX, __Pyx_memviewslice __pyx_v_q_J, __Pyx_memviewslice __pyx_v_q_weights, __Pyx_memviewslice __pyx_v_areas_, __Pyx_memviewslice __pyx_v_q_rci, __Pyx_memviewslice __pyx_v_q_fci, int __pyx_v_nElements_owned); /* proto*/
2581 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPostStep(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self); /* proto*/
2582 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPseudoTimeSteppingParallel(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, __Pyx_memviewslice __pyx_v_xx, double __pyx_v_eps); /* proto*/
2583 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2584 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2585 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2586 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2587 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*/
2588 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2589 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2590 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2591 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2592 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2593 
2594 /* Module declarations from 'cython.view' */
2595 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2596 
2597 /* Module declarations from 'cython' */
2598 
2599 /* Module declarations from 'cpython.buffer' */
2600 
2601 /* Module declarations from 'libc.string' */
2602 
2603 /* Module declarations from 'libc.stdio' */
2604 
2605 /* Module declarations from '__builtin__' */
2606 
2607 /* Module declarations from 'cpython.type' */
2608 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2609 
2610 /* Module declarations from 'cpython' */
2611 
2612 /* Module declarations from 'cpython.object' */
2613 
2614 /* Module declarations from 'cpython.ref' */
2615 
2616 /* Module declarations from 'cpython.mem' */
2617 
2618 /* Module declarations from 'numpy' */
2619 
2620 /* Module declarations from 'numpy' */
2621 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2622 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2623 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2624 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2625 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2626 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2627 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2628 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2629 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2630 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2631 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2632 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2633 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2634 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2635 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2636 
2637 /* Module declarations from 'libcpp' */
2638 
2639 /* Module declarations from 'proteus.mprans' */
2640 
2641 /* Module declarations from 'proteus.mprans.MeshSmoothing' */
2642 static int (*__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestNode)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2643 static __Pyx_memviewslice (*__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestElementIntersection)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2644 static int (*__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestElementAroundNode)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2645 static void (*__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTetra)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2646 static void (*__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTriangle)(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2647 static __Pyx_memviewslice (*__pyx_f_7proteus_6mprans_13MeshSmoothing_cyCheckOwnedVariable)(int, int, int, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2648 static __Pyx_memviewslice (*__pyx_f_7proteus_6mprans_13MeshSmoothing_cyGetGlobalVariable)(int, int, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2649 static int (*__pyx_f_7proteus_6mprans_13MeshSmoothing_cyGetLocalVariable)(int, int, int, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2650 static void (*__pyx_f_7proteus_6mprans_13MeshSmoothing_cyFindBoundaryDirectionTriangle)(__Pyx_memviewslice, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2651 
2652 /* Module declarations from 'mprans.cMoveMeshMonitor' */
2653 static PyTypeObject *__pyx_ptype_6mprans_16cMoveMeshMonitor_cCoefficients = 0;
2654 static PyTypeObject *__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel = 0;
2655 static PyTypeObject *__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr = 0;
2656 static PyTypeObject *__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr = 0;
2657 static PyTypeObject *__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr = 0;
2658 static PyTypeObject *__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr = 0;
2659 static PyTypeObject *__pyx_array_type = 0;
2660 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2661 static PyTypeObject *__pyx_memoryview_type = 0;
2662 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2663 static PyObject *generic = 0;
2664 static PyObject *strided = 0;
2665 static PyObject *indirect = 0;
2666 static PyObject *contiguous = 0;
2667 static PyObject *indirect_contiguous = 0;
2668 static int __pyx_memoryview_thread_locks_used;
2669 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2670 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppRecoveryAtNodes(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2671 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppRecoveryAtNodesWeighted(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2672 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppGradientRecoveryAtNodes(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2673 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppGradientRecoveryAtNodesWeighted(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2674 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_checkOwnedVariable(int, int, int, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2675 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_findN(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, int, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __Pyx_memviewslice, __Pyx_memviewslice, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
2676 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2677 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2678 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2679 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2680 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2681 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2682 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2683 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*/
2684 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2685 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2686 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2687 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2688 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2689 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2690 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2691 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2692 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2693 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2694 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2695 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2696 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2697 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2698 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2699 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2700 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2701 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2702 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2703 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2704 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2705 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2706 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2707 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2708 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2709 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
2710 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2711 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2712 #define __Pyx_MODULE_NAME "mprans.cMoveMeshMonitor"
2713 extern int __pyx_module_is_main_mprans__cMoveMeshMonitor;
2714 int __pyx_module_is_main_mprans__cMoveMeshMonitor = 0;
2715 
2716 /* Implementation of 'mprans.cMoveMeshMonitor' */
2717 static PyObject *__pyx_builtin_xrange;
2718 static PyObject *__pyx_builtin_range;
2719 static PyObject *__pyx_builtin_AssertionError;
2720 static PyObject *__pyx_builtin_TypeError;
2721 static PyObject *__pyx_builtin_ImportError;
2722 static PyObject *__pyx_builtin_ValueError;
2723 static PyObject *__pyx_builtin_MemoryError;
2724 static PyObject *__pyx_builtin_enumerate;
2725 static PyObject *__pyx_builtin_Ellipsis;
2726 static PyObject *__pyx_builtin_id;
2727 static PyObject *__pyx_builtin_IndexError;
2728 static const char __pyx_k_C[] = "C";
2729 static const char __pyx_k_O[] = "O";
2730 static const char __pyx_k_T[] = "T{";
2731  static const char __pyx_k_c[] = "c";
2732  static const char __pyx_k_f[] = "f";
2733  static const char __pyx_k_q[] = "q";
2734  static const char __pyx_k_r[] = "r";
2735  static const char __pyx_k_s[] = "(%s)";
2736  static const char __pyx_k_t[] = "t";
2737  static const char __pyx_k_u[] = "u";
2738  static const char __pyx_k_x[] = "x";
2739  static const char __pyx_k_id[] = "id";
2740  static const char __pyx_k_ms[] = "ms";
2741  static const char __pyx_k_nd[] = "nd";
2742  static const char __pyx_k_np[] = "np";
2743  static const char __pyx_k_op[] = "op";
2744  static const char __pyx_k_xx[] = "xx";
2745  static const char __pyx_k_INT[] = "INT";
2746  static const char __pyx_k_MPI[] = "MPI";
2747  static const char __pyx_k_SUM[] = "SUM";
2748  static const char __pyx_k__31[] = "^";
2749  static const char __pyx_k__32[] = "";
2750  static const char __pyx_k__33[] = ":";
2751 static const char __pyx_k__34[] = "}";
2752 static const char __pyx_k__35[] = ",";
2753 static const char __pyx_k_dot[] = "dot: ";
2754 static const char __pyx_k_end[] = "end";
2755 static const char __pyx_k_eps[] = "eps";
2756 static const char __pyx_k_get[] = "get";
2757 static const char __pyx_k_new[] = "__new__";
2758 static const char __pyx_k_obj[] = "obj";
2759 static const char __pyx_k_Comm[] = "Comm";
2760 static const char __pyx_k_args[] = "args";
2761 static const char __pyx_k_axis[] = "axis";
2762 static const char __pyx_k_base[] = "base";
2763 static const char __pyx_k_comm[] = "comm";
2764 static const char __pyx_k_dict[] = "__dict__";
2765 static const char __pyx_k_file[] = "file";
2766 static const char __pyx_k_join[] = "join";
2767 static const char __pyx_k_main[] = "__main__";
2768 static const char __pyx_k_mesh[] = "mesh";
2769 static const char __pyx_k_mode[] = "mode";
2770 static const char __pyx_k_name[] = "name";
2771 static const char __pyx_k_ndim[] = "ndim";
2772 static const char __pyx_k_ones[] = "ones";
2773 static const char __pyx_k_pack[] = "pack";
2774 static const char __pyx_k_rank[] = "rank";
2775 static const char __pyx_k_root[] = "root";
2776 static const char __pyx_k_send[] = "send";
2777 static const char __pyx_k_size[] = "size";
2778 static const char __pyx_k_step[] = "step";
2779 static const char __pyx_k_stop[] = "stop";
2780 static const char __pyx_k_test[] = "__test__";
2781 static const char __pyx_k_ASCII[] = "ASCII";
2782 static const char __pyx_k_Abort[] = "Abort";
2783 static const char __pyx_k_Error[] = "Error: ";
2784 static const char __pyx_k_alpha[] = "alpha";
2785 static const char __pyx_k_areas[] = "areas";
2786 static const char __pyx_k_array[] = "array";
2787 static const char __pyx_k_class[] = "__class__";
2788 static const char __pyx_k_close[] = "close";
2789 static const char __pyx_k_dtype[] = "dtype";
2790 static const char __pyx_k_error[] = "error";
2791 static const char __pyx_k_flags[] = "flags";
2792 static const char __pyx_k_grads[] = "grads";
2793 static const char __pyx_k_int32[] = "int32";
2794 static const char __pyx_k_level[] = "level";
2795 static const char __pyx_k_model[] = "model";
2796 static const char __pyx_k_numpy[] = "numpy";
2797 static const char __pyx_k_print[] = "print";
2798 static const char __pyx_k_range[] = "range";
2799 static const char __pyx_k_shape[] = "shape";
2800 static const char __pyx_k_start[] = "start";
2801 static const char __pyx_k_t_max[] = "t_max";
2802 static const char __pyx_k_t_min[] = "t_min";
2803 static const char __pyx_k_throw[] = "throw";
2804 static const char __pyx_k_u_phi[] = "u_phi";
2805 static const char __pyx_k_zeros[] = "zeros";
2806 static const char __pyx_k_Commit[] = "Commit";
2807 static const char __pyx_k_DOUBLE[] = "DOUBLE";
2808 static const char __pyx_k_append[] = "append";
2809 static const char __pyx_k_encode[] = "encode";
2810 static const char __pyx_k_format[] = "format";
2811 static const char __pyx_k_import[] = "__import__";
2812 static const char __pyx_k_ls_phi[] = "ls_phi";
2813 static const char __pyx_k_mpi4py[] = "mpi4py";
2814 static const char __pyx_k_nNodes[] = "nNodes";
2815 static const char __pyx_k_name_2[] = "__name__";
2816 static const char __pyx_k_pickle[] = "pickle";
2817 static const char __pyx_k_reduce[] = "__reduce__";
2818 static const char __pyx_k_struct[] = "struct";
2819 static const char __pyx_k_unpack[] = "unpack";
2820 static const char __pyx_k_update[] = "update";
2821 static const char __pyx_k_xrange[] = "xrange";
2822 static const char __pyx_k_Gatherv[] = "Gatherv";
2823 static const char __pyx_k_barrier[] = "barrier";
2824 static const char __pyx_k_fortran[] = "fortran";
2825 static const char __pyx_k_genexpr[] = "genexpr";
2826 static const char __pyx_k_memview[] = "memview";
2827 static const char __pyx_k_proteus[] = "proteus";
2828 static const char __pyx_k_scalars[] = "scalars";
2829 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2830 static const char __pyx_k_femSpace[] = "femSpace";
2831 static const char __pyx_k_getstate[] = "__getstate__";
2832 static const char __pyx_k_itemsize[] = "itemsize";
2833 static const char __pyx_k_linspace[] = "linspace";
2834 static const char __pyx_k_logEvent[] = "logEvent";
2835 static const char __pyx_k_ntimes_i[] = "ntimes_i";
2836 static const char __pyx_k_pyx_type[] = "__pyx_type";
2837 static const char __pyx_k_setstate[] = "__setstate__";
2838 static const char __pyx_k_tompi4py[] = "tompi4py";
2839 static const char __pyx_k_TypeError[] = "TypeError";
2840 static const char __pyx_k_abs_det_J[] = "abs(det(J))";
2841 static const char __pyx_k_allreduce[] = "allreduce";
2842 static const char __pyx_k_enumerate[] = "enumerate";
2843 static const char __pyx_k_fixed_dir[] = "fixed_dir: ";
2844 static const char __pyx_k_nSmoothIn[] = "nSmoothIn";
2845 static const char __pyx_k_nodeArray[] = "nodeArray";
2846 static const char __pyx_k_pyx_state[] = "__pyx_state";
2847 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2848 static const char __pyx_k_Allgatherv[] = "Allgatherv";
2849 static const char __pyx_k_IndexError[] = "IndexError";
2850 static const char __pyx_k_ValueError[] = "ValueError";
2851 static const char __pyx_k_detJ_array[] = "detJ_array";
2852 static const char __pyx_k_globalMesh[] = "globalMesh";
2853 static const char __pyx_k_nSmoothOut[] = "nSmoothOut";
2854 static const char __pyx_k_pyx_result[] = "__pyx_result";
2855 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2856 static const char __pyx_k_ImportError[] = "ImportError";
2857 static const char __pyx_k_MemoryError[] = "MemoryError";
2858 static const char __pyx_k_PickleError[] = "PickleError";
2859 static const char __pyx_k_areas_nodes[] = "areas_nodes";
2860 static const char __pyx_k_elementMaps[] = "elementMaps";
2861 static const char __pyx_k_nodeArray_2[] = "nodeArray_";
2862 static const char __pyx_k_node_number[] = "node number";
2863 static const char __pyx_k_element_node[] = "element node: ";
2864 static const char __pyx_k_getAreaValue[] = "getAreaValue";
2865 static const char __pyx_k_nNodes_owned[] = "nNodes_owned";
2866 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2867 static const char __pyx_k_simultaneous[] = "simultaneous";
2868 static const char __pyx_k_stringsource[] = "stringsource";
2869 static const char __pyx_k_MeshSmoothing[] = "MeshSmoothing";
2870 static const char __pyx_k_cCoefficients[] = "cCoefficients";
2871 static const char __pyx_k_nNodes_global[] = "nNodes_global";
2872 static const char __pyx_k_nodeStarArray[] = "nodeStarArray";
2873 static const char __pyx_k_ntimes_solved[] = "ntimes_solved";
2874 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2875 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2876 static const char __pyx_k_AssertionError[] = "AssertionError";
2877 static const char __pyx_k_Done_smoothing[] = "Done smoothing";
2878 static const char __pyx_k_evaluateFunAtX[] = "evaluateFunAtX";
2879 static const char __pyx_k_nNodes_element[] = "nNodes_element";
2880 static const char __pyx_k_proteus_mprans[] = "proteus.mprans";
2881 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2882 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2883 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2884 static const char __pyx_k_getInverseValue[] = "getInverseValue";
2885 static const char __pyx_k_nElements_owned[] = "nElements_owned";
2886 static const char __pyx_k_nodeStarOffsets[] = "nodeStarOffsets";
2887 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2888 static const char __pyx_k_recoveryAtNodes[] = "recoveryAtNodes";
2889 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2890 static const char __pyx_k_getGradientValue[] = "getGradientValue";
2891 static const char __pyx_k_getLevelSetValue[] = "getLevelSetValue";
2892 static const char __pyx_k_nElements_global[] = "nElements_global";
2893 static const char __pyx_k_nVariables_owned[] = "nVariables_owned";
2894 static const char __pyx_k_nearestN_element[] = "nearestN (element): ";
2895 static const char __pyx_k_smoothBoundaries[] = "smoothBoundaries";
2896 static const char __pyx_k_type_should_be_1[] = "type (should be 1): ";
2897 static const char __pyx_k_Create_contiguous[] = "Create_contiguous";
2898 static const char __pyx_k_elementNodesArray[] = "elementNodesArray";
2899 static const char __pyx_k_nodeElementsArray[] = "nodeElementsArray";
2900 static const char __pyx_k_nodeMaterialTypes[] = "nodeMaterialTypes";
2901 static const char __pyx_k_node_materialType[] = "node materialType: ";
2902 static const char __pyx_k_proteus_Profiling[] = "proteus.Profiling";
2903 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2904 static const char __pyx_k_uOfXTatQuadrature[] = "uOfXTatQuadrature";
2905 static const char __pyx_k_variable_nb_local[] = "variable_nb_local";
2906 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2907 static const char __pyx_k_element_barycenter[] = "element barycenter: ";
2908 static const char __pyx_k_nodeElementOffsets[] = "nodeElementOffsets";
2909 static const char __pyx_k_smoothNodesLaplace[] = "smoothNodesLaplace";
2910 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2911 static const char __pyx_k_fixedNodesBoolArray[] = "fixedNodesBoolArray";
2912 static const char __pyx_k_node_new_coordinates[] = "node new coordinates: ";
2913 static const char __pyx_k_node_old_coordinates[] = "node old coordinates: ";
2914 static const char __pyx_k_pyCheckOwnedVariable[] = "pyCheckOwnedVariable";
2915 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2916 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2917 static const char __pyx_k_elementNeighborsArray[] = "elementNeighborsArray";
2918 static const char __pyx_k_getNonOwnedNodeValues[] = "getNonOwnedNodeValues";
2919 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2920 static const char __pyx_k_elementBoundariesArray[] = "elementBoundariesArray";
2921 static const char __pyx_k_nNodes_elementBoundary[] = "nNodes_elementBoundary";
2922 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2923 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2924 static const char __pyx_k_elementBarycentersArray[] = "elementBarycentersArray";
2925 static const char __pyx_k_gradientRecoveryAtNodes[] = "gradientRecoveryAtNodes";
2926 static const char __pyx_k_mprans_cMoveMeshMonitor[] = "mprans.cMoveMeshMonitor";
2927 static const char __pyx_k_recoveryAtNodesWeighted[] = "recoveryAtNodesWeighted";
2928 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2929 static const char __pyx_k_Done_pseudo_timestepping[] = "Done pseudo-timestepping";
2930 static const char __pyx_k_Pseudo_time_stepping_t_t[] = "Pseudo-time stepping t={t}";
2931 static const char __pyx_k_elementQuadratureWeights[] = "elementQuadratureWeights";
2932 static const char __pyx_k_nElementBoundaries_owned[] = "nElementBoundaries_owned";
2933 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2934 static const char __pyx_k_elementBoundaryNodesArray[] = "elementBoundaryNodesArray";
2935 static const char __pyx_k_nElementBoundaries_global[] = "nElementBoundaries_global";
2936 static const char __pyx_k_elementBoundaryNormalsArray[] = "elementBoundaryNormalsArray";
2937 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2938 static const char __pyx_k_nodeOffsets_subdomain_owned[] = "nodeOffsets_subdomain_owned";
2939 static const char __pyx_k_elementBoundaryElementsArray[] = "elementBoundaryElementsArray";
2940 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2941 static const char __pyx_k_elementOffsets_subdomain_owned[] = "elementOffsets_subdomain_owned";
2942 static const char __pyx_k_exteriorElementBoundariesArray[] = "exteriorElementBoundariesArray";
2943 static const char __pyx_k_nodeNumbering_subdomain2global[] = "nodeNumbering_subdomain2global";
2944 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2945 static const char __pyx_k_b_i_and_nearestN_cannot_be_both[] = "b_i and nearestN cannot be both -1";
2946 static const char __pyx_k_did_not_find_containing_element[] = "did not find containing element! coords outside domain?";
2947 static const char __pyx_k_elementBoundaryBarycentersArray[] = "elementBoundaryBarycentersArray";
2948 static const char __pyx_k_gradientRecoveryAtNodesWeighted[] = "gradientRecoveryAtNodesWeighted";
2949 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2950 static const char __pyx_k_proteus_mprans_cMoveMeshMonitor[] = "proteus/mprans/cMoveMeshMonitor.pyx";
2951 static const char __pyx_k_variableOffsets_subdomain_owned[] = "variableOffsets_subdomain_owned";
2952 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2953 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2954 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2955 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2956 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2957 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2958 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2959 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2960 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2961 static const char __pyx_k_Pseudo_time_stepping_with_dt_eps[] = "Pseudo-time stepping with dt={eps} ({t_min}<t<{t_max})";
2962 static const char __pyx_k_Smoothing_Mesh_with_Laplace_Smoo[] = "Smoothing Mesh with Laplace Smoothing - ";
2963 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2964 static const char __pyx_k_cCoefficients_cppPseudoTimeStepp[] = "cCoefficients.cppPseudoTimeSteppingParallel.<locals>.genexpr";
2965 static const char __pyx_k_elementBoundaryNumbering_subdoma[] = "elementBoundaryNumbering_subdomain2global";
2966 static const char __pyx_k_elementBoundaryOffsets_subdomain[] = "elementBoundaryOffsets_subdomain_owned";
2967 static const char __pyx_k_elementNumbering_subdomain2globa[] = "elementNumbering_subdomain2global";
2968 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2969 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2970 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2971 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2972 static const char __pyx_k_variableNumbering_subdomain2glob[] = "variableNumbering_subdomain2global";
2973 static const char __pyx_k_did_not_find_containing_element_2[] = "did not find containing element! coords outside domain\077\077";
2974 static PyObject *__pyx_n_s_ASCII;
2975 static PyObject *__pyx_n_s_Abort;
2976 static PyObject *__pyx_n_s_Allgatherv;
2977 static PyObject *__pyx_n_s_AssertionError;
2978 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2979 static PyObject *__pyx_n_s_C;
2980 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2981 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2982 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2983 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2984 static PyObject *__pyx_n_s_Comm;
2985 static PyObject *__pyx_n_s_Commit;
2986 static PyObject *__pyx_n_s_Create_contiguous;
2987 static PyObject *__pyx_n_s_DOUBLE;
2988 static PyObject *__pyx_kp_s_Done_pseudo_timestepping;
2989 static PyObject *__pyx_kp_s_Done_smoothing;
2990 static PyObject *__pyx_n_s_Ellipsis;
2991 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2992 static PyObject *__pyx_kp_s_Error;
2993 static PyObject *__pyx_n_s_Gatherv;
2994 static PyObject *__pyx_n_s_INT;
2995 static PyObject *__pyx_n_s_ImportError;
2996 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2997 static PyObject *__pyx_n_s_IndexError;
2998 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2999 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
3000 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
3001 static PyObject *__pyx_n_s_MPI;
3002 static PyObject *__pyx_n_s_MemoryError;
3003 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
3004 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
3005 static PyObject *__pyx_n_s_MeshSmoothing;
3006 static PyObject *__pyx_n_b_O;
3007 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
3008 static PyObject *__pyx_n_s_PickleError;
3009 static PyObject *__pyx_kp_s_Pseudo_time_stepping_t_t;
3010 static PyObject *__pyx_kp_s_Pseudo_time_stepping_with_dt_eps;
3011 static PyObject *__pyx_n_s_SUM;
3012 static PyObject *__pyx_kp_s_Smoothing_Mesh_with_Laplace_Smoo;
3013 static PyObject *__pyx_kp_b_T;
3014 static PyObject *__pyx_n_s_TypeError;
3015 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
3016 static PyObject *__pyx_n_s_ValueError;
3017 static PyObject *__pyx_n_s_View_MemoryView;
3018 static PyObject *__pyx_kp_b__31;
3019 static PyObject *__pyx_kp_b__32;
3020 static PyObject *__pyx_kp_b__33;
3021 static PyObject *__pyx_kp_b__34;
3022 static PyObject *__pyx_kp_u__35;
3023 static PyObject *__pyx_kp_s_abs_det_J;
3024 static PyObject *__pyx_n_s_allocate_buffer;
3025 static PyObject *__pyx_n_s_allreduce;
3026 static PyObject *__pyx_n_s_alpha;
3027 static PyObject *__pyx_n_s_append;
3028 static PyObject *__pyx_n_s_areas;
3029 static PyObject *__pyx_n_s_areas_nodes;
3030 static PyObject *__pyx_n_s_args;
3031 static PyObject *__pyx_n_s_array;
3032 static PyObject *__pyx_n_s_axis;
3033 static PyObject *__pyx_kp_s_b_i_and_nearestN_cannot_be_both;
3034 static PyObject *__pyx_n_s_barrier;
3035 static PyObject *__pyx_n_s_base;
3036 static PyObject *__pyx_n_s_c;
3037 static PyObject *__pyx_n_u_c;
3038 static PyObject *__pyx_n_s_cCoefficients;
3039 static PyObject *__pyx_n_s_cCoefficients_cppPseudoTimeStepp;
3040 static PyObject *__pyx_n_s_class;
3041 static PyObject *__pyx_n_s_cline_in_traceback;
3042 static PyObject *__pyx_n_s_close;
3043 static PyObject *__pyx_n_s_comm;
3044 static PyObject *__pyx_kp_s_contiguous_and_direct;
3045 static PyObject *__pyx_kp_s_contiguous_and_indirect;
3046 static PyObject *__pyx_n_s_detJ_array;
3047 static PyObject *__pyx_n_s_dict;
3048 static PyObject *__pyx_kp_s_did_not_find_containing_element;
3049 static PyObject *__pyx_kp_s_did_not_find_containing_element_2;
3050 static PyObject *__pyx_kp_s_dot;
3051 static PyObject *__pyx_n_s_dtype;
3052 static PyObject *__pyx_n_s_dtype_is_object;
3053 static PyObject *__pyx_n_s_elementBarycentersArray;
3054 static PyObject *__pyx_n_s_elementBoundariesArray;
3055 static PyObject *__pyx_n_s_elementBoundaryBarycentersArray;
3056 static PyObject *__pyx_n_s_elementBoundaryElementsArray;
3057 static PyObject *__pyx_n_s_elementBoundaryNodesArray;
3058 static PyObject *__pyx_n_s_elementBoundaryNormalsArray;
3059 static PyObject *__pyx_n_s_elementBoundaryNumbering_subdoma;
3060 static PyObject *__pyx_n_s_elementBoundaryOffsets_subdomain;
3061 static PyObject *__pyx_n_s_elementMaps;
3062 static PyObject *__pyx_n_s_elementNeighborsArray;
3063 static PyObject *__pyx_n_s_elementNodesArray;
3064 static PyObject *__pyx_n_s_elementNumbering_subdomain2globa;
3065 static PyObject *__pyx_n_s_elementOffsets_subdomain_owned;
3066 static PyObject *__pyx_n_s_elementQuadratureWeights;
3067 static PyObject *__pyx_kp_s_element_barycenter;
3068 static PyObject *__pyx_kp_s_element_node;
3069 static PyObject *__pyx_n_s_encode;
3070 static PyObject *__pyx_n_s_end;
3071 static PyObject *__pyx_n_s_enumerate;
3072 static PyObject *__pyx_n_s_eps;
3073 static PyObject *__pyx_n_s_error;
3074 static PyObject *__pyx_n_s_evaluateFunAtX;
3075 static PyObject *__pyx_n_s_exteriorElementBoundariesArray;
3076 static PyObject *__pyx_n_s_f;
3077 static PyObject *__pyx_n_s_femSpace;
3078 static PyObject *__pyx_n_s_file;
3079 static PyObject *__pyx_n_s_fixedNodesBoolArray;
3080 static PyObject *__pyx_kp_s_fixed_dir;
3081 static PyObject *__pyx_n_s_flags;
3082 static PyObject *__pyx_n_s_format;
3083 static PyObject *__pyx_n_s_fortran;
3084 static PyObject *__pyx_n_u_fortran;
3085 static PyObject *__pyx_n_s_genexpr;
3086 static PyObject *__pyx_n_s_get;
3087 static PyObject *__pyx_n_s_getAreaValue;
3088 static PyObject *__pyx_n_s_getGradientValue;
3089 static PyObject *__pyx_n_s_getInverseValue;
3090 static PyObject *__pyx_n_s_getLevelSetValue;
3091 static PyObject *__pyx_n_s_getNonOwnedNodeValues;
3092 static PyObject *__pyx_n_s_getstate;
3093 static PyObject *__pyx_n_s_globalMesh;
3094 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
3095 static PyObject *__pyx_n_s_gradientRecoveryAtNodes;
3096 static PyObject *__pyx_n_s_gradientRecoveryAtNodesWeighted;
3097 static PyObject *__pyx_n_s_grads;
3098 static PyObject *__pyx_n_s_id;
3099 static PyObject *__pyx_n_s_import;
3100 static PyObject *__pyx_n_s_int32;
3101 static PyObject *__pyx_n_s_itemsize;
3102 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
3103 static PyObject *__pyx_n_s_join;
3104 static PyObject *__pyx_n_s_level;
3105 static PyObject *__pyx_n_s_linspace;
3106 static PyObject *__pyx_n_s_logEvent;
3107 static PyObject *__pyx_n_s_ls_phi;
3108 static PyObject *__pyx_n_s_main;
3109 static PyObject *__pyx_n_s_memview;
3110 static PyObject *__pyx_n_s_mesh;
3111 static PyObject *__pyx_n_s_mode;
3112 static PyObject *__pyx_n_s_model;
3113 static PyObject *__pyx_n_s_mpi4py;
3114 static PyObject *__pyx_n_s_mprans_cMoveMeshMonitor;
3115 static PyObject *__pyx_n_s_ms;
3116 static PyObject *__pyx_n_s_nElementBoundaries_global;
3117 static PyObject *__pyx_n_s_nElementBoundaries_owned;
3118 static PyObject *__pyx_n_s_nElements_global;
3119 static PyObject *__pyx_n_s_nElements_owned;
3120 static PyObject *__pyx_n_s_nNodes;
3121 static PyObject *__pyx_n_s_nNodes_element;
3122 static PyObject *__pyx_n_s_nNodes_elementBoundary;
3123 static PyObject *__pyx_n_s_nNodes_global;
3124 static PyObject *__pyx_n_s_nNodes_owned;
3125 static PyObject *__pyx_n_s_nSmoothIn;
3126 static PyObject *__pyx_n_s_nSmoothOut;
3127 static PyObject *__pyx_n_s_nVariables_owned;
3128 static PyObject *__pyx_n_s_name;
3129 static PyObject *__pyx_n_s_name_2;
3130 static PyObject *__pyx_n_s_nd;
3131 static PyObject *__pyx_n_s_ndim;
3132 static PyObject *__pyx_kp_s_nearestN_element;
3133 static PyObject *__pyx_n_s_new;
3134 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
3135 static PyObject *__pyx_n_s_nodeArray;
3136 static PyObject *__pyx_n_s_nodeArray_2;
3137 static PyObject *__pyx_n_s_nodeElementOffsets;
3138 static PyObject *__pyx_n_s_nodeElementsArray;
3139 static PyObject *__pyx_n_s_nodeMaterialTypes;
3140 static PyObject *__pyx_n_s_nodeNumbering_subdomain2global;
3141 static PyObject *__pyx_n_s_nodeOffsets_subdomain_owned;
3142 static PyObject *__pyx_n_s_nodeStarArray;
3143 static PyObject *__pyx_n_s_nodeStarOffsets;
3144 static PyObject *__pyx_kp_s_node_materialType;
3145 static PyObject *__pyx_kp_s_node_new_coordinates;
3146 static PyObject *__pyx_kp_s_node_number;
3147 static PyObject *__pyx_kp_s_node_old_coordinates;
3148 static PyObject *__pyx_n_s_np;
3149 static PyObject *__pyx_n_s_ntimes_i;
3150 static PyObject *__pyx_n_s_ntimes_solved;
3151 static PyObject *__pyx_n_s_numpy;
3152 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
3153 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
3154 static PyObject *__pyx_n_s_obj;
3155 static PyObject *__pyx_n_s_ones;
3156 static PyObject *__pyx_n_s_op;
3157 static PyObject *__pyx_n_s_pack;
3158 static PyObject *__pyx_n_s_pickle;
3159 static PyObject *__pyx_n_s_print;
3160 static PyObject *__pyx_n_s_proteus;
3161 static PyObject *__pyx_n_s_proteus_Profiling;
3162 static PyObject *__pyx_n_s_proteus_mprans;
3163 static PyObject *__pyx_kp_s_proteus_mprans_cMoveMeshMonitor;
3164 static PyObject *__pyx_n_s_pyCheckOwnedVariable;
3165 static PyObject *__pyx_n_s_pyx_PickleError;
3166 static PyObject *__pyx_n_s_pyx_checksum;
3167 static PyObject *__pyx_n_s_pyx_getbuffer;
3168 static PyObject *__pyx_n_s_pyx_result;
3169 static PyObject *__pyx_n_s_pyx_state;
3170 static PyObject *__pyx_n_s_pyx_type;
3171 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
3172 static PyObject *__pyx_n_s_pyx_vtable;
3173 static PyObject *__pyx_n_s_q;
3174 static PyObject *__pyx_n_s_r;
3175 static PyObject *__pyx_n_s_range;
3176 static PyObject *__pyx_n_s_rank;
3177 static PyObject *__pyx_n_s_recoveryAtNodes;
3178 static PyObject *__pyx_n_s_recoveryAtNodesWeighted;
3179 static PyObject *__pyx_n_s_reduce;
3180 static PyObject *__pyx_n_s_reduce_cython;
3181 static PyObject *__pyx_n_s_reduce_ex;
3182 static PyObject *__pyx_n_s_root;
3183 static PyObject *__pyx_kp_u_s;
3184 static PyObject *__pyx_n_s_scalars;
3185 static PyObject *__pyx_n_s_send;
3186 static PyObject *__pyx_n_s_setstate;
3187 static PyObject *__pyx_n_s_setstate_cython;
3188 static PyObject *__pyx_n_s_shape;
3189 static PyObject *__pyx_n_s_simultaneous;
3190 static PyObject *__pyx_n_s_size;
3191 static PyObject *__pyx_n_s_smoothBoundaries;
3192 static PyObject *__pyx_n_s_smoothNodesLaplace;
3193 static PyObject *__pyx_n_s_start;
3194 static PyObject *__pyx_n_s_step;
3195 static PyObject *__pyx_n_s_stop;
3196 static PyObject *__pyx_kp_s_strided_and_direct;
3197 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3198 static PyObject *__pyx_kp_s_strided_and_indirect;
3199 static PyObject *__pyx_kp_s_stringsource;
3200 static PyObject *__pyx_n_s_struct;
3201 static PyObject *__pyx_n_s_t;
3202 static PyObject *__pyx_n_s_t_max;
3203 static PyObject *__pyx_n_s_t_min;
3204 static PyObject *__pyx_n_s_test;
3205 static PyObject *__pyx_n_s_throw;
3206 static PyObject *__pyx_n_s_tompi4py;
3207 static PyObject *__pyx_kp_s_type_should_be_1;
3208 static PyObject *__pyx_n_s_u;
3209 static PyObject *__pyx_n_s_uOfXTatQuadrature;
3210 static PyObject *__pyx_n_s_u_phi;
3211 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3212 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3213 static PyObject *__pyx_n_s_unpack;
3214 static PyObject *__pyx_n_s_update;
3215 static PyObject *__pyx_n_s_variableNumbering_subdomain2glob;
3216 static PyObject *__pyx_n_s_variableOffsets_subdomain_owned;
3217 static PyObject *__pyx_n_s_variable_nb_local;
3218 static PyObject *__pyx_n_s_x;
3219 static PyObject *__pyx_n_s_xrange;
3220 static PyObject *__pyx_n_s_xx;
3221 static PyObject *__pyx_n_s_zeros;
3222 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients___cinit__(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self); /* proto */
3223 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_2attachPyCoefficients(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_pyCoefficients); /* proto */
3224 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_4preStep(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self); /* proto */
3225 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_6postStep(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self); /* proto */
3226 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_8pseudoTimeStepping(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_xx, PyObject *__pyx_v_eps); /* proto */
3227 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_genexpr(PyObject *__pyx_self); /* proto */
3228 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_3genexpr(PyObject *__pyx_self); /* proto */
3229 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_6genexpr(PyObject *__pyx_self); /* proto */
3230 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_9genexpr(PyObject *__pyx_self); /* proto */
3231 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients___get__(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self); /* proto */
3232 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_2__set__(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3233 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_4__del__(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self); /* proto */
3234 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_1C___get__(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self); /* proto */
3235 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_2__set__(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3236 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self); /* proto */
3237 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3238 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_recoveryAtNodes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_scalars, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets); /* proto */
3239 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_2recoveryAtNodesWeighted(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 */
3240 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_4gradientRecoveryAtNodes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_grads, PyObject *__pyx_v_nodeElementsArray, PyObject *__pyx_v_nodeElementOffsets, PyObject *__pyx_v_nd); /* proto */
3241 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_6gradientRecoveryAtNodesWeighted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_grads, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_detJ_array, int __pyx_v_nd); /* proto */
3242 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_8pyCheckOwnedVariable(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 */
3243 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 */
3244 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 */
3245 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3246 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3247 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3248 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3249 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3250 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 */
3251 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3252 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 */
3253 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3254 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3255 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3256 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3257 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 */
3258 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3259 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3260 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 */
3261 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 */
3262 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3263 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3264 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3265 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3266 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3267 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3268 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3269 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3270 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3271 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3272 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3273 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3274 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3275 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3276 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3277 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3278 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3279 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 */
3280 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3281 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3282 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3283 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 */
3284 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 */
3285 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor_cCoefficients(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3286 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3287 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3288 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3289 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3290 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3291 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3292 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3293 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3294 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3295 static PyObject *__pyx_float_0_;
3296 static PyObject *__pyx_float_1_;
3297 static PyObject *__pyx_int_0;
3298 static PyObject *__pyx_int_1;
3299 static PyObject *__pyx_int_3;
3300 static PyObject *__pyx_int_15;
3301 static PyObject *__pyx_int_112105877;
3302 static PyObject *__pyx_int_136983863;
3303 static PyObject *__pyx_int_184977713;
3304 static PyObject *__pyx_int_neg_1;
3305 static PyObject *__pyx_tuple_;
3306 static PyObject *__pyx_slice__4;
3307 static PyObject *__pyx_tuple__2;
3308 static PyObject *__pyx_tuple__3;
3309 static PyObject *__pyx_tuple__5;
3310 static PyObject *__pyx_tuple__6;
3311 static PyObject *__pyx_tuple__7;
3312 static PyObject *__pyx_tuple__8;
3313 static PyObject *__pyx_tuple__9;
3314 static PyObject *__pyx_slice__26;
3315 static PyObject *__pyx_tuple__10;
3316 static PyObject *__pyx_tuple__11;
3317 static PyObject *__pyx_tuple__12;
3318 static PyObject *__pyx_tuple__13;
3319 static PyObject *__pyx_tuple__14;
3320 static PyObject *__pyx_tuple__15;
3321 static PyObject *__pyx_tuple__16;
3322 static PyObject *__pyx_tuple__17;
3323 static PyObject *__pyx_tuple__18;
3324 static PyObject *__pyx_tuple__19;
3325 static PyObject *__pyx_tuple__20;
3326 static PyObject *__pyx_tuple__21;
3327 static PyObject *__pyx_tuple__22;
3328 static PyObject *__pyx_tuple__23;
3329 static PyObject *__pyx_tuple__24;
3330 static PyObject *__pyx_tuple__25;
3331 static PyObject *__pyx_tuple__27;
3332 static PyObject *__pyx_tuple__28;
3333 static PyObject *__pyx_tuple__29;
3334 static PyObject *__pyx_tuple__30;
3335 static PyObject *__pyx_tuple__36;
3336 static PyObject *__pyx_tuple__38;
3337 static PyObject *__pyx_tuple__40;
3338 static PyObject *__pyx_tuple__42;
3339 static PyObject *__pyx_tuple__44;
3340 static PyObject *__pyx_tuple__46;
3341 static PyObject *__pyx_tuple__47;
3342 static PyObject *__pyx_tuple__48;
3343 static PyObject *__pyx_tuple__49;
3344 static PyObject *__pyx_tuple__50;
3345 static PyObject *__pyx_tuple__51;
3346 static PyObject *__pyx_codeobj__37;
3347 static PyObject *__pyx_codeobj__39;
3348 static PyObject *__pyx_codeobj__41;
3349 static PyObject *__pyx_codeobj__43;
3350 static PyObject *__pyx_codeobj__45;
3351 static PyObject *__pyx_codeobj__52;
3352 /* Late includes */
3353 
3354 /* "mprans/cMoveMeshMonitor.pyx":20
3355  * double C
3356  *
3357  * def __cinit__(self): # <<<<<<<<<<<<<<
3358  * self.C = 1.
3359  *
3360  */
3361 
3362 /* Python wrapper */
3363 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3364 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3365  int __pyx_r;
3366  __Pyx_RefNannyDeclarations
3367  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3368  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
3369  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
3370  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
3371  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients___cinit__(((struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
3372 
3373  /* function exit code */
3374  __Pyx_RefNannyFinishContext();
3375  return __pyx_r;
3376 }
3377 
3378 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients___cinit__(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
3379  int __pyx_r;
3380  __Pyx_RefNannyDeclarations
3381  __Pyx_RefNannySetupContext("__cinit__", 0);
3382 
3383  /* "mprans/cMoveMeshMonitor.pyx":21
3384  *
3385  * def __cinit__(self):
3386  * self.C = 1. # <<<<<<<<<<<<<<
3387  *
3388  * def attachPyCoefficients(self,
3389  */
3390  __pyx_v_self->C = 1.;
3391 
3392  /* "mprans/cMoveMeshMonitor.pyx":20
3393  * double C
3394  *
3395  * def __cinit__(self): # <<<<<<<<<<<<<<
3396  * self.C = 1.
3397  *
3398  */
3399 
3400  /* function exit code */
3401  __pyx_r = 0;
3402  __Pyx_RefNannyFinishContext();
3403  return __pyx_r;
3404 }
3405 
3406 /* "mprans/cMoveMeshMonitor.pyx":23
3407  * self.C = 1.
3408  *
3409  * def attachPyCoefficients(self, # <<<<<<<<<<<<<<
3410  * object pyCoefficients):
3411  * self.pyCoefficients = pyCoefficients
3412  */
3413 
3414 /* Python wrapper */
3415 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_3attachPyCoefficients(PyObject *__pyx_v_self, PyObject *__pyx_v_pyCoefficients); /*proto*/
3416 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_3attachPyCoefficients(PyObject *__pyx_v_self, PyObject *__pyx_v_pyCoefficients) {
3417  PyObject *__pyx_r = 0;
3418  __Pyx_RefNannyDeclarations
3419  __Pyx_RefNannySetupContext("attachPyCoefficients (wrapper)", 0);
3420  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_2attachPyCoefficients(((struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self), ((PyObject *)__pyx_v_pyCoefficients));
3421 
3422  /* function exit code */
3423  __Pyx_RefNannyFinishContext();
3424  return __pyx_r;
3425 }
3426 
3427 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_2attachPyCoefficients(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_pyCoefficients) {
3428  PyObject *__pyx_r = NULL;
3429  __Pyx_RefNannyDeclarations
3430  __Pyx_RefNannySetupContext("attachPyCoefficients", 0);
3431 
3432  /* "mprans/cMoveMeshMonitor.pyx":25
3433  * def attachPyCoefficients(self,
3434  * object pyCoefficients):
3435  * self.pyCoefficients = pyCoefficients # <<<<<<<<<<<<<<
3436  *
3437  * def preStep(self):
3438  */
3439  __Pyx_INCREF(__pyx_v_pyCoefficients);
3440  __Pyx_GIVEREF(__pyx_v_pyCoefficients);
3441  __Pyx_GOTREF(__pyx_v_self->pyCoefficients);
3442  __Pyx_DECREF(__pyx_v_self->pyCoefficients);
3443  __pyx_v_self->pyCoefficients = __pyx_v_pyCoefficients;
3444 
3445  /* "mprans/cMoveMeshMonitor.pyx":23
3446  * self.C = 1.
3447  *
3448  * def attachPyCoefficients(self, # <<<<<<<<<<<<<<
3449  * object pyCoefficients):
3450  * self.pyCoefficients = pyCoefficients
3451  */
3452 
3453  /* function exit code */
3454  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3455  __Pyx_XGIVEREF(__pyx_r);
3456  __Pyx_RefNannyFinishContext();
3457  return __pyx_r;
3458 }
3459 
3460 /* "mprans/cMoveMeshMonitor.pyx":27
3461  * self.pyCoefficients = pyCoefficients
3462  *
3463  * def preStep(self): # <<<<<<<<<<<<<<
3464  * pc = self.pyCoefficients
3465  * self.cppPreStep(q_uOfX=pc.uOfXTatQuadrature,
3466  */
3467 
3468 /* Python wrapper */
3469 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_5preStep(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3470 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_5preStep(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3471  PyObject *__pyx_r = 0;
3472  __Pyx_RefNannyDeclarations
3473  __Pyx_RefNannySetupContext("preStep (wrapper)", 0);
3474  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_4preStep(((struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
3475 
3476  /* function exit code */
3477  __Pyx_RefNannyFinishContext();
3478  return __pyx_r;
3479 }
3480 
3481 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_4preStep(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
3482  PyObject *__pyx_v_pc = NULL;
3483  PyObject *__pyx_r = NULL;
3484  __Pyx_RefNannyDeclarations
3485  PyObject *__pyx_t_1 = NULL;
3486  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
3487  PyObject *__pyx_t_3 = NULL;
3488  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
3489  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
3490  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
3491  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
3492  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
3493  int __pyx_t_9;
3494  int __pyx_lineno = 0;
3495  const char *__pyx_filename = NULL;
3496  int __pyx_clineno = 0;
3497  __Pyx_RefNannySetupContext("preStep", 0);
3498 
3499  /* "mprans/cMoveMeshMonitor.pyx":28
3500  *
3501  * def preStep(self):
3502  * pc = self.pyCoefficients # <<<<<<<<<<<<<<
3503  * self.cppPreStep(q_uOfX=pc.uOfXTatQuadrature,
3504  * q_J=pc.model.q['abs(det(J))'],
3505  */
3506  __pyx_t_1 = __pyx_v_self->pyCoefficients;
3507  __Pyx_INCREF(__pyx_t_1);
3508  __pyx_v_pc = __pyx_t_1;
3509  __pyx_t_1 = 0;
3510 
3511  /* "mprans/cMoveMeshMonitor.pyx":29
3512  * def preStep(self):
3513  * pc = self.pyCoefficients
3514  * self.cppPreStep(q_uOfX=pc.uOfXTatQuadrature, # <<<<<<<<<<<<<<
3515  * q_J=pc.model.q['abs(det(J))'],
3516  * q_weights=pc.model.elementQuadratureWeights[('u', 0)],
3517  */
3518  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_uOfXTatQuadrature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
3519  __Pyx_GOTREF(__pyx_t_1);
3520  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 29, __pyx_L1_error)
3521  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3522 
3523  /* "mprans/cMoveMeshMonitor.pyx":30
3524  * pc = self.pyCoefficients
3525  * self.cppPreStep(q_uOfX=pc.uOfXTatQuadrature,
3526  * q_J=pc.model.q['abs(det(J))'], # <<<<<<<<<<<<<<
3527  * q_weights=pc.model.elementQuadratureWeights[('u', 0)],
3528  * areas_=pc.areas,
3529  */
3530  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_model); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
3531  __Pyx_GOTREF(__pyx_t_1);
3532  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
3533  __Pyx_GOTREF(__pyx_t_3);
3534  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3535  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_kp_s_abs_det_J); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
3536  __Pyx_GOTREF(__pyx_t_1);
3537  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3538  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 30, __pyx_L1_error)
3539  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3540 
3541  /* "mprans/cMoveMeshMonitor.pyx":31
3542  * self.cppPreStep(q_uOfX=pc.uOfXTatQuadrature,
3543  * q_J=pc.model.q['abs(det(J))'],
3544  * q_weights=pc.model.elementQuadratureWeights[('u', 0)], # <<<<<<<<<<<<<<
3545  * areas_=pc.areas,
3546  * q_rci=pc.model.q[('r', 0)],
3547  */
3548  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_model); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
3549  __Pyx_GOTREF(__pyx_t_1);
3550  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_elementQuadratureWeights); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
3551  __Pyx_GOTREF(__pyx_t_3);
3552  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3553  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_tuple_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
3554  __Pyx_GOTREF(__pyx_t_1);
3555  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3556  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 31, __pyx_L1_error)
3557  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3558 
3559  /* "mprans/cMoveMeshMonitor.pyx":32
3560  * q_J=pc.model.q['abs(det(J))'],
3561  * q_weights=pc.model.elementQuadratureWeights[('u', 0)],
3562  * areas_=pc.areas, # <<<<<<<<<<<<<<
3563  * q_rci=pc.model.q[('r', 0)],
3564  * q_fci=pc.model.q[('f', 0)],
3565  */
3566  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_areas); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
3567  __Pyx_GOTREF(__pyx_t_1);
3568  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 32, __pyx_L1_error)
3569  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3570 
3571  /* "mprans/cMoveMeshMonitor.pyx":33
3572  * q_weights=pc.model.elementQuadratureWeights[('u', 0)],
3573  * areas_=pc.areas,
3574  * q_rci=pc.model.q[('r', 0)], # <<<<<<<<<<<<<<
3575  * q_fci=pc.model.q[('f', 0)],
3576  * nElements_owned=pc.mesh.nElements_owned)
3577  */
3578  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_model); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
3579  __Pyx_GOTREF(__pyx_t_1);
3580  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
3581  __Pyx_GOTREF(__pyx_t_3);
3582  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3583  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_tuple__2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
3584  __Pyx_GOTREF(__pyx_t_1);
3585  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3586  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 33, __pyx_L1_error)
3587  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3588 
3589  /* "mprans/cMoveMeshMonitor.pyx":34
3590  * areas_=pc.areas,
3591  * q_rci=pc.model.q[('r', 0)],
3592  * q_fci=pc.model.q[('f', 0)], # <<<<<<<<<<<<<<
3593  * nElements_owned=pc.mesh.nElements_owned)
3594  *
3595  */
3596  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_model); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
3597  __Pyx_GOTREF(__pyx_t_1);
3598  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_q); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error)
3599  __Pyx_GOTREF(__pyx_t_3);
3600  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3601  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_tuple__3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
3602  __Pyx_GOTREF(__pyx_t_1);
3603  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3604  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 34, __pyx_L1_error)
3605  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3606 
3607  /* "mprans/cMoveMeshMonitor.pyx":35
3608  * q_rci=pc.model.q[('r', 0)],
3609  * q_fci=pc.model.q[('f', 0)],
3610  * nElements_owned=pc.mesh.nElements_owned) # <<<<<<<<<<<<<<
3611  *
3612  * cdef cppPreStep(self,
3613  */
3614  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
3615  __Pyx_GOTREF(__pyx_t_1);
3616  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nElements_owned); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
3617  __Pyx_GOTREF(__pyx_t_3);
3618  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3619  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
3620  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3621 
3622  /* "mprans/cMoveMeshMonitor.pyx":29
3623  * def preStep(self):
3624  * pc = self.pyCoefficients
3625  * self.cppPreStep(q_uOfX=pc.uOfXTatQuadrature, # <<<<<<<<<<<<<<
3626  * q_J=pc.model.q['abs(det(J))'],
3627  * q_weights=pc.model.elementQuadratureWeights[('u', 0)],
3628  */
3629  __pyx_t_3 = ((struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self->__pyx_vtab)->cppPreStep(__pyx_v_self, __pyx_t_2, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
3630  __Pyx_GOTREF(__pyx_t_3);
3631  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3632  __pyx_t_2.memview = NULL;
3633  __pyx_t_2.data = NULL;
3634  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3635  __pyx_t_4.memview = NULL;
3636  __pyx_t_4.data = NULL;
3637  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
3638  __pyx_t_5.memview = NULL;
3639  __pyx_t_5.data = NULL;
3640  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3641  __pyx_t_6.memview = NULL;
3642  __pyx_t_6.data = NULL;
3643  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
3644  __pyx_t_7.memview = NULL;
3645  __pyx_t_7.data = NULL;
3646  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
3647  __pyx_t_8.memview = NULL;
3648  __pyx_t_8.data = NULL;
3649  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3650 
3651  /* "mprans/cMoveMeshMonitor.pyx":27
3652  * self.pyCoefficients = pyCoefficients
3653  *
3654  * def preStep(self): # <<<<<<<<<<<<<<
3655  * pc = self.pyCoefficients
3656  * self.cppPreStep(q_uOfX=pc.uOfXTatQuadrature,
3657  */
3658 
3659  /* function exit code */
3660  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3661  goto __pyx_L0;
3662  __pyx_L1_error:;
3663  __Pyx_XDECREF(__pyx_t_1);
3664  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3665  __Pyx_XDECREF(__pyx_t_3);
3666  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3667  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
3668  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3669  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
3670  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
3671  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.preStep", __pyx_clineno, __pyx_lineno, __pyx_filename);
3672  __pyx_r = NULL;
3673  __pyx_L0:;
3674  __Pyx_XDECREF(__pyx_v_pc);
3675  __Pyx_XGIVEREF(__pyx_r);
3676  __Pyx_RefNannyFinishContext();
3677  return __pyx_r;
3678 }
3679 
3680 /* "mprans/cMoveMeshMonitor.pyx":37
3681  * nElements_owned=pc.mesh.nElements_owned)
3682  *
3683  * cdef cppPreStep(self, # <<<<<<<<<<<<<<
3684  * double[:,:] q_uOfX,
3685  * double[:,:] q_J,
3686  */
3687 
3688 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPreStep(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, __Pyx_memviewslice __pyx_v_q_uOfX, __Pyx_memviewslice __pyx_v_q_J, __Pyx_memviewslice __pyx_v_q_weights, __Pyx_memviewslice __pyx_v_areas_, __Pyx_memviewslice __pyx_v_q_rci, __Pyx_memviewslice __pyx_v_q_fci, int __pyx_v_nElements_owned) {
3689  double __pyx_v_integral_1_over_f;
3690  CYTHON_UNUSED int __pyx_v_N_eN;
3691  int __pyx_v_nE;
3692  double __pyx_v_area;
3693  int __pyx_v_nJ;
3694  int __pyx_v_nk;
3695  int __pyx_v_eN;
3696  int __pyx_v_k;
3697  PyObject *__pyx_v_comm = NULL;
3698  double __pyx_v_C;
3699  int __pyx_v_nrci;
3700  PyObject *__pyx_v_pc = 0;
3701  PyObject *__pyx_v_mesh = 0;
3702  int __pyx_v_nd;
3703  __Pyx_memviewslice __pyx_v_elementBoundaryBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3704  __Pyx_memviewslice __pyx_v_elementBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3705  __Pyx_memviewslice __pyx_v_nodeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3706  __Pyx_memviewslice __pyx_v_elementBoundaryNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3707  __Pyx_memviewslice __pyx_v_elementNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3708  __Pyx_memviewslice __pyx_v_elementBoundariesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3709  int __pyx_v_nElementBoundaries_global;
3710  int __pyx_v_nNodes_elementBoundary;
3711  int __pyx_v_nElements_global;
3712  int __pyx_v_nNodes_element;
3713  __Pyx_memviewslice __pyx_v_elementBoundaryNormalsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
3714  int __pyx_v_ebN;
3715  int __pyx_v_nN;
3716  PyObject *__pyx_r = NULL;
3717  __Pyx_RefNannyDeclarations
3718  size_t __pyx_t_1;
3719  int __pyx_t_2;
3720  int __pyx_t_3;
3721  int __pyx_t_4;
3722  int __pyx_t_5;
3723  int __pyx_t_6;
3724  int __pyx_t_7;
3725  Py_ssize_t __pyx_t_8;
3726  Py_ssize_t __pyx_t_9;
3727  Py_ssize_t __pyx_t_10;
3728  int __pyx_t_11;
3729  Py_ssize_t __pyx_t_12;
3730  Py_ssize_t __pyx_t_13;
3731  PyObject *__pyx_t_14 = NULL;
3732  PyObject *__pyx_t_15 = NULL;
3733  PyObject *__pyx_t_16 = NULL;
3734  PyObject *__pyx_t_17 = NULL;
3735  PyObject *__pyx_t_18 = NULL;
3736  double __pyx_t_19;
3737  __Pyx_memviewslice __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } };
3738  __Pyx_memviewslice __pyx_t_21 = { 0, 0, { 0 }, { 0 }, { 0 } };
3739  __Pyx_memviewslice __pyx_t_22 = { 0, 0, { 0 }, { 0 }, { 0 } };
3740  __Pyx_memviewslice __pyx_t_23 = { 0, 0, { 0 }, { 0 }, { 0 } };
3741  Py_ssize_t __pyx_t_24;
3742  int __pyx_lineno = 0;
3743  const char *__pyx_filename = NULL;
3744  int __pyx_clineno = 0;
3745  __Pyx_RefNannySetupContext("cppPreStep", 0);
3746 
3747  /* "mprans/cMoveMeshMonitor.pyx":45
3748  * double[:, :, :] q_fci,
3749  * int nElements_owned):
3750  * cdef double integral_1_over_f = 0. # <<<<<<<<<<<<<<
3751  * cdef int N_eN = q_J.shape[0]
3752  * cdef int nE = 0
3753  */
3754  __pyx_v_integral_1_over_f = 0.;
3755 
3756  /* "mprans/cMoveMeshMonitor.pyx":46
3757  * int nElements_owned):
3758  * cdef double integral_1_over_f = 0.
3759  * cdef int N_eN = q_J.shape[0] # <<<<<<<<<<<<<<
3760  * cdef int nE = 0
3761  * cdef double area = 0
3762  */
3763  __pyx_v_N_eN = (__pyx_v_q_J.shape[0]);
3764 
3765  /* "mprans/cMoveMeshMonitor.pyx":47
3766  * cdef double integral_1_over_f = 0.
3767  * cdef int N_eN = q_J.shape[0]
3768  * cdef int nE = 0 # <<<<<<<<<<<<<<
3769  * cdef double area = 0
3770  * cdef int nJ = len(q_J)
3771  */
3772  __pyx_v_nE = 0;
3773 
3774  /* "mprans/cMoveMeshMonitor.pyx":48
3775  * cdef int N_eN = q_J.shape[0]
3776  * cdef int nE = 0
3777  * cdef double area = 0 # <<<<<<<<<<<<<<
3778  * cdef int nJ = len(q_J)
3779  * cdef int nk = len(q_weights)
3780  */
3781  __pyx_v_area = 0.0;
3782 
3783  /* "mprans/cMoveMeshMonitor.pyx":49
3784  * cdef int nE = 0
3785  * cdef double area = 0
3786  * cdef int nJ = len(q_J) # <<<<<<<<<<<<<<
3787  * cdef int nk = len(q_weights)
3788  * for eN in xrange(nJ):
3789  */
3790  __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_q_J);
3791  __pyx_v_nJ = __pyx_t_1;
3792 
3793  /* "mprans/cMoveMeshMonitor.pyx":50
3794  * cdef double area = 0
3795  * cdef int nJ = len(q_J)
3796  * cdef int nk = len(q_weights) # <<<<<<<<<<<<<<
3797  * for eN in xrange(nJ):
3798  * area = 0
3799  */
3800  __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_q_weights);
3801  __pyx_v_nk = __pyx_t_1;
3802 
3803  /* "mprans/cMoveMeshMonitor.pyx":51
3804  * cdef int nJ = len(q_J)
3805  * cdef int nk = len(q_weights)
3806  * for eN in xrange(nJ): # <<<<<<<<<<<<<<
3807  * area = 0
3808  * for k in xrange(nk):
3809  */
3810  __pyx_t_2 = __pyx_v_nJ;
3811  __pyx_t_3 = __pyx_t_2;
3812  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
3813  __pyx_v_eN = __pyx_t_4;
3814 
3815  /* "mprans/cMoveMeshMonitor.pyx":52
3816  * cdef int nk = len(q_weights)
3817  * for eN in xrange(nJ):
3818  * area = 0 # <<<<<<<<<<<<<<
3819  * for k in xrange(nk):
3820  * area += q_J[eN, k]*q_weights[k]
3821  */
3822  __pyx_v_area = 0.0;
3823 
3824  /* "mprans/cMoveMeshMonitor.pyx":53
3825  * for eN in xrange(nJ):
3826  * area = 0
3827  * for k in xrange(nk): # <<<<<<<<<<<<<<
3828  * area += q_J[eN, k]*q_weights[k]
3829  * if eN < nElements_owned:
3830  */
3831  __pyx_t_5 = __pyx_v_nk;
3832  __pyx_t_6 = __pyx_t_5;
3833  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
3834  __pyx_v_k = __pyx_t_7;
3835 
3836  /* "mprans/cMoveMeshMonitor.pyx":54
3837  * area = 0
3838  * for k in xrange(nk):
3839  * area += q_J[eN, k]*q_weights[k] # <<<<<<<<<<<<<<
3840  * if eN < nElements_owned:
3841  * integral_1_over_f += q_J[eN, k]*q_weights[k]/q_uOfX[eN, k]
3842  */
3843  __pyx_t_8 = __pyx_v_eN;
3844  __pyx_t_9 = __pyx_v_k;
3845  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_q_J.shape[0];
3846  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_q_J.shape[1];
3847  __pyx_t_10 = __pyx_v_k;
3848  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_q_weights.shape[0];
3849  __pyx_v_area = (__pyx_v_area + ((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_q_J.data + __pyx_t_8 * __pyx_v_q_J.strides[0]) ) + __pyx_t_9 * __pyx_v_q_J.strides[1]) ))) * (*((double *) ( /* dim=0 */ (__pyx_v_q_weights.data + __pyx_t_10 * __pyx_v_q_weights.strides[0]) )))));
3850 
3851  /* "mprans/cMoveMeshMonitor.pyx":55
3852  * for k in xrange(nk):
3853  * area += q_J[eN, k]*q_weights[k]
3854  * if eN < nElements_owned: # <<<<<<<<<<<<<<
3855  * integral_1_over_f += q_J[eN, k]*q_weights[k]/q_uOfX[eN, k]
3856  * areas_[eN] = area
3857  */
3858  __pyx_t_11 = ((__pyx_v_eN < __pyx_v_nElements_owned) != 0);
3859  if (__pyx_t_11) {
3860 
3861  /* "mprans/cMoveMeshMonitor.pyx":56
3862  * area += q_J[eN, k]*q_weights[k]
3863  * if eN < nElements_owned:
3864  * integral_1_over_f += q_J[eN, k]*q_weights[k]/q_uOfX[eN, k] # <<<<<<<<<<<<<<
3865  * areas_[eN] = area
3866  * if eN < nElements_owned:
3867  */
3868  __pyx_t_10 = __pyx_v_eN;
3869  __pyx_t_9 = __pyx_v_k;
3870  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_q_J.shape[0];
3871  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_q_J.shape[1];
3872  __pyx_t_8 = __pyx_v_k;
3873  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_q_weights.shape[0];
3874  __pyx_t_12 = __pyx_v_eN;
3875  __pyx_t_13 = __pyx_v_k;
3876  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_q_uOfX.shape[0];
3877  if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_q_uOfX.shape[1];
3878  __pyx_v_integral_1_over_f = (__pyx_v_integral_1_over_f + (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_q_J.data + __pyx_t_10 * __pyx_v_q_J.strides[0]) ) + __pyx_t_9 * __pyx_v_q_J.strides[1]) ))) * (*((double *) ( /* dim=0 */ (__pyx_v_q_weights.data + __pyx_t_8 * __pyx_v_q_weights.strides[0]) )))) / (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_q_uOfX.data + __pyx_t_12 * __pyx_v_q_uOfX.strides[0]) ) + __pyx_t_13 * __pyx_v_q_uOfX.strides[1]) )))));
3879 
3880  /* "mprans/cMoveMeshMonitor.pyx":55
3881  * for k in xrange(nk):
3882  * area += q_J[eN, k]*q_weights[k]
3883  * if eN < nElements_owned: # <<<<<<<<<<<<<<
3884  * integral_1_over_f += q_J[eN, k]*q_weights[k]/q_uOfX[eN, k]
3885  * areas_[eN] = area
3886  */
3887  }
3888  }
3889 
3890  /* "mprans/cMoveMeshMonitor.pyx":57
3891  * if eN < nElements_owned:
3892  * integral_1_over_f += q_J[eN, k]*q_weights[k]/q_uOfX[eN, k]
3893  * areas_[eN] = area # <<<<<<<<<<<<<<
3894  * if eN < nElements_owned:
3895  * nE += 1
3896  */
3897  __pyx_t_13 = __pyx_v_eN;
3898  if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_areas_.shape[0];
3899  *((double *) ( /* dim=0 */ (__pyx_v_areas_.data + __pyx_t_13 * __pyx_v_areas_.strides[0]) )) = __pyx_v_area;
3900 
3901  /* "mprans/cMoveMeshMonitor.pyx":58
3902  * integral_1_over_f += q_J[eN, k]*q_weights[k]/q_uOfX[eN, k]
3903  * areas_[eN] = area
3904  * if eN < nElements_owned: # <<<<<<<<<<<<<<
3905  * nE += 1
3906  * comm = Comm.get().comm.tompi4py()
3907  */
3908  __pyx_t_11 = ((__pyx_v_eN < __pyx_v_nElements_owned) != 0);
3909  if (__pyx_t_11) {
3910 
3911  /* "mprans/cMoveMeshMonitor.pyx":59
3912  * areas_[eN] = area
3913  * if eN < nElements_owned:
3914  * nE += 1 # <<<<<<<<<<<<<<
3915  * comm = Comm.get().comm.tompi4py()
3916  * if comm.size > 1:
3917  */
3918  __pyx_v_nE = (__pyx_v_nE + 1);
3919 
3920  /* "mprans/cMoveMeshMonitor.pyx":58
3921  * integral_1_over_f += q_J[eN, k]*q_weights[k]/q_uOfX[eN, k]
3922  * areas_[eN] = area
3923  * if eN < nElements_owned: # <<<<<<<<<<<<<<
3924  * nE += 1
3925  * comm = Comm.get().comm.tompi4py()
3926  */
3927  }
3928  }
3929 
3930  /* "mprans/cMoveMeshMonitor.pyx":60
3931  * if eN < nElements_owned:
3932  * nE += 1
3933  * comm = Comm.get().comm.tompi4py() # <<<<<<<<<<<<<<
3934  * if comm.size > 1:
3935  * integral_1_over_f = comm.allreduce(integral_1_over_f, op=MPI.SUM)
3936  */
3937  __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_Comm); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L1_error)
3938  __Pyx_GOTREF(__pyx_t_16);
3939  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_get); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 60, __pyx_L1_error)
3940  __Pyx_GOTREF(__pyx_t_17);
3941  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3942  __pyx_t_16 = NULL;
3943  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
3944  __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17);
3945  if (likely(__pyx_t_16)) {
3946  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
3947  __Pyx_INCREF(__pyx_t_16);
3948  __Pyx_INCREF(function);
3949  __Pyx_DECREF_SET(__pyx_t_17, function);
3950  }
3951  }
3952  __pyx_t_15 = (__pyx_t_16) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_16) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
3953  __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3954  if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 60, __pyx_L1_error)
3955  __Pyx_GOTREF(__pyx_t_15);
3956  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3957  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_comm); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 60, __pyx_L1_error)
3958  __Pyx_GOTREF(__pyx_t_17);
3959  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3960  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_tompi4py); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 60, __pyx_L1_error)
3961  __Pyx_GOTREF(__pyx_t_15);
3962  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3963  __pyx_t_17 = NULL;
3964  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
3965  __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_15);
3966  if (likely(__pyx_t_17)) {
3967  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
3968  __Pyx_INCREF(__pyx_t_17);
3969  __Pyx_INCREF(function);
3970  __Pyx_DECREF_SET(__pyx_t_15, function);
3971  }
3972  }
3973  __pyx_t_14 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
3974  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
3975  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 60, __pyx_L1_error)
3976  __Pyx_GOTREF(__pyx_t_14);
3977  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3978  __pyx_v_comm = __pyx_t_14;
3979  __pyx_t_14 = 0;
3980 
3981  /* "mprans/cMoveMeshMonitor.pyx":61
3982  * nE += 1
3983  * comm = Comm.get().comm.tompi4py()
3984  * if comm.size > 1: # <<<<<<<<<<<<<<
3985  * integral_1_over_f = comm.allreduce(integral_1_over_f, op=MPI.SUM)
3986  * nE = comm.allreduce(nE, op=MPI.SUM)
3987  */
3988  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_size); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 61, __pyx_L1_error)
3989  __Pyx_GOTREF(__pyx_t_14);
3990  __pyx_t_15 = PyObject_RichCompare(__pyx_t_14, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 61, __pyx_L1_error)
3991  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3992  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
3993  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3994  if (__pyx_t_11) {
3995 
3996  /* "mprans/cMoveMeshMonitor.pyx":62
3997  * comm = Comm.get().comm.tompi4py()
3998  * if comm.size > 1:
3999  * integral_1_over_f = comm.allreduce(integral_1_over_f, op=MPI.SUM) # <<<<<<<<<<<<<<
4000  * nE = comm.allreduce(nE, op=MPI.SUM)
4001  * cdef double C = integral_1_over_f/nE # update scaling coefficient
4002  */
4003  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_allreduce); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 62, __pyx_L1_error)
4004  __Pyx_GOTREF(__pyx_t_15);
4005  __pyx_t_14 = PyFloat_FromDouble(__pyx_v_integral_1_over_f); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 62, __pyx_L1_error)
4006  __Pyx_GOTREF(__pyx_t_14);
4007  __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 62, __pyx_L1_error)
4008  __Pyx_GOTREF(__pyx_t_17);
4009  __Pyx_GIVEREF(__pyx_t_14);
4010  PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_14);
4011  __pyx_t_14 = 0;
4012  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 62, __pyx_L1_error)
4013  __Pyx_GOTREF(__pyx_t_14);
4014  __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_MPI); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 62, __pyx_L1_error)
4015  __Pyx_GOTREF(__pyx_t_16);
4016  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_SUM); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 62, __pyx_L1_error)
4017  __Pyx_GOTREF(__pyx_t_18);
4018  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4019  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_op, __pyx_t_18) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
4020  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4021  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, __pyx_t_14); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 62, __pyx_L1_error)
4022  __Pyx_GOTREF(__pyx_t_18);
4023  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4024  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4025  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4026  __pyx_t_19 = __pyx_PyFloat_AsDouble(__pyx_t_18); if (unlikely((__pyx_t_19 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error)
4027  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4028  __pyx_v_integral_1_over_f = __pyx_t_19;
4029 
4030  /* "mprans/cMoveMeshMonitor.pyx":63
4031  * if comm.size > 1:
4032  * integral_1_over_f = comm.allreduce(integral_1_over_f, op=MPI.SUM)
4033  * nE = comm.allreduce(nE, op=MPI.SUM) # <<<<<<<<<<<<<<
4034  * cdef double C = integral_1_over_f/nE # update scaling coefficient
4035  * self.C = C
4036  */
4037  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_allreduce); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 63, __pyx_L1_error)
4038  __Pyx_GOTREF(__pyx_t_18);
4039  __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_nE); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 63, __pyx_L1_error)
4040  __Pyx_GOTREF(__pyx_t_14);
4041  __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 63, __pyx_L1_error)
4042  __Pyx_GOTREF(__pyx_t_17);
4043  __Pyx_GIVEREF(__pyx_t_14);
4044  PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_14);
4045  __pyx_t_14 = 0;
4046  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 63, __pyx_L1_error)
4047  __Pyx_GOTREF(__pyx_t_14);
4048  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_MPI); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 63, __pyx_L1_error)
4049  __Pyx_GOTREF(__pyx_t_15);
4050  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_SUM); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 63, __pyx_L1_error)
4051  __Pyx_GOTREF(__pyx_t_16);
4052  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4053  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_op, __pyx_t_16) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
4054  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4055  __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_17, __pyx_t_14); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 63, __pyx_L1_error)
4056  __Pyx_GOTREF(__pyx_t_16);
4057  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4058  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4059  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4060  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
4061  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4062  __pyx_v_nE = __pyx_t_2;
4063 
4064  /* "mprans/cMoveMeshMonitor.pyx":61
4065  * nE += 1
4066  * comm = Comm.get().comm.tompi4py()
4067  * if comm.size > 1: # <<<<<<<<<<<<<<
4068  * integral_1_over_f = comm.allreduce(integral_1_over_f, op=MPI.SUM)
4069  * nE = comm.allreduce(nE, op=MPI.SUM)
4070  */
4071  }
4072 
4073  /* "mprans/cMoveMeshMonitor.pyx":64
4074  * integral_1_over_f = comm.allreduce(integral_1_over_f, op=MPI.SUM)
4075  * nE = comm.allreduce(nE, op=MPI.SUM)
4076  * cdef double C = integral_1_over_f/nE # update scaling coefficient # <<<<<<<<<<<<<<
4077  * self.C = C
4078  * cdef int nrci = len(q_rci)
4079  */
4080  __pyx_v_C = (__pyx_v_integral_1_over_f / __pyx_v_nE);
4081 
4082  /* "mprans/cMoveMeshMonitor.pyx":65
4083  * nE = comm.allreduce(nE, op=MPI.SUM)
4084  * cdef double C = integral_1_over_f/nE # update scaling coefficient
4085  * self.C = C # <<<<<<<<<<<<<<
4086  * cdef int nrci = len(q_rci)
4087  * for eN in range(nrci):
4088  */
4089  __pyx_v_self->C = __pyx_v_C;
4090 
4091  /* "mprans/cMoveMeshMonitor.pyx":66
4092  * cdef double C = integral_1_over_f/nE # update scaling coefficient
4093  * self.C = C
4094  * cdef int nrci = len(q_rci) # <<<<<<<<<<<<<<
4095  * for eN in range(nrci):
4096  * for k in range(nk):
4097  */
4098  __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_q_rci);
4099  __pyx_v_nrci = __pyx_t_1;
4100 
4101  /* "mprans/cMoveMeshMonitor.pyx":67
4102  * self.C = C
4103  * cdef int nrci = len(q_rci)
4104  * for eN in range(nrci): # <<<<<<<<<<<<<<
4105  * for k in range(nk):
4106  * q_fci[eN, k, :] = 0.0
4107  */
4108  __pyx_t_2 = __pyx_v_nrci;
4109  __pyx_t_3 = __pyx_t_2;
4110  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
4111  __pyx_v_eN = __pyx_t_4;
4112 
4113  /* "mprans/cMoveMeshMonitor.pyx":68
4114  * cdef int nrci = len(q_rci)
4115  * for eN in range(nrci):
4116  * for k in range(nk): # <<<<<<<<<<<<<<
4117  * q_fci[eN, k, :] = 0.0
4118  * q_rci[eN, k] = -(1./(q_uOfX[eN, k]*C)-1./areas_[eN])
4119  */
4120  __pyx_t_5 = __pyx_v_nk;
4121  __pyx_t_6 = __pyx_t_5;
4122  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
4123  __pyx_v_k = __pyx_t_7;
4124 
4125  /* "mprans/cMoveMeshMonitor.pyx":69
4126  * for eN in range(nrci):
4127  * for k in range(nk):
4128  * q_fci[eN, k, :] = 0.0 # <<<<<<<<<<<<<<
4129  * q_rci[eN, k] = -(1./(q_uOfX[eN, k]*C)-1./areas_[eN])
4130  *
4131  */
4132  __pyx_t_20.data = __pyx_v_q_fci.data;
4133  __pyx_t_20.memview = __pyx_v_q_fci.memview;
4134  __PYX_INC_MEMVIEW(&__pyx_t_20, 0);
4135  {
4136  Py_ssize_t __pyx_tmp_idx = __pyx_v_eN;
4137  Py_ssize_t __pyx_tmp_shape = __pyx_v_q_fci.shape[0];
4138  Py_ssize_t __pyx_tmp_stride = __pyx_v_q_fci.strides[0];
4139  if (__pyx_tmp_idx < 0)
4140  __pyx_tmp_idx += __pyx_tmp_shape;
4141  __pyx_t_20.data += __pyx_tmp_idx * __pyx_tmp_stride;
4142 }
4143 
4144 {
4145  Py_ssize_t __pyx_tmp_idx = __pyx_v_k;
4146  Py_ssize_t __pyx_tmp_shape = __pyx_v_q_fci.shape[1];
4147  Py_ssize_t __pyx_tmp_stride = __pyx_v_q_fci.strides[1];
4148  if (__pyx_tmp_idx < 0)
4149  __pyx_tmp_idx += __pyx_tmp_shape;
4150  __pyx_t_20.data += __pyx_tmp_idx * __pyx_tmp_stride;
4151 }
4152 
4153 __pyx_t_20.shape[0] = __pyx_v_q_fci.shape[2];
4154 __pyx_t_20.strides[0] = __pyx_v_q_fci.strides[2];
4155  __pyx_t_20.suboffsets[0] = -1;
4156 
4157 {
4158  double __pyx_temp_scalar = 0.0;
4159  {
4160  Py_ssize_t __pyx_temp_extent_0 = __pyx_t_20.shape[0];
4161  Py_ssize_t __pyx_temp_stride_0 = __pyx_t_20.strides[0];
4162  char *__pyx_temp_pointer_0;
4163  Py_ssize_t __pyx_temp_idx_0;
4164  __pyx_temp_pointer_0 = __pyx_t_20.data;
4165  for (__pyx_temp_idx_0 = 0; __pyx_temp_idx_0 < __pyx_temp_extent_0; __pyx_temp_idx_0++) {
4166  *((double *) __pyx_temp_pointer_0) = __pyx_temp_scalar;
4167  __pyx_temp_pointer_0 += __pyx_temp_stride_0;
4168  }
4169  }
4170  }
4171  __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
4172  __pyx_t_20.memview = NULL;
4173  __pyx_t_20.data = NULL;
4174 
4175  /* "mprans/cMoveMeshMonitor.pyx":70
4176  * for k in range(nk):
4177  * q_fci[eN, k, :] = 0.0
4178  * q_rci[eN, k] = -(1./(q_uOfX[eN, k]*C)-1./areas_[eN]) # <<<<<<<<<<<<<<
4179  *
4180  * # update other element values
4181  */
4182  __pyx_t_13 = __pyx_v_eN;
4183  __pyx_t_12 = __pyx_v_k;
4184  if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_q_uOfX.shape[0];
4185  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_q_uOfX.shape[1];
4186  __pyx_t_8 = __pyx_v_eN;
4187  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_areas_.shape[0];
4188  __pyx_t_9 = __pyx_v_eN;
4189  __pyx_t_10 = __pyx_v_k;
4190  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_q_rci.shape[0];
4191  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_q_rci.shape[1];
4192  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_q_rci.data + __pyx_t_9 * __pyx_v_q_rci.strides[0]) ) + __pyx_t_10 * __pyx_v_q_rci.strides[1]) )) = (-((1. / ((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_q_uOfX.data + __pyx_t_13 * __pyx_v_q_uOfX.strides[0]) ) + __pyx_t_12 * __pyx_v_q_uOfX.strides[1]) ))) * __pyx_v_C)) - (1. / (*((double *) ( /* dim=0 */ (__pyx_v_areas_.data + __pyx_t_8 * __pyx_v_areas_.strides[0]) ))))));
4193  }
4194  }
4195 
4196  /* "mprans/cMoveMeshMonitor.pyx":73
4197  *
4198  * # update other element values
4199  * cdef object pc = self.pyCoefficients # <<<<<<<<<<<<<<
4200  * cdef object mesh = pc.mesh
4201  * cdef int nd = pc.nd
4202  */
4203  __pyx_t_16 = __pyx_v_self->pyCoefficients;
4204  __Pyx_INCREF(__pyx_t_16);
4205  __pyx_v_pc = __pyx_t_16;
4206  __pyx_t_16 = 0;
4207 
4208  /* "mprans/cMoveMeshMonitor.pyx":74
4209  * # update other element values
4210  * cdef object pc = self.pyCoefficients
4211  * cdef object mesh = pc.mesh # <<<<<<<<<<<<<<
4212  * cdef int nd = pc.nd
4213  * cdef double[:,:] elementBoundaryBarycentersArray = mesh.elementBoundaryBarycentersArray
4214  */
4215  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 74, __pyx_L1_error)
4216  __Pyx_GOTREF(__pyx_t_16);
4217  __pyx_v_mesh = __pyx_t_16;
4218  __pyx_t_16 = 0;
4219 
4220  /* "mprans/cMoveMeshMonitor.pyx":75
4221  * cdef object pc = self.pyCoefficients
4222  * cdef object mesh = pc.mesh
4223  * cdef int nd = pc.nd # <<<<<<<<<<<<<<
4224  * cdef double[:,:] elementBoundaryBarycentersArray = mesh.elementBoundaryBarycentersArray
4225  * cdef double[:,:] elementBarycentersArray = mesh.elementBarycentersArray
4226  */
4227  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_nd); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 75, __pyx_L1_error)
4228  __Pyx_GOTREF(__pyx_t_16);
4229  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error)
4230  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4231  __pyx_v_nd = __pyx_t_2;
4232 
4233  /* "mprans/cMoveMeshMonitor.pyx":76
4234  * cdef object mesh = pc.mesh
4235  * cdef int nd = pc.nd
4236  * cdef double[:,:] elementBoundaryBarycentersArray = mesh.elementBoundaryBarycentersArray # <<<<<<<<<<<<<<
4237  * cdef double[:,:] elementBarycentersArray = mesh.elementBarycentersArray
4238  * cdef double[:,:] nodeArray = mesh.nodeArray
4239  */
4240  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBoundaryBarycentersArray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 76, __pyx_L1_error)
4241  __Pyx_GOTREF(__pyx_t_16);
4242  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 76, __pyx_L1_error)
4243  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4244  __pyx_v_elementBoundaryBarycentersArray = __pyx_t_21;
4245  __pyx_t_21.memview = NULL;
4246  __pyx_t_21.data = NULL;
4247 
4248  /* "mprans/cMoveMeshMonitor.pyx":77
4249  * cdef int nd = pc.nd
4250  * cdef double[:,:] elementBoundaryBarycentersArray = mesh.elementBoundaryBarycentersArray
4251  * cdef double[:,:] elementBarycentersArray = mesh.elementBarycentersArray # <<<<<<<<<<<<<<
4252  * cdef double[:,:] nodeArray = mesh.nodeArray
4253  * cdef int[:,:] elementBoundaryNodesArray = mesh.elementBoundaryNodesArray
4254  */
4255  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBarycentersArray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 77, __pyx_L1_error)
4256  __Pyx_GOTREF(__pyx_t_16);
4257  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 77, __pyx_L1_error)
4258  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4259  __pyx_v_elementBarycentersArray = __pyx_t_21;
4260  __pyx_t_21.memview = NULL;
4261  __pyx_t_21.data = NULL;
4262 
4263  /* "mprans/cMoveMeshMonitor.pyx":78
4264  * cdef double[:,:] elementBoundaryBarycentersArray = mesh.elementBoundaryBarycentersArray
4265  * cdef double[:,:] elementBarycentersArray = mesh.elementBarycentersArray
4266  * cdef double[:,:] nodeArray = mesh.nodeArray # <<<<<<<<<<<<<<
4267  * cdef int[:,:] elementBoundaryNodesArray = mesh.elementBoundaryNodesArray
4268  * cdef int[:,:] elementNodesArray = mesh.elementNodesArray
4269  */
4270  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nodeArray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 78, __pyx_L1_error)
4271  __Pyx_GOTREF(__pyx_t_16);
4272  __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 78, __pyx_L1_error)
4273  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4274  __pyx_v_nodeArray = __pyx_t_21;
4275  __pyx_t_21.memview = NULL;
4276  __pyx_t_21.data = NULL;
4277 
4278  /* "mprans/cMoveMeshMonitor.pyx":79
4279  * cdef double[:,:] elementBarycentersArray = mesh.elementBarycentersArray
4280  * cdef double[:,:] nodeArray = mesh.nodeArray
4281  * cdef int[:,:] elementBoundaryNodesArray = mesh.elementBoundaryNodesArray # <<<<<<<<<<<<<<
4282  * cdef int[:,:] elementNodesArray = mesh.elementNodesArray
4283  * cdef int[:,:] elementBoundariesArray = mesh.elementBoundariesArray
4284  */
4285  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBoundaryNodesArray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 79, __pyx_L1_error)
4286  __Pyx_GOTREF(__pyx_t_16);
4287  __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 79, __pyx_L1_error)
4288  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4289  __pyx_v_elementBoundaryNodesArray = __pyx_t_22;
4290  __pyx_t_22.memview = NULL;
4291  __pyx_t_22.data = NULL;
4292 
4293  /* "mprans/cMoveMeshMonitor.pyx":80
4294  * cdef double[:,:] nodeArray = mesh.nodeArray
4295  * cdef int[:,:] elementBoundaryNodesArray = mesh.elementBoundaryNodesArray
4296  * cdef int[:,:] elementNodesArray = mesh.elementNodesArray # <<<<<<<<<<<<<<
4297  * cdef int[:,:] elementBoundariesArray = mesh.elementBoundariesArray
4298  * cdef int nElementBoundaries_global = mesh.nElementBoundaries_global
4299  */
4300  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementNodesArray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 80, __pyx_L1_error)
4301  __Pyx_GOTREF(__pyx_t_16);
4302  __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 80, __pyx_L1_error)
4303  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4304  __pyx_v_elementNodesArray = __pyx_t_22;
4305  __pyx_t_22.memview = NULL;
4306  __pyx_t_22.data = NULL;
4307 
4308  /* "mprans/cMoveMeshMonitor.pyx":81
4309  * cdef int[:,:] elementBoundaryNodesArray = mesh.elementBoundaryNodesArray
4310  * cdef int[:,:] elementNodesArray = mesh.elementNodesArray
4311  * cdef int[:,:] elementBoundariesArray = mesh.elementBoundariesArray # <<<<<<<<<<<<<<
4312  * cdef int nElementBoundaries_global = mesh.nElementBoundaries_global
4313  * cdef int nNodes_elementBoundary = mesh.nNodes_elementBoundary
4314  */
4315  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBoundariesArray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 81, __pyx_L1_error)
4316  __Pyx_GOTREF(__pyx_t_16);
4317  __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_16, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 81, __pyx_L1_error)
4318  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4319  __pyx_v_elementBoundariesArray = __pyx_t_22;
4320  __pyx_t_22.memview = NULL;
4321  __pyx_t_22.data = NULL;
4322 
4323  /* "mprans/cMoveMeshMonitor.pyx":82
4324  * cdef int[:,:] elementNodesArray = mesh.elementNodesArray
4325  * cdef int[:,:] elementBoundariesArray = mesh.elementBoundariesArray
4326  * cdef int nElementBoundaries_global = mesh.nElementBoundaries_global # <<<<<<<<<<<<<<
4327  * cdef int nNodes_elementBoundary = mesh.nNodes_elementBoundary
4328  * cdef int nElements_global = mesh.nElements_global
4329  */
4330  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nElementBoundaries_global); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 82, __pyx_L1_error)
4331  __Pyx_GOTREF(__pyx_t_16);
4332  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error)
4333  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4334  __pyx_v_nElementBoundaries_global = __pyx_t_2;
4335 
4336  /* "mprans/cMoveMeshMonitor.pyx":83
4337  * cdef int[:,:] elementBoundariesArray = mesh.elementBoundariesArray
4338  * cdef int nElementBoundaries_global = mesh.nElementBoundaries_global
4339  * cdef int nNodes_elementBoundary = mesh.nNodes_elementBoundary # <<<<<<<<<<<<<<
4340  * cdef int nElements_global = mesh.nElements_global
4341  * cdef int nNodes_element = mesh.nNodes_element
4342  */
4343  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nNodes_elementBoundary); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 83, __pyx_L1_error)
4344  __Pyx_GOTREF(__pyx_t_16);
4345  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error)
4346  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4347  __pyx_v_nNodes_elementBoundary = __pyx_t_2;
4348 
4349  /* "mprans/cMoveMeshMonitor.pyx":84
4350  * cdef int nElementBoundaries_global = mesh.nElementBoundaries_global
4351  * cdef int nNodes_elementBoundary = mesh.nNodes_elementBoundary
4352  * cdef int nElements_global = mesh.nElements_global # <<<<<<<<<<<<<<
4353  * cdef int nNodes_element = mesh.nNodes_element
4354  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray
4355  */
4356  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nElements_global); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 84, __pyx_L1_error)
4357  __Pyx_GOTREF(__pyx_t_16);
4358  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error)
4359  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4360  __pyx_v_nElements_global = __pyx_t_2;
4361 
4362  /* "mprans/cMoveMeshMonitor.pyx":85
4363  * cdef int nNodes_elementBoundary = mesh.nNodes_elementBoundary
4364  * cdef int nElements_global = mesh.nElements_global
4365  * cdef int nNodes_element = mesh.nNodes_element # <<<<<<<<<<<<<<
4366  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray
4367  * # update element boundary barycenters
4368  */
4369  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nNodes_element); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 85, __pyx_L1_error)
4370  __Pyx_GOTREF(__pyx_t_16);
4371  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_16); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error)
4372  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4373  __pyx_v_nNodes_element = __pyx_t_2;
4374 
4375  /* "mprans/cMoveMeshMonitor.pyx":86
4376  * cdef int nElements_global = mesh.nElements_global
4377  * cdef int nNodes_element = mesh.nNodes_element
4378  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray # <<<<<<<<<<<<<<
4379  * # update element boundary barycenters
4380  * for ebN in range(nElementBoundaries_global):
4381  */
4382  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 86, __pyx_L1_error)
4383  __Pyx_GOTREF(__pyx_t_16);
4384  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_elementBoundaryNormalsArray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 86, __pyx_L1_error)
4385  __Pyx_GOTREF(__pyx_t_14);
4386  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4387  __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_t_14, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 86, __pyx_L1_error)
4388  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4389  __pyx_v_elementBoundaryNormalsArray = __pyx_t_23;
4390  __pyx_t_23.memview = NULL;
4391  __pyx_t_23.data = NULL;
4392 
4393  /* "mprans/cMoveMeshMonitor.pyx":88
4394  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray
4395  * # update element boundary barycenters
4396  * for ebN in range(nElementBoundaries_global): # <<<<<<<<<<<<<<
4397  * elementBoundaryBarycentersArray[ebN, 0] = 0.
4398  * elementBoundaryBarycentersArray[ebN, 1] = 0.
4399  */
4400  __pyx_t_2 = __pyx_v_nElementBoundaries_global;
4401  __pyx_t_3 = __pyx_t_2;
4402  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
4403  __pyx_v_ebN = __pyx_t_4;
4404 
4405  /* "mprans/cMoveMeshMonitor.pyx":89
4406  * # update element boundary barycenters
4407  * for ebN in range(nElementBoundaries_global):
4408  * elementBoundaryBarycentersArray[ebN, 0] = 0. # <<<<<<<<<<<<<<
4409  * elementBoundaryBarycentersArray[ebN, 1] = 0.
4410  * elementBoundaryBarycentersArray[ebN, 2] = 0.
4411  */
4412  __pyx_t_8 = __pyx_v_ebN;
4413  __pyx_t_12 = 0;
4414  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4415  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4416  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) = 0.;
4417 
4418  /* "mprans/cMoveMeshMonitor.pyx":90
4419  * for ebN in range(nElementBoundaries_global):
4420  * elementBoundaryBarycentersArray[ebN, 0] = 0.
4421  * elementBoundaryBarycentersArray[ebN, 1] = 0. # <<<<<<<<<<<<<<
4422  * elementBoundaryBarycentersArray[ebN, 2] = 0.
4423  * for nN in range(nNodes_elementBoundary):
4424  */
4425  __pyx_t_12 = __pyx_v_ebN;
4426  __pyx_t_8 = 1;
4427  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4428  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4429  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_12 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) = 0.;
4430 
4431  /* "mprans/cMoveMeshMonitor.pyx":91
4432  * elementBoundaryBarycentersArray[ebN, 0] = 0.
4433  * elementBoundaryBarycentersArray[ebN, 1] = 0.
4434  * elementBoundaryBarycentersArray[ebN, 2] = 0. # <<<<<<<<<<<<<<
4435  * for nN in range(nNodes_elementBoundary):
4436  * elementBoundaryBarycentersArray[ebN, 0] += nodeArray[elementBoundaryNodesArray[ebN, nN], 0]
4437  */
4438  __pyx_t_8 = __pyx_v_ebN;
4439  __pyx_t_12 = 2;
4440  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4441  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4442  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) = 0.;
4443 
4444  /* "mprans/cMoveMeshMonitor.pyx":92
4445  * elementBoundaryBarycentersArray[ebN, 1] = 0.
4446  * elementBoundaryBarycentersArray[ebN, 2] = 0.
4447  * for nN in range(nNodes_elementBoundary): # <<<<<<<<<<<<<<
4448  * elementBoundaryBarycentersArray[ebN, 0] += nodeArray[elementBoundaryNodesArray[ebN, nN], 0]
4449  * elementBoundaryBarycentersArray[ebN, 1] += nodeArray[elementBoundaryNodesArray[ebN, nN], 1]
4450  */
4451  __pyx_t_5 = __pyx_v_nNodes_elementBoundary;
4452  __pyx_t_6 = __pyx_t_5;
4453  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
4454  __pyx_v_nN = __pyx_t_7;
4455 
4456  /* "mprans/cMoveMeshMonitor.pyx":93
4457  * elementBoundaryBarycentersArray[ebN, 2] = 0.
4458  * for nN in range(nNodes_elementBoundary):
4459  * elementBoundaryBarycentersArray[ebN, 0] += nodeArray[elementBoundaryNodesArray[ebN, nN], 0] # <<<<<<<<<<<<<<
4460  * elementBoundaryBarycentersArray[ebN, 1] += nodeArray[elementBoundaryNodesArray[ebN, nN], 1]
4461  * elementBoundaryBarycentersArray[ebN, 2] += nodeArray[elementBoundaryNodesArray[ebN, nN], 2]
4462  */
4463  __pyx_t_12 = __pyx_v_ebN;
4464  __pyx_t_8 = __pyx_v_nN;
4465  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryNodesArray.shape[0];
4466  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryNodesArray.shape[1];
4467  __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryNodesArray.data + __pyx_t_12 * __pyx_v_elementBoundaryNodesArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryNodesArray.strides[1]) )));
4468  __pyx_t_10 = 0;
4469  if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeArray.shape[0];
4470  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeArray.shape[1];
4471  __pyx_t_9 = __pyx_v_ebN;
4472  __pyx_t_24 = 0;
4473  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4474  if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4475  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_24 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) += (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_13 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_10 * __pyx_v_nodeArray.strides[1]) )));
4476 
4477  /* "mprans/cMoveMeshMonitor.pyx":94
4478  * for nN in range(nNodes_elementBoundary):
4479  * elementBoundaryBarycentersArray[ebN, 0] += nodeArray[elementBoundaryNodesArray[ebN, nN], 0]
4480  * elementBoundaryBarycentersArray[ebN, 1] += nodeArray[elementBoundaryNodesArray[ebN, nN], 1] # <<<<<<<<<<<<<<
4481  * elementBoundaryBarycentersArray[ebN, 2] += nodeArray[elementBoundaryNodesArray[ebN, nN], 2]
4482  * elementBoundaryBarycentersArray[ebN, 0] /= nNodes_elementBoundary
4483  */
4484  __pyx_t_8 = __pyx_v_ebN;
4485  __pyx_t_12 = __pyx_v_nN;
4486  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryNodesArray.shape[0];
4487  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryNodesArray.shape[1];
4488  __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryNodesArray.data + __pyx_t_8 * __pyx_v_elementBoundaryNodesArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBoundaryNodesArray.strides[1]) )));
4489  __pyx_t_13 = 1;
4490  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeArray.shape[0];
4491  if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeArray.shape[1];
4492  __pyx_t_24 = __pyx_v_ebN;
4493  __pyx_t_9 = 1;
4494  if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4495  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4496  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_24 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) += (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_10 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_13 * __pyx_v_nodeArray.strides[1]) )));
4497 
4498  /* "mprans/cMoveMeshMonitor.pyx":95
4499  * elementBoundaryBarycentersArray[ebN, 0] += nodeArray[elementBoundaryNodesArray[ebN, nN], 0]
4500  * elementBoundaryBarycentersArray[ebN, 1] += nodeArray[elementBoundaryNodesArray[ebN, nN], 1]
4501  * elementBoundaryBarycentersArray[ebN, 2] += nodeArray[elementBoundaryNodesArray[ebN, nN], 2] # <<<<<<<<<<<<<<
4502  * elementBoundaryBarycentersArray[ebN, 0] /= nNodes_elementBoundary
4503  * elementBoundaryBarycentersArray[ebN, 1] /= nNodes_elementBoundary
4504  */
4505  __pyx_t_12 = __pyx_v_ebN;
4506  __pyx_t_8 = __pyx_v_nN;
4507  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryNodesArray.shape[0];
4508  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryNodesArray.shape[1];
4509  __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryNodesArray.data + __pyx_t_12 * __pyx_v_elementBoundaryNodesArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryNodesArray.strides[1]) )));
4510  __pyx_t_10 = 2;
4511  if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeArray.shape[0];
4512  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeArray.shape[1];
4513  __pyx_t_9 = __pyx_v_ebN;
4514  __pyx_t_24 = 2;
4515  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4516  if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4517  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_24 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) += (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_13 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_10 * __pyx_v_nodeArray.strides[1]) )));
4518  }
4519 
4520  /* "mprans/cMoveMeshMonitor.pyx":96
4521  * elementBoundaryBarycentersArray[ebN, 1] += nodeArray[elementBoundaryNodesArray[ebN, nN], 1]
4522  * elementBoundaryBarycentersArray[ebN, 2] += nodeArray[elementBoundaryNodesArray[ebN, nN], 2]
4523  * elementBoundaryBarycentersArray[ebN, 0] /= nNodes_elementBoundary # <<<<<<<<<<<<<<
4524  * elementBoundaryBarycentersArray[ebN, 1] /= nNodes_elementBoundary
4525  * elementBoundaryBarycentersArray[ebN, 2] /= nNodes_elementBoundary
4526  */
4527  __pyx_t_8 = __pyx_v_ebN;
4528  __pyx_t_12 = 0;
4529  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4530  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4531  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_elementBoundary;
4532 
4533  /* "mprans/cMoveMeshMonitor.pyx":97
4534  * elementBoundaryBarycentersArray[ebN, 2] += nodeArray[elementBoundaryNodesArray[ebN, nN], 2]
4535  * elementBoundaryBarycentersArray[ebN, 0] /= nNodes_elementBoundary
4536  * elementBoundaryBarycentersArray[ebN, 1] /= nNodes_elementBoundary # <<<<<<<<<<<<<<
4537  * elementBoundaryBarycentersArray[ebN, 2] /= nNodes_elementBoundary
4538  * # update element barycenters
4539  */
4540  __pyx_t_12 = __pyx_v_ebN;
4541  __pyx_t_8 = 1;
4542  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4543  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4544  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_12 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_elementBoundary;
4545 
4546  /* "mprans/cMoveMeshMonitor.pyx":98
4547  * elementBoundaryBarycentersArray[ebN, 0] /= nNodes_elementBoundary
4548  * elementBoundaryBarycentersArray[ebN, 1] /= nNodes_elementBoundary
4549  * elementBoundaryBarycentersArray[ebN, 2] /= nNodes_elementBoundary # <<<<<<<<<<<<<<
4550  * # update element barycenters
4551  * for eN in range(nElements_global):
4552  */
4553  __pyx_t_8 = __pyx_v_ebN;
4554  __pyx_t_12 = 2;
4555  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
4556  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
4557  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_elementBoundary;
4558  }
4559 
4560  /* "mprans/cMoveMeshMonitor.pyx":100
4561  * elementBoundaryBarycentersArray[ebN, 2] /= nNodes_elementBoundary
4562  * # update element barycenters
4563  * for eN in range(nElements_global): # <<<<<<<<<<<<<<
4564  * elementBarycentersArray[eN, 0] = 0.
4565  * elementBarycentersArray[eN, 1] = 0.
4566  */
4567  __pyx_t_2 = __pyx_v_nElements_global;
4568  __pyx_t_3 = __pyx_t_2;
4569  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
4570  __pyx_v_eN = __pyx_t_4;
4571 
4572  /* "mprans/cMoveMeshMonitor.pyx":101
4573  * # update element barycenters
4574  * for eN in range(nElements_global):
4575  * elementBarycentersArray[eN, 0] = 0. # <<<<<<<<<<<<<<
4576  * elementBarycentersArray[eN, 1] = 0.
4577  * elementBarycentersArray[eN, 2] = 0.
4578  */
4579  __pyx_t_12 = __pyx_v_eN;
4580  __pyx_t_8 = 0;
4581  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBarycentersArray.shape[0];
4582  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[1];
4583  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_12 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[1]) )) = 0.;
4584 
4585  /* "mprans/cMoveMeshMonitor.pyx":102
4586  * for eN in range(nElements_global):
4587  * elementBarycentersArray[eN, 0] = 0.
4588  * elementBarycentersArray[eN, 1] = 0. # <<<<<<<<<<<<<<
4589  * elementBarycentersArray[eN, 2] = 0.
4590  * for ebN in range(nNodes_element):
4591  */
4592  __pyx_t_8 = __pyx_v_eN;
4593  __pyx_t_12 = 1;
4594  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[0];
4595  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBarycentersArray.shape[1];
4596  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBarycentersArray.strides[1]) )) = 0.;
4597 
4598  /* "mprans/cMoveMeshMonitor.pyx":103
4599  * elementBarycentersArray[eN, 0] = 0.
4600  * elementBarycentersArray[eN, 1] = 0.
4601  * elementBarycentersArray[eN, 2] = 0. # <<<<<<<<<<<<<<
4602  * for ebN in range(nNodes_element):
4603  * elementBarycentersArray[eN, 0] += nodeArray[elementNodesArray[eN, ebN], 0]
4604  */
4605  __pyx_t_12 = __pyx_v_eN;
4606  __pyx_t_8 = 2;
4607  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBarycentersArray.shape[0];
4608  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[1];
4609  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_12 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[1]) )) = 0.;
4610 
4611  /* "mprans/cMoveMeshMonitor.pyx":104
4612  * elementBarycentersArray[eN, 1] = 0.
4613  * elementBarycentersArray[eN, 2] = 0.
4614  * for ebN in range(nNodes_element): # <<<<<<<<<<<<<<
4615  * elementBarycentersArray[eN, 0] += nodeArray[elementNodesArray[eN, ebN], 0]
4616  * elementBarycentersArray[eN, 1] += nodeArray[elementNodesArray[eN, ebN], 1]
4617  */
4618  __pyx_t_5 = __pyx_v_nNodes_element;
4619  __pyx_t_6 = __pyx_t_5;
4620  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
4621  __pyx_v_ebN = __pyx_t_7;
4622 
4623  /* "mprans/cMoveMeshMonitor.pyx":105
4624  * elementBarycentersArray[eN, 2] = 0.
4625  * for ebN in range(nNodes_element):
4626  * elementBarycentersArray[eN, 0] += nodeArray[elementNodesArray[eN, ebN], 0] # <<<<<<<<<<<<<<
4627  * elementBarycentersArray[eN, 1] += nodeArray[elementNodesArray[eN, ebN], 1]
4628  * elementBarycentersArray[eN, 2] += nodeArray[elementNodesArray[eN, ebN], 2]
4629  */
4630  __pyx_t_8 = __pyx_v_eN;
4631  __pyx_t_12 = __pyx_v_ebN;
4632  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementNodesArray.shape[0];
4633  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementNodesArray.shape[1];
4634  __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_8 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementNodesArray.strides[1]) )));
4635  __pyx_t_13 = 0;
4636  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeArray.shape[0];
4637  if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeArray.shape[1];
4638  __pyx_t_24 = __pyx_v_eN;
4639  __pyx_t_9 = 0;
4640  if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_elementBarycentersArray.shape[0];
4641  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[1];
4642  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_24 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[1]) )) += (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_10 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_13 * __pyx_v_nodeArray.strides[1]) )));
4643 
4644  /* "mprans/cMoveMeshMonitor.pyx":106
4645  * for ebN in range(nNodes_element):
4646  * elementBarycentersArray[eN, 0] += nodeArray[elementNodesArray[eN, ebN], 0]
4647  * elementBarycentersArray[eN, 1] += nodeArray[elementNodesArray[eN, ebN], 1] # <<<<<<<<<<<<<<
4648  * elementBarycentersArray[eN, 2] += nodeArray[elementNodesArray[eN, ebN], 2]
4649  * elementBarycentersArray[eN, 0] /= nNodes_element
4650  */
4651  __pyx_t_12 = __pyx_v_eN;
4652  __pyx_t_8 = __pyx_v_ebN;
4653  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementNodesArray.shape[0];
4654  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementNodesArray.shape[1];
4655  __pyx_t_13 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_12 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementNodesArray.strides[1]) )));
4656  __pyx_t_10 = 1;
4657  if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeArray.shape[0];
4658  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeArray.shape[1];
4659  __pyx_t_9 = __pyx_v_eN;
4660  __pyx_t_24 = 1;
4661  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[0];
4662  if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_elementBarycentersArray.shape[1];
4663  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_24 * __pyx_v_elementBarycentersArray.strides[1]) )) += (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_13 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_10 * __pyx_v_nodeArray.strides[1]) )));
4664 
4665  /* "mprans/cMoveMeshMonitor.pyx":107
4666  * elementBarycentersArray[eN, 0] += nodeArray[elementNodesArray[eN, ebN], 0]
4667  * elementBarycentersArray[eN, 1] += nodeArray[elementNodesArray[eN, ebN], 1]
4668  * elementBarycentersArray[eN, 2] += nodeArray[elementNodesArray[eN, ebN], 2] # <<<<<<<<<<<<<<
4669  * elementBarycentersArray[eN, 0] /= nNodes_element
4670  * elementBarycentersArray[eN, 1] /= nNodes_element
4671  */
4672  __pyx_t_8 = __pyx_v_eN;
4673  __pyx_t_12 = __pyx_v_ebN;
4674  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementNodesArray.shape[0];
4675  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementNodesArray.shape[1];
4676  __pyx_t_10 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_8 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementNodesArray.strides[1]) )));
4677  __pyx_t_13 = 2;
4678  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeArray.shape[0];
4679  if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeArray.shape[1];
4680  __pyx_t_24 = __pyx_v_eN;
4681  __pyx_t_9 = 2;
4682  if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_elementBarycentersArray.shape[0];
4683  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[1];
4684  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_24 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[1]) )) += (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_10 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_13 * __pyx_v_nodeArray.strides[1]) )));
4685  }
4686 
4687  /* "mprans/cMoveMeshMonitor.pyx":108
4688  * elementBarycentersArray[eN, 1] += nodeArray[elementNodesArray[eN, ebN], 1]
4689  * elementBarycentersArray[eN, 2] += nodeArray[elementNodesArray[eN, ebN], 2]
4690  * elementBarycentersArray[eN, 0] /= nNodes_element # <<<<<<<<<<<<<<
4691  * elementBarycentersArray[eN, 1] /= nNodes_element
4692  * elementBarycentersArray[eN, 2] /= nNodes_element
4693  */
4694  __pyx_t_12 = __pyx_v_eN;
4695  __pyx_t_8 = 0;
4696  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBarycentersArray.shape[0];
4697  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[1];
4698  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_12 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_element;
4699 
4700  /* "mprans/cMoveMeshMonitor.pyx":109
4701  * elementBarycentersArray[eN, 2] += nodeArray[elementNodesArray[eN, ebN], 2]
4702  * elementBarycentersArray[eN, 0] /= nNodes_element
4703  * elementBarycentersArray[eN, 1] /= nNodes_element # <<<<<<<<<<<<<<
4704  * elementBarycentersArray[eN, 2] /= nNodes_element
4705  * # update normals
4706  */
4707  __pyx_t_8 = __pyx_v_eN;
4708  __pyx_t_12 = 1;
4709  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[0];
4710  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBarycentersArray.shape[1];
4711  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_12 * __pyx_v_elementBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_element;
4712 
4713  /* "mprans/cMoveMeshMonitor.pyx":110
4714  * elementBarycentersArray[eN, 0] /= nNodes_element
4715  * elementBarycentersArray[eN, 1] /= nNodes_element
4716  * elementBarycentersArray[eN, 2] /= nNodes_element # <<<<<<<<<<<<<<
4717  * # update normals
4718  * if nd == 2:
4719  */
4720  __pyx_t_12 = __pyx_v_eN;
4721  __pyx_t_8 = 2;
4722  if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_elementBarycentersArray.shape[0];
4723  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[1];
4724  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_12 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_element;
4725  }
4726 
4727  /* "mprans/cMoveMeshMonitor.pyx":112
4728  * elementBarycentersArray[eN, 2] /= nNodes_element
4729  * # update normals
4730  * if nd == 2: # <<<<<<<<<<<<<<
4731  * # triangle
4732  * ms.pyxUpdateElementBoundaryNormalsTriangle(elementBoundaryNormalsArray_=elementBoundaryNormalsArray,
4733  */
4734  switch (__pyx_v_nd) {
4735  case 2:
4736 
4737  /* "mprans/cMoveMeshMonitor.pyx":114
4738  * if nd == 2:
4739  * # triangle
4740  * ms.pyxUpdateElementBoundaryNormalsTriangle(elementBoundaryNormalsArray_=elementBoundaryNormalsArray, # <<<<<<<<<<<<<<
4741  * nodeArray=nodeArray,
4742  * elementBoundariesArray=elementBoundariesArray,
4743  */
4744  __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTriangle(__pyx_v_elementBoundaryNormalsArray, __pyx_v_nodeArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryNodesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBarycentersArray, __pyx_v_nElements_global);
4745 
4746  /* "mprans/cMoveMeshMonitor.pyx":112
4747  * elementBarycentersArray[eN, 2] /= nNodes_element
4748  * # update normals
4749  * if nd == 2: # <<<<<<<<<<<<<<
4750  * # triangle
4751  * ms.pyxUpdateElementBoundaryNormalsTriangle(elementBoundaryNormalsArray_=elementBoundaryNormalsArray,
4752  */
4753  break;
4754  case 3:
4755 
4756  /* "mprans/cMoveMeshMonitor.pyx":123
4757  * elif nd == 3:
4758  * # tetra
4759  * ms.pyxUpdateElementBoundaryNormalsTetra(elementBoundaryNormalsArray_=elementBoundaryNormalsArray, # <<<<<<<<<<<<<<
4760  * nodeArray=nodeArray,
4761  * elementBoundariesArray=elementBoundariesArray,
4762  */
4763  __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTetra(__pyx_v_elementBoundaryNormalsArray, __pyx_v_nodeArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryNodesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBarycentersArray, __pyx_v_nElements_global);
4764 
4765  /* "mprans/cMoveMeshMonitor.pyx":121
4766  * elementBarycentersArray=elementBarycentersArray,
4767  * nElements=nElements_global)
4768  * elif nd == 3: # <<<<<<<<<<<<<<
4769  * # tetra
4770  * ms.pyxUpdateElementBoundaryNormalsTetra(elementBoundaryNormalsArray_=elementBoundaryNormalsArray,
4771  */
4772  break;
4773  default: break;
4774  }
4775 
4776  /* "mprans/cMoveMeshMonitor.pyx":37
4777  * nElements_owned=pc.mesh.nElements_owned)
4778  *
4779  * cdef cppPreStep(self, # <<<<<<<<<<<<<<
4780  * double[:,:] q_uOfX,
4781  * double[:,:] q_J,
4782  */
4783 
4784  /* function exit code */
4785  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4786  goto __pyx_L0;
4787  __pyx_L1_error:;
4788  __Pyx_XDECREF(__pyx_t_14);
4789  __Pyx_XDECREF(__pyx_t_15);
4790  __Pyx_XDECREF(__pyx_t_16);
4791  __Pyx_XDECREF(__pyx_t_17);
4792  __Pyx_XDECREF(__pyx_t_18);
4793  __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
4794  __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
4795  __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1);
4796  __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1);
4797  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.cppPreStep", __pyx_clineno, __pyx_lineno, __pyx_filename);
4798  __pyx_r = 0;
4799  __pyx_L0:;
4800  __Pyx_XDECREF(__pyx_v_comm);
4801  __Pyx_XDECREF(__pyx_v_pc);
4802  __Pyx_XDECREF(__pyx_v_mesh);
4803  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryBarycentersArray, 1);
4804  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBarycentersArray, 1);
4805  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray, 1);
4806  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNodesArray, 1);
4807  __PYX_XDEC_MEMVIEW(&__pyx_v_elementNodesArray, 1);
4808  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundariesArray, 1);
4809  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNormalsArray, 1);
4810  __Pyx_XGIVEREF(__pyx_r);
4811  __Pyx_RefNannyFinishContext();
4812  return __pyx_r;
4813 }
4814 
4815 /* "mprans/cMoveMeshMonitor.pyx":132
4816  *
4817  *
4818  * def postStep(self): # <<<<<<<<<<<<<<
4819  * pc = self.pyCoefficients
4820  * self.cppPostStep()
4821  */
4822 
4823 /* Python wrapper */
4824 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_7postStep(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4825 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_7postStep(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4826  PyObject *__pyx_r = 0;
4827  __Pyx_RefNannyDeclarations
4828  __Pyx_RefNannySetupContext("postStep (wrapper)", 0);
4829  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_6postStep(((struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
4830 
4831  /* function exit code */
4832  __Pyx_RefNannyFinishContext();
4833  return __pyx_r;
4834 }
4835 
4836 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_6postStep(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
4837  CYTHON_UNUSED PyObject *__pyx_v_pc = NULL;
4838  PyObject *__pyx_r = NULL;
4839  __Pyx_RefNannyDeclarations
4840  PyObject *__pyx_t_1 = NULL;
4841  int __pyx_lineno = 0;
4842  const char *__pyx_filename = NULL;
4843  int __pyx_clineno = 0;
4844  __Pyx_RefNannySetupContext("postStep", 0);
4845 
4846  /* "mprans/cMoveMeshMonitor.pyx":133
4847  *
4848  * def postStep(self):
4849  * pc = self.pyCoefficients # <<<<<<<<<<<<<<
4850  * self.cppPostStep()
4851  *
4852  */
4853  __pyx_t_1 = __pyx_v_self->pyCoefficients;
4854  __Pyx_INCREF(__pyx_t_1);
4855  __pyx_v_pc = __pyx_t_1;
4856  __pyx_t_1 = 0;
4857 
4858  /* "mprans/cMoveMeshMonitor.pyx":134
4859  * def postStep(self):
4860  * pc = self.pyCoefficients
4861  * self.cppPostStep() # <<<<<<<<<<<<<<
4862  *
4863  * cdef cppPostStep(self):
4864  */
4865  __pyx_t_1 = ((struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self->__pyx_vtab)->cppPostStep(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
4866  __Pyx_GOTREF(__pyx_t_1);
4867  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4868 
4869  /* "mprans/cMoveMeshMonitor.pyx":132
4870  *
4871  *
4872  * def postStep(self): # <<<<<<<<<<<<<<
4873  * pc = self.pyCoefficients
4874  * self.cppPostStep()
4875  */
4876 
4877  /* function exit code */
4878  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4879  goto __pyx_L0;
4880  __pyx_L1_error:;
4881  __Pyx_XDECREF(__pyx_t_1);
4882  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.postStep", __pyx_clineno, __pyx_lineno, __pyx_filename);
4883  __pyx_r = NULL;
4884  __pyx_L0:;
4885  __Pyx_XDECREF(__pyx_v_pc);
4886  __Pyx_XGIVEREF(__pyx_r);
4887  __Pyx_RefNannyFinishContext();
4888  return __pyx_r;
4889 }
4890 
4891 /* "mprans/cMoveMeshMonitor.pyx":136
4892  * self.cppPostStep()
4893  *
4894  * cdef cppPostStep(self): # <<<<<<<<<<<<<<
4895  * cdef object pc = self.pyCoefficients
4896  * cdef object mesh = pc.mesh
4897  */
4898 
4899 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPostStep(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
4900  PyObject *__pyx_v_pc = 0;
4901  PyObject *__pyx_v_mesh = 0;
4902  int __pyx_v_nd;
4903  __Pyx_memviewslice __pyx_v_elementBoundaryBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4904  __Pyx_memviewslice __pyx_v_elementBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4905  __Pyx_memviewslice __pyx_v_nodeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4906  __Pyx_memviewslice __pyx_v_elementBoundaryNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4907  __Pyx_memviewslice __pyx_v_elementNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4908  __Pyx_memviewslice __pyx_v_elementBoundariesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4909  int __pyx_v_nElementBoundaries_global;
4910  int __pyx_v_nNodes_elementBoundary;
4911  int __pyx_v_nElements_global;
4912  int __pyx_v_nNodes_element;
4913  __Pyx_memviewslice __pyx_v_elementBoundaryNormalsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
4914  int __pyx_v_ebN;
4915  int __pyx_v_nN;
4916  int __pyx_v_eN;
4917  PyObject *__pyx_r = NULL;
4918  __Pyx_RefNannyDeclarations
4919  PyObject *__pyx_t_1 = NULL;
4920  int __pyx_t_2;
4921  __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4922  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4923  PyObject *__pyx_t_5 = NULL;
4924  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4925  int __pyx_t_7;
4926  int __pyx_t_8;
4927  Py_ssize_t __pyx_t_9;
4928  Py_ssize_t __pyx_t_10;
4929  int __pyx_t_11;
4930  int __pyx_t_12;
4931  int __pyx_t_13;
4932  Py_ssize_t __pyx_t_14;
4933  Py_ssize_t __pyx_t_15;
4934  Py_ssize_t __pyx_t_16;
4935  Py_ssize_t __pyx_t_17;
4936  int __pyx_lineno = 0;
4937  const char *__pyx_filename = NULL;
4938  int __pyx_clineno = 0;
4939  __Pyx_RefNannySetupContext("cppPostStep", 0);
4940 
4941  /* "mprans/cMoveMeshMonitor.pyx":137
4942  *
4943  * cdef cppPostStep(self):
4944  * cdef object pc = self.pyCoefficients # <<<<<<<<<<<<<<
4945  * cdef object mesh = pc.mesh
4946  * cdef int nd = pc.nd
4947  */
4948  __pyx_t_1 = __pyx_v_self->pyCoefficients;
4949  __Pyx_INCREF(__pyx_t_1);
4950  __pyx_v_pc = __pyx_t_1;
4951  __pyx_t_1 = 0;
4952 
4953  /* "mprans/cMoveMeshMonitor.pyx":138
4954  * cdef cppPostStep(self):
4955  * cdef object pc = self.pyCoefficients
4956  * cdef object mesh = pc.mesh # <<<<<<<<<<<<<<
4957  * cdef int nd = pc.nd
4958  * cdef double[:,:] elementBoundaryBarycentersArray = mesh.elementBoundaryBarycentersArray
4959  */
4960  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
4961  __Pyx_GOTREF(__pyx_t_1);
4962  __pyx_v_mesh = __pyx_t_1;
4963  __pyx_t_1 = 0;
4964 
4965  /* "mprans/cMoveMeshMonitor.pyx":139
4966  * cdef object pc = self.pyCoefficients
4967  * cdef object mesh = pc.mesh
4968  * cdef int nd = pc.nd # <<<<<<<<<<<<<<
4969  * cdef double[:,:] elementBoundaryBarycentersArray = mesh.elementBoundaryBarycentersArray
4970  * cdef double[:,:] elementBarycentersArray = mesh.elementBarycentersArray
4971  */
4972  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_nd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
4973  __Pyx_GOTREF(__pyx_t_1);
4974  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L1_error)
4975  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4976  __pyx_v_nd = __pyx_t_2;
4977 
4978  /* "mprans/cMoveMeshMonitor.pyx":140
4979  * cdef object mesh = pc.mesh
4980  * cdef int nd = pc.nd
4981  * cdef double[:,:] elementBoundaryBarycentersArray = mesh.elementBoundaryBarycentersArray # <<<<<<<<<<<<<<
4982  * cdef double[:,:] elementBarycentersArray = mesh.elementBarycentersArray
4983  * cdef double[:,:] nodeArray = mesh.nodeArray
4984  */
4985  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBoundaryBarycentersArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
4986  __Pyx_GOTREF(__pyx_t_1);
4987  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 140, __pyx_L1_error)
4988  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4989  __pyx_v_elementBoundaryBarycentersArray = __pyx_t_3;
4990  __pyx_t_3.memview = NULL;
4991  __pyx_t_3.data = NULL;
4992 
4993  /* "mprans/cMoveMeshMonitor.pyx":141
4994  * cdef int nd = pc.nd
4995  * cdef double[:,:] elementBoundaryBarycentersArray = mesh.elementBoundaryBarycentersArray
4996  * cdef double[:,:] elementBarycentersArray = mesh.elementBarycentersArray # <<<<<<<<<<<<<<
4997  * cdef double[:,:] nodeArray = mesh.nodeArray
4998  * cdef int[:,:] elementBoundaryNodesArray = mesh.elementBoundaryNodesArray
4999  */
5000  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBarycentersArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
5001  __Pyx_GOTREF(__pyx_t_1);
5002  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 141, __pyx_L1_error)
5003  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5004  __pyx_v_elementBarycentersArray = __pyx_t_3;
5005  __pyx_t_3.memview = NULL;
5006  __pyx_t_3.data = NULL;
5007 
5008  /* "mprans/cMoveMeshMonitor.pyx":142
5009  * cdef double[:,:] elementBoundaryBarycentersArray = mesh.elementBoundaryBarycentersArray
5010  * cdef double[:,:] elementBarycentersArray = mesh.elementBarycentersArray
5011  * cdef double[:,:] nodeArray = mesh.nodeArray # <<<<<<<<<<<<<<
5012  * cdef int[:,:] elementBoundaryNodesArray = mesh.elementBoundaryNodesArray
5013  * cdef int[:,:] elementNodesArray = mesh.elementNodesArray
5014  */
5015  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nodeArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
5016  __Pyx_GOTREF(__pyx_t_1);
5017  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 142, __pyx_L1_error)
5018  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5019  __pyx_v_nodeArray = __pyx_t_3;
5020  __pyx_t_3.memview = NULL;
5021  __pyx_t_3.data = NULL;
5022 
5023  /* "mprans/cMoveMeshMonitor.pyx":143
5024  * cdef double[:,:] elementBarycentersArray = mesh.elementBarycentersArray
5025  * cdef double[:,:] nodeArray = mesh.nodeArray
5026  * cdef int[:,:] elementBoundaryNodesArray = mesh.elementBoundaryNodesArray # <<<<<<<<<<<<<<
5027  * cdef int[:,:] elementNodesArray = mesh.elementNodesArray
5028  * cdef int[:,:] elementBoundariesArray = mesh.elementBoundariesArray
5029  */
5030  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBoundaryNodesArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
5031  __Pyx_GOTREF(__pyx_t_1);
5032  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 143, __pyx_L1_error)
5033  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5034  __pyx_v_elementBoundaryNodesArray = __pyx_t_4;
5035  __pyx_t_4.memview = NULL;
5036  __pyx_t_4.data = NULL;
5037 
5038  /* "mprans/cMoveMeshMonitor.pyx":144
5039  * cdef double[:,:] nodeArray = mesh.nodeArray
5040  * cdef int[:,:] elementBoundaryNodesArray = mesh.elementBoundaryNodesArray
5041  * cdef int[:,:] elementNodesArray = mesh.elementNodesArray # <<<<<<<<<<<<<<
5042  * cdef int[:,:] elementBoundariesArray = mesh.elementBoundariesArray
5043  * cdef int nElementBoundaries_global = mesh.nElementBoundaries_global
5044  */
5045  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementNodesArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
5046  __Pyx_GOTREF(__pyx_t_1);
5047  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 144, __pyx_L1_error)
5048  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5049  __pyx_v_elementNodesArray = __pyx_t_4;
5050  __pyx_t_4.memview = NULL;
5051  __pyx_t_4.data = NULL;
5052 
5053  /* "mprans/cMoveMeshMonitor.pyx":145
5054  * cdef int[:,:] elementBoundaryNodesArray = mesh.elementBoundaryNodesArray
5055  * cdef int[:,:] elementNodesArray = mesh.elementNodesArray
5056  * cdef int[:,:] elementBoundariesArray = mesh.elementBoundariesArray # <<<<<<<<<<<<<<
5057  * cdef int nElementBoundaries_global = mesh.nElementBoundaries_global
5058  * cdef int nNodes_elementBoundary = mesh.nNodes_elementBoundary
5059  */
5060  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_elementBoundariesArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
5061  __Pyx_GOTREF(__pyx_t_1);
5062  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 145, __pyx_L1_error)
5063  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5064  __pyx_v_elementBoundariesArray = __pyx_t_4;
5065  __pyx_t_4.memview = NULL;
5066  __pyx_t_4.data = NULL;
5067 
5068  /* "mprans/cMoveMeshMonitor.pyx":146
5069  * cdef int[:,:] elementNodesArray = mesh.elementNodesArray
5070  * cdef int[:,:] elementBoundariesArray = mesh.elementBoundariesArray
5071  * cdef int nElementBoundaries_global = mesh.nElementBoundaries_global # <<<<<<<<<<<<<<
5072  * cdef int nNodes_elementBoundary = mesh.nNodes_elementBoundary
5073  * cdef int nElements_global = mesh.nElements_global
5074  */
5075  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nElementBoundaries_global); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
5076  __Pyx_GOTREF(__pyx_t_1);
5077  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error)
5078  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5079  __pyx_v_nElementBoundaries_global = __pyx_t_2;
5080 
5081  /* "mprans/cMoveMeshMonitor.pyx":147
5082  * cdef int[:,:] elementBoundariesArray = mesh.elementBoundariesArray
5083  * cdef int nElementBoundaries_global = mesh.nElementBoundaries_global
5084  * cdef int nNodes_elementBoundary = mesh.nNodes_elementBoundary # <<<<<<<<<<<<<<
5085  * cdef int nElements_global = mesh.nElements_global
5086  * cdef int nNodes_element = mesh.nNodes_element
5087  */
5088  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nNodes_elementBoundary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
5089  __Pyx_GOTREF(__pyx_t_1);
5090  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error)
5091  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5092  __pyx_v_nNodes_elementBoundary = __pyx_t_2;
5093 
5094  /* "mprans/cMoveMeshMonitor.pyx":148
5095  * cdef int nElementBoundaries_global = mesh.nElementBoundaries_global
5096  * cdef int nNodes_elementBoundary = mesh.nNodes_elementBoundary
5097  * cdef int nElements_global = mesh.nElements_global # <<<<<<<<<<<<<<
5098  * cdef int nNodes_element = mesh.nNodes_element
5099  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray
5100  */
5101  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nElements_global); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
5102  __Pyx_GOTREF(__pyx_t_1);
5103  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
5104  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5105  __pyx_v_nElements_global = __pyx_t_2;
5106 
5107  /* "mprans/cMoveMeshMonitor.pyx":149
5108  * cdef int nNodes_elementBoundary = mesh.nNodes_elementBoundary
5109  * cdef int nElements_global = mesh.nElements_global
5110  * cdef int nNodes_element = mesh.nNodes_element # <<<<<<<<<<<<<<
5111  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray
5112  * # update element boundary barycenters
5113  */
5114  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mesh, __pyx_n_s_nNodes_element); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
5115  __Pyx_GOTREF(__pyx_t_1);
5116  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error)
5117  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5118  __pyx_v_nNodes_element = __pyx_t_2;
5119 
5120  /* "mprans/cMoveMeshMonitor.pyx":150
5121  * cdef int nElements_global = mesh.nElements_global
5122  * cdef int nNodes_element = mesh.nNodes_element
5123  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray # <<<<<<<<<<<<<<
5124  * # update element boundary barycenters
5125  * for ebN in range(nElementBoundaries_global):
5126  */
5127  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
5128  __Pyx_GOTREF(__pyx_t_1);
5129  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_elementBoundaryNormalsArray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error)
5130  __Pyx_GOTREF(__pyx_t_5);
5131  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5132  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 150, __pyx_L1_error)
5133  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5134  __pyx_v_elementBoundaryNormalsArray = __pyx_t_6;
5135  __pyx_t_6.memview = NULL;
5136  __pyx_t_6.data = NULL;
5137 
5138  /* "mprans/cMoveMeshMonitor.pyx":152
5139  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray
5140  * # update element boundary barycenters
5141  * for ebN in range(nElementBoundaries_global): # <<<<<<<<<<<<<<
5142  * elementBoundaryBarycentersArray[ebN, 0] = 0.
5143  * elementBoundaryBarycentersArray[ebN, 1] = 0.
5144  */
5145  __pyx_t_2 = __pyx_v_nElementBoundaries_global;
5146  __pyx_t_7 = __pyx_t_2;
5147  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
5148  __pyx_v_ebN = __pyx_t_8;
5149 
5150  /* "mprans/cMoveMeshMonitor.pyx":153
5151  * # update element boundary barycenters
5152  * for ebN in range(nElementBoundaries_global):
5153  * elementBoundaryBarycentersArray[ebN, 0] = 0. # <<<<<<<<<<<<<<
5154  * elementBoundaryBarycentersArray[ebN, 1] = 0.
5155  * elementBoundaryBarycentersArray[ebN, 2] = 0.
5156  */
5157  __pyx_t_9 = __pyx_v_ebN;
5158  __pyx_t_10 = 0;
5159  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5160  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5161  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) = 0.;
5162 
5163  /* "mprans/cMoveMeshMonitor.pyx":154
5164  * for ebN in range(nElementBoundaries_global):
5165  * elementBoundaryBarycentersArray[ebN, 0] = 0.
5166  * elementBoundaryBarycentersArray[ebN, 1] = 0. # <<<<<<<<<<<<<<
5167  * elementBoundaryBarycentersArray[ebN, 2] = 0.
5168  * for nN in range(nNodes_elementBoundary):
5169  */
5170  __pyx_t_10 = __pyx_v_ebN;
5171  __pyx_t_9 = 1;
5172  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5173  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5174  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_10 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) = 0.;
5175 
5176  /* "mprans/cMoveMeshMonitor.pyx":155
5177  * elementBoundaryBarycentersArray[ebN, 0] = 0.
5178  * elementBoundaryBarycentersArray[ebN, 1] = 0.
5179  * elementBoundaryBarycentersArray[ebN, 2] = 0. # <<<<<<<<<<<<<<
5180  * for nN in range(nNodes_elementBoundary):
5181  * elementBoundaryBarycentersArray[ebN, 0] += nodeArray[elementBoundaryNodesArray[ebN, nN], 0]
5182  */
5183  __pyx_t_9 = __pyx_v_ebN;
5184  __pyx_t_10 = 2;
5185  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5186  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5187  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) = 0.;
5188 
5189  /* "mprans/cMoveMeshMonitor.pyx":156
5190  * elementBoundaryBarycentersArray[ebN, 1] = 0.
5191  * elementBoundaryBarycentersArray[ebN, 2] = 0.
5192  * for nN in range(nNodes_elementBoundary): # <<<<<<<<<<<<<<
5193  * elementBoundaryBarycentersArray[ebN, 0] += nodeArray[elementBoundaryNodesArray[ebN, nN], 0]
5194  * elementBoundaryBarycentersArray[ebN, 1] += nodeArray[elementBoundaryNodesArray[ebN, nN], 1]
5195  */
5196  __pyx_t_11 = __pyx_v_nNodes_elementBoundary;
5197  __pyx_t_12 = __pyx_t_11;
5198  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
5199  __pyx_v_nN = __pyx_t_13;
5200 
5201  /* "mprans/cMoveMeshMonitor.pyx":157
5202  * elementBoundaryBarycentersArray[ebN, 2] = 0.
5203  * for nN in range(nNodes_elementBoundary):
5204  * elementBoundaryBarycentersArray[ebN, 0] += nodeArray[elementBoundaryNodesArray[ebN, nN], 0] # <<<<<<<<<<<<<<
5205  * elementBoundaryBarycentersArray[ebN, 1] += nodeArray[elementBoundaryNodesArray[ebN, nN], 1]
5206  * elementBoundaryBarycentersArray[ebN, 2] += nodeArray[elementBoundaryNodesArray[ebN, nN], 2]
5207  */
5208  __pyx_t_10 = __pyx_v_ebN;
5209  __pyx_t_9 = __pyx_v_nN;
5210  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryNodesArray.shape[0];
5211  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryNodesArray.shape[1];
5212  __pyx_t_14 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryNodesArray.data + __pyx_t_10 * __pyx_v_elementBoundaryNodesArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBoundaryNodesArray.strides[1]) )));
5213  __pyx_t_15 = 0;
5214  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeArray.shape[0];
5215  if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_nodeArray.shape[1];
5216  __pyx_t_16 = __pyx_v_ebN;
5217  __pyx_t_17 = 0;
5218  if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5219  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5220  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_16 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) += (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_14 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_15 * __pyx_v_nodeArray.strides[1]) )));
5221 
5222  /* "mprans/cMoveMeshMonitor.pyx":158
5223  * for nN in range(nNodes_elementBoundary):
5224  * elementBoundaryBarycentersArray[ebN, 0] += nodeArray[elementBoundaryNodesArray[ebN, nN], 0]
5225  * elementBoundaryBarycentersArray[ebN, 1] += nodeArray[elementBoundaryNodesArray[ebN, nN], 1] # <<<<<<<<<<<<<<
5226  * elementBoundaryBarycentersArray[ebN, 2] += nodeArray[elementBoundaryNodesArray[ebN, nN], 2]
5227  * elementBoundaryBarycentersArray[ebN, 0] /= nNodes_elementBoundary
5228  */
5229  __pyx_t_9 = __pyx_v_ebN;
5230  __pyx_t_10 = __pyx_v_nN;
5231  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryNodesArray.shape[0];
5232  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryNodesArray.shape[1];
5233  __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryNodesArray.data + __pyx_t_9 * __pyx_v_elementBoundaryNodesArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBoundaryNodesArray.strides[1]) )));
5234  __pyx_t_14 = 1;
5235  if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_nodeArray.shape[0];
5236  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeArray.shape[1];
5237  __pyx_t_17 = __pyx_v_ebN;
5238  __pyx_t_16 = 1;
5239  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5240  if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5241  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_17 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_16 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) += (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_15 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_14 * __pyx_v_nodeArray.strides[1]) )));
5242 
5243  /* "mprans/cMoveMeshMonitor.pyx":159
5244  * elementBoundaryBarycentersArray[ebN, 0] += nodeArray[elementBoundaryNodesArray[ebN, nN], 0]
5245  * elementBoundaryBarycentersArray[ebN, 1] += nodeArray[elementBoundaryNodesArray[ebN, nN], 1]
5246  * elementBoundaryBarycentersArray[ebN, 2] += nodeArray[elementBoundaryNodesArray[ebN, nN], 2] # <<<<<<<<<<<<<<
5247  * elementBoundaryBarycentersArray[ebN, 0] /= nNodes_elementBoundary
5248  * elementBoundaryBarycentersArray[ebN, 1] /= nNodes_elementBoundary
5249  */
5250  __pyx_t_10 = __pyx_v_ebN;
5251  __pyx_t_9 = __pyx_v_nN;
5252  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryNodesArray.shape[0];
5253  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryNodesArray.shape[1];
5254  __pyx_t_14 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryNodesArray.data + __pyx_t_10 * __pyx_v_elementBoundaryNodesArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBoundaryNodesArray.strides[1]) )));
5255  __pyx_t_15 = 2;
5256  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeArray.shape[0];
5257  if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_nodeArray.shape[1];
5258  __pyx_t_16 = __pyx_v_ebN;
5259  __pyx_t_17 = 2;
5260  if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5261  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5262  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_16 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) += (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_14 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_15 * __pyx_v_nodeArray.strides[1]) )));
5263  }
5264 
5265  /* "mprans/cMoveMeshMonitor.pyx":160
5266  * elementBoundaryBarycentersArray[ebN, 1] += nodeArray[elementBoundaryNodesArray[ebN, nN], 1]
5267  * elementBoundaryBarycentersArray[ebN, 2] += nodeArray[elementBoundaryNodesArray[ebN, nN], 2]
5268  * elementBoundaryBarycentersArray[ebN, 0] /= nNodes_elementBoundary # <<<<<<<<<<<<<<
5269  * elementBoundaryBarycentersArray[ebN, 1] /= nNodes_elementBoundary
5270  * elementBoundaryBarycentersArray[ebN, 2] /= nNodes_elementBoundary
5271  */
5272  __pyx_t_9 = __pyx_v_ebN;
5273  __pyx_t_10 = 0;
5274  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5275  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5276  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_elementBoundary;
5277 
5278  /* "mprans/cMoveMeshMonitor.pyx":161
5279  * elementBoundaryBarycentersArray[ebN, 2] += nodeArray[elementBoundaryNodesArray[ebN, nN], 2]
5280  * elementBoundaryBarycentersArray[ebN, 0] /= nNodes_elementBoundary
5281  * elementBoundaryBarycentersArray[ebN, 1] /= nNodes_elementBoundary # <<<<<<<<<<<<<<
5282  * elementBoundaryBarycentersArray[ebN, 2] /= nNodes_elementBoundary
5283  * # update element barycenters
5284  */
5285  __pyx_t_10 = __pyx_v_ebN;
5286  __pyx_t_9 = 1;
5287  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5288  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5289  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_10 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_elementBoundary;
5290 
5291  /* "mprans/cMoveMeshMonitor.pyx":162
5292  * elementBoundaryBarycentersArray[ebN, 0] /= nNodes_elementBoundary
5293  * elementBoundaryBarycentersArray[ebN, 1] /= nNodes_elementBoundary
5294  * elementBoundaryBarycentersArray[ebN, 2] /= nNodes_elementBoundary # <<<<<<<<<<<<<<
5295  * # update element barycenters
5296  * for eN in range(nElements_global):
5297  */
5298  __pyx_t_9 = __pyx_v_ebN;
5299  __pyx_t_10 = 2;
5300  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBoundaryBarycentersArray.shape[0];
5301  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBoundaryBarycentersArray.shape[1];
5302  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBoundaryBarycentersArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBoundaryBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_elementBoundary;
5303  }
5304 
5305  /* "mprans/cMoveMeshMonitor.pyx":164
5306  * elementBoundaryBarycentersArray[ebN, 2] /= nNodes_elementBoundary
5307  * # update element barycenters
5308  * for eN in range(nElements_global): # <<<<<<<<<<<<<<
5309  * elementBarycentersArray[eN, 0] = 0.
5310  * elementBarycentersArray[eN, 1] = 0.
5311  */
5312  __pyx_t_2 = __pyx_v_nElements_global;
5313  __pyx_t_7 = __pyx_t_2;
5314  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
5315  __pyx_v_eN = __pyx_t_8;
5316 
5317  /* "mprans/cMoveMeshMonitor.pyx":165
5318  * # update element barycenters
5319  * for eN in range(nElements_global):
5320  * elementBarycentersArray[eN, 0] = 0. # <<<<<<<<<<<<<<
5321  * elementBarycentersArray[eN, 1] = 0.
5322  * elementBarycentersArray[eN, 2] = 0.
5323  */
5324  __pyx_t_10 = __pyx_v_eN;
5325  __pyx_t_9 = 0;
5326  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBarycentersArray.shape[0];
5327  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[1];
5328  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_10 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[1]) )) = 0.;
5329 
5330  /* "mprans/cMoveMeshMonitor.pyx":166
5331  * for eN in range(nElements_global):
5332  * elementBarycentersArray[eN, 0] = 0.
5333  * elementBarycentersArray[eN, 1] = 0. # <<<<<<<<<<<<<<
5334  * elementBarycentersArray[eN, 2] = 0.
5335  * for ebN in range(nNodes_element):
5336  */
5337  __pyx_t_9 = __pyx_v_eN;
5338  __pyx_t_10 = 1;
5339  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[0];
5340  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBarycentersArray.shape[1];
5341  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBarycentersArray.strides[1]) )) = 0.;
5342 
5343  /* "mprans/cMoveMeshMonitor.pyx":167
5344  * elementBarycentersArray[eN, 0] = 0.
5345  * elementBarycentersArray[eN, 1] = 0.
5346  * elementBarycentersArray[eN, 2] = 0. # <<<<<<<<<<<<<<
5347  * for ebN in range(nNodes_element):
5348  * elementBarycentersArray[eN, 0] += nodeArray[elementNodesArray[eN, ebN], 0]
5349  */
5350  __pyx_t_10 = __pyx_v_eN;
5351  __pyx_t_9 = 2;
5352  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBarycentersArray.shape[0];
5353  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[1];
5354  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_10 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[1]) )) = 0.;
5355 
5356  /* "mprans/cMoveMeshMonitor.pyx":168
5357  * elementBarycentersArray[eN, 1] = 0.
5358  * elementBarycentersArray[eN, 2] = 0.
5359  * for ebN in range(nNodes_element): # <<<<<<<<<<<<<<
5360  * elementBarycentersArray[eN, 0] += nodeArray[elementNodesArray[eN, ebN], 0]
5361  * elementBarycentersArray[eN, 1] += nodeArray[elementNodesArray[eN, ebN], 1]
5362  */
5363  __pyx_t_11 = __pyx_v_nNodes_element;
5364  __pyx_t_12 = __pyx_t_11;
5365  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
5366  __pyx_v_ebN = __pyx_t_13;
5367 
5368  /* "mprans/cMoveMeshMonitor.pyx":169
5369  * elementBarycentersArray[eN, 2] = 0.
5370  * for ebN in range(nNodes_element):
5371  * elementBarycentersArray[eN, 0] += nodeArray[elementNodesArray[eN, ebN], 0] # <<<<<<<<<<<<<<
5372  * elementBarycentersArray[eN, 1] += nodeArray[elementNodesArray[eN, ebN], 1]
5373  * elementBarycentersArray[eN, 2] += nodeArray[elementNodesArray[eN, ebN], 2]
5374  */
5375  __pyx_t_9 = __pyx_v_eN;
5376  __pyx_t_10 = __pyx_v_ebN;
5377  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementNodesArray.shape[0];
5378  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementNodesArray.shape[1];
5379  __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_9 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementNodesArray.strides[1]) )));
5380  __pyx_t_14 = 0;
5381  if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_nodeArray.shape[0];
5382  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeArray.shape[1];
5383  __pyx_t_17 = __pyx_v_eN;
5384  __pyx_t_16 = 0;
5385  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBarycentersArray.shape[0];
5386  if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_elementBarycentersArray.shape[1];
5387  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_17 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_16 * __pyx_v_elementBarycentersArray.strides[1]) )) += (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_15 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_14 * __pyx_v_nodeArray.strides[1]) )));
5388 
5389  /* "mprans/cMoveMeshMonitor.pyx":170
5390  * for ebN in range(nNodes_element):
5391  * elementBarycentersArray[eN, 0] += nodeArray[elementNodesArray[eN, ebN], 0]
5392  * elementBarycentersArray[eN, 1] += nodeArray[elementNodesArray[eN, ebN], 1] # <<<<<<<<<<<<<<
5393  * elementBarycentersArray[eN, 2] += nodeArray[elementNodesArray[eN, ebN], 2]
5394  * elementBarycentersArray[eN, 0] /= nNodes_element
5395  */
5396  __pyx_t_10 = __pyx_v_eN;
5397  __pyx_t_9 = __pyx_v_ebN;
5398  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementNodesArray.shape[0];
5399  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementNodesArray.shape[1];
5400  __pyx_t_14 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_10 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementNodesArray.strides[1]) )));
5401  __pyx_t_15 = 1;
5402  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeArray.shape[0];
5403  if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_nodeArray.shape[1];
5404  __pyx_t_16 = __pyx_v_eN;
5405  __pyx_t_17 = 1;
5406  if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_elementBarycentersArray.shape[0];
5407  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBarycentersArray.shape[1];
5408  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_16 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementBarycentersArray.strides[1]) )) += (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_14 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_15 * __pyx_v_nodeArray.strides[1]) )));
5409 
5410  /* "mprans/cMoveMeshMonitor.pyx":171
5411  * elementBarycentersArray[eN, 0] += nodeArray[elementNodesArray[eN, ebN], 0]
5412  * elementBarycentersArray[eN, 1] += nodeArray[elementNodesArray[eN, ebN], 1]
5413  * elementBarycentersArray[eN, 2] += nodeArray[elementNodesArray[eN, ebN], 2] # <<<<<<<<<<<<<<
5414  * elementBarycentersArray[eN, 0] /= nNodes_element
5415  * elementBarycentersArray[eN, 1] /= nNodes_element
5416  */
5417  __pyx_t_9 = __pyx_v_eN;
5418  __pyx_t_10 = __pyx_v_ebN;
5419  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementNodesArray.shape[0];
5420  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementNodesArray.shape[1];
5421  __pyx_t_15 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_9 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementNodesArray.strides[1]) )));
5422  __pyx_t_14 = 2;
5423  if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_nodeArray.shape[0];
5424  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeArray.shape[1];
5425  __pyx_t_17 = __pyx_v_eN;
5426  __pyx_t_16 = 2;
5427  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBarycentersArray.shape[0];
5428  if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_elementBarycentersArray.shape[1];
5429  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_17 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_16 * __pyx_v_elementBarycentersArray.strides[1]) )) += (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_15 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_14 * __pyx_v_nodeArray.strides[1]) )));
5430  }
5431 
5432  /* "mprans/cMoveMeshMonitor.pyx":172
5433  * elementBarycentersArray[eN, 1] += nodeArray[elementNodesArray[eN, ebN], 1]
5434  * elementBarycentersArray[eN, 2] += nodeArray[elementNodesArray[eN, ebN], 2]
5435  * elementBarycentersArray[eN, 0] /= nNodes_element # <<<<<<<<<<<<<<
5436  * elementBarycentersArray[eN, 1] /= nNodes_element
5437  * elementBarycentersArray[eN, 2] /= nNodes_element
5438  */
5439  __pyx_t_10 = __pyx_v_eN;
5440  __pyx_t_9 = 0;
5441  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBarycentersArray.shape[0];
5442  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[1];
5443  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_10 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_element;
5444 
5445  /* "mprans/cMoveMeshMonitor.pyx":173
5446  * elementBarycentersArray[eN, 2] += nodeArray[elementNodesArray[eN, ebN], 2]
5447  * elementBarycentersArray[eN, 0] /= nNodes_element
5448  * elementBarycentersArray[eN, 1] /= nNodes_element # <<<<<<<<<<<<<<
5449  * elementBarycentersArray[eN, 2] /= nNodes_element
5450  * # update normals
5451  */
5452  __pyx_t_9 = __pyx_v_eN;
5453  __pyx_t_10 = 1;
5454  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[0];
5455  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBarycentersArray.shape[1];
5456  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_10 * __pyx_v_elementBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_element;
5457 
5458  /* "mprans/cMoveMeshMonitor.pyx":174
5459  * elementBarycentersArray[eN, 0] /= nNodes_element
5460  * elementBarycentersArray[eN, 1] /= nNodes_element
5461  * elementBarycentersArray[eN, 2] /= nNodes_element # <<<<<<<<<<<<<<
5462  * # update normals
5463  * if nd == 2:
5464  */
5465  __pyx_t_10 = __pyx_v_eN;
5466  __pyx_t_9 = 2;
5467  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_elementBarycentersArray.shape[0];
5468  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_elementBarycentersArray.shape[1];
5469  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_10 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_9 * __pyx_v_elementBarycentersArray.strides[1]) )) /= __pyx_v_nNodes_element;
5470  }
5471 
5472  /* "mprans/cMoveMeshMonitor.pyx":176
5473  * elementBarycentersArray[eN, 2] /= nNodes_element
5474  * # update normals
5475  * if nd == 2: # <<<<<<<<<<<<<<
5476  * # triangle
5477  * ms.pyxUpdateElementBoundaryNormalsTriangle(elementBoundaryNormalsArray_=elementBoundaryNormalsArray,
5478  */
5479  switch (__pyx_v_nd) {
5480  case 2:
5481 
5482  /* "mprans/cMoveMeshMonitor.pyx":178
5483  * if nd == 2:
5484  * # triangle
5485  * ms.pyxUpdateElementBoundaryNormalsTriangle(elementBoundaryNormalsArray_=elementBoundaryNormalsArray, # <<<<<<<<<<<<<<
5486  * nodeArray=nodeArray,
5487  * elementBoundariesArray=elementBoundariesArray,
5488  */
5489  __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTriangle(__pyx_v_elementBoundaryNormalsArray, __pyx_v_nodeArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryNodesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBarycentersArray, __pyx_v_nElements_global);
5490 
5491  /* "mprans/cMoveMeshMonitor.pyx":176
5492  * elementBarycentersArray[eN, 2] /= nNodes_element
5493  * # update normals
5494  * if nd == 2: # <<<<<<<<<<<<<<
5495  * # triangle
5496  * ms.pyxUpdateElementBoundaryNormalsTriangle(elementBoundaryNormalsArray_=elementBoundaryNormalsArray,
5497  */
5498  break;
5499  case 3:
5500 
5501  /* "mprans/cMoveMeshMonitor.pyx":187
5502  * elif nd == 3:
5503  * # tetra
5504  * ms.pyxUpdateElementBoundaryNormalsTetra(elementBoundaryNormalsArray_=elementBoundaryNormalsArray, # <<<<<<<<<<<<<<
5505  * nodeArray=nodeArray,
5506  * elementBoundariesArray=elementBoundariesArray,
5507  */
5508  __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTetra(__pyx_v_elementBoundaryNormalsArray, __pyx_v_nodeArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryNodesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBarycentersArray, __pyx_v_nElements_global);
5509 
5510  /* "mprans/cMoveMeshMonitor.pyx":185
5511  * elementBarycentersArray=elementBarycentersArray,
5512  * nElements=nElements_global)
5513  * elif nd == 3: # <<<<<<<<<<<<<<
5514  * # tetra
5515  * ms.pyxUpdateElementBoundaryNormalsTetra(elementBoundaryNormalsArray_=elementBoundaryNormalsArray,
5516  */
5517  break;
5518  default: break;
5519  }
5520 
5521  /* "mprans/cMoveMeshMonitor.pyx":136
5522  * self.cppPostStep()
5523  *
5524  * cdef cppPostStep(self): # <<<<<<<<<<<<<<
5525  * cdef object pc = self.pyCoefficients
5526  * cdef object mesh = pc.mesh
5527  */
5528 
5529  /* function exit code */
5530  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5531  goto __pyx_L0;
5532  __pyx_L1_error:;
5533  __Pyx_XDECREF(__pyx_t_1);
5534  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5535  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5536  __Pyx_XDECREF(__pyx_t_5);
5537  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5538  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.cppPostStep", __pyx_clineno, __pyx_lineno, __pyx_filename);
5539  __pyx_r = 0;
5540  __pyx_L0:;
5541  __Pyx_XDECREF(__pyx_v_pc);
5542  __Pyx_XDECREF(__pyx_v_mesh);
5543  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryBarycentersArray, 1);
5544  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBarycentersArray, 1);
5545  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray, 1);
5546  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNodesArray, 1);
5547  __PYX_XDEC_MEMVIEW(&__pyx_v_elementNodesArray, 1);
5548  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundariesArray, 1);
5549  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNormalsArray, 1);
5550  __Pyx_XGIVEREF(__pyx_r);
5551  __Pyx_RefNannyFinishContext();
5552  return __pyx_r;
5553 }
5554 
5555 /* "mprans/cMoveMeshMonitor.pyx":195
5556  * nElements=nElements_global)
5557  *
5558  * def pseudoTimeStepping(self, # <<<<<<<<<<<<<<
5559  * xx,
5560  * eps=1.):
5561  */
5562 
5563 /* Python wrapper */
5564 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_9pseudoTimeStepping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5565 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_9pseudoTimeStepping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5566  PyObject *__pyx_v_xx = 0;
5567  PyObject *__pyx_v_eps = 0;
5568  int __pyx_lineno = 0;
5569  const char *__pyx_filename = NULL;
5570  int __pyx_clineno = 0;
5571  PyObject *__pyx_r = 0;
5572  __Pyx_RefNannyDeclarations
5573  __Pyx_RefNannySetupContext("pseudoTimeStepping (wrapper)", 0);
5574  {
5575  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xx,&__pyx_n_s_eps,0};
5576  PyObject* values[2] = {0,0};
5577  values[1] = ((PyObject *)__pyx_float_1_);
5578  if (unlikely(__pyx_kwds)) {
5579  Py_ssize_t kw_args;
5580  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5581  switch (pos_args) {
5582  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5583  CYTHON_FALLTHROUGH;
5584  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5585  CYTHON_FALLTHROUGH;
5586  case 0: break;
5587  default: goto __pyx_L5_argtuple_error;
5588  }
5589  kw_args = PyDict_Size(__pyx_kwds);
5590  switch (pos_args) {
5591  case 0:
5592  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xx)) != 0)) kw_args--;
5593  else goto __pyx_L5_argtuple_error;
5594  CYTHON_FALLTHROUGH;
5595  case 1:
5596  if (kw_args > 0) {
5597  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eps);
5598  if (value) { values[1] = value; kw_args--; }
5599  }
5600  }
5601  if (unlikely(kw_args > 0)) {
5602  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pseudoTimeStepping") < 0)) __PYX_ERR(0, 195, __pyx_L3_error)
5603  }
5604  } else {
5605  switch (PyTuple_GET_SIZE(__pyx_args)) {
5606  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5607  CYTHON_FALLTHROUGH;
5608  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5609  break;
5610  default: goto __pyx_L5_argtuple_error;
5611  }
5612  }
5613  __pyx_v_xx = values[0];
5614  __pyx_v_eps = values[1];
5615  }
5616  goto __pyx_L4_argument_unpacking_done;
5617  __pyx_L5_argtuple_error:;
5618  __Pyx_RaiseArgtupleInvalid("pseudoTimeStepping", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 195, __pyx_L3_error)
5619  __pyx_L3_error:;
5620  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.pseudoTimeStepping", __pyx_clineno, __pyx_lineno, __pyx_filename);
5621  __Pyx_RefNannyFinishContext();
5622  return NULL;
5623  __pyx_L4_argument_unpacking_done:;
5624  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_8pseudoTimeStepping(((struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self), __pyx_v_xx, __pyx_v_eps);
5625 
5626  /* function exit code */
5627  __Pyx_RefNannyFinishContext();
5628  return __pyx_r;
5629 }
5630 
5631 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_8pseudoTimeStepping(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_xx, PyObject *__pyx_v_eps) {
5632  CYTHON_UNUSED PyObject *__pyx_v_pc = NULL;
5633  PyObject *__pyx_r = NULL;
5634  __Pyx_RefNannyDeclarations
5635  PyObject *__pyx_t_1 = NULL;
5636  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5637  double __pyx_t_3;
5638  int __pyx_lineno = 0;
5639  const char *__pyx_filename = NULL;
5640  int __pyx_clineno = 0;
5641  __Pyx_RefNannySetupContext("pseudoTimeStepping", 0);
5642 
5643  /* "mprans/cMoveMeshMonitor.pyx":198
5644  * xx,
5645  * eps=1.):
5646  * pc = self.pyCoefficients # <<<<<<<<<<<<<<
5647  * return self.cppPseudoTimeSteppingParallel(xx=xx,
5648  * eps=eps)
5649  */
5650  __pyx_t_1 = __pyx_v_self->pyCoefficients;
5651  __Pyx_INCREF(__pyx_t_1);
5652  __pyx_v_pc = __pyx_t_1;
5653  __pyx_t_1 = 0;
5654 
5655  /* "mprans/cMoveMeshMonitor.pyx":199
5656  * eps=1.):
5657  * pc = self.pyCoefficients
5658  * return self.cppPseudoTimeSteppingParallel(xx=xx, # <<<<<<<<<<<<<<
5659  * eps=eps)
5660  *
5661  */
5662  __Pyx_XDECREF(__pyx_r);
5663  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_v_xx, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 199, __pyx_L1_error)
5664 
5665  /* "mprans/cMoveMeshMonitor.pyx":200
5666  * pc = self.pyCoefficients
5667  * return self.cppPseudoTimeSteppingParallel(xx=xx,
5668  * eps=eps) # <<<<<<<<<<<<<<
5669  *
5670  * cdef cppPseudoTimeSteppingParallel(self,
5671  */
5672  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_eps); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error)
5673 
5674  /* "mprans/cMoveMeshMonitor.pyx":199
5675  * eps=1.):
5676  * pc = self.pyCoefficients
5677  * return self.cppPseudoTimeSteppingParallel(xx=xx, # <<<<<<<<<<<<<<
5678  * eps=eps)
5679  *
5680  */
5681  __pyx_t_1 = ((struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self->__pyx_vtab)->cppPseudoTimeSteppingParallel(__pyx_v_self, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
5682  __Pyx_GOTREF(__pyx_t_1);
5683  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5684  __pyx_t_2.memview = NULL;
5685  __pyx_t_2.data = NULL;
5686  __pyx_r = __pyx_t_1;
5687  __pyx_t_1 = 0;
5688  goto __pyx_L0;
5689 
5690  /* "mprans/cMoveMeshMonitor.pyx":195
5691  * nElements=nElements_global)
5692  *
5693  * def pseudoTimeStepping(self, # <<<<<<<<<<<<<<
5694  * xx,
5695  * eps=1.):
5696  */
5697 
5698  /* function exit code */
5699  __pyx_L1_error:;
5700  __Pyx_XDECREF(__pyx_t_1);
5701  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5702  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.pseudoTimeStepping", __pyx_clineno, __pyx_lineno, __pyx_filename);
5703  __pyx_r = NULL;
5704  __pyx_L0:;
5705  __Pyx_XDECREF(__pyx_v_pc);
5706  __Pyx_XGIVEREF(__pyx_r);
5707  __Pyx_RefNannyFinishContext();
5708  return __pyx_r;
5709 }
5710 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
5711 
5712 /* "mprans/cMoveMeshMonitor.pyx":597
5713  * comm.Gatherv(coords_2rank[rank_recv],
5714  * [coords_2doArray,
5715  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)), # <<<<<<<<<<<<<<
5716  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
5717  * MPI.DOUBLE],
5718  */
5719 
5720 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_genexpr(PyObject *__pyx_self) {
5721  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
5722  PyObject *__pyx_r = NULL;
5723  __Pyx_RefNannyDeclarations
5724  int __pyx_lineno = 0;
5725  const char *__pyx_filename = NULL;
5726  int __pyx_clineno = 0;
5727  __Pyx_RefNannySetupContext("genexpr", 0);
5728  __pyx_cur_scope = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *)__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr(__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
5729  if (unlikely(!__pyx_cur_scope)) {
5730  __pyx_cur_scope = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *)Py_None);
5731  __Pyx_INCREF(Py_None);
5732  __PYX_ERR(0, 597, __pyx_L1_error)
5733  } else {
5734  __Pyx_GOTREF(__pyx_cur_scope);
5735  }
5736  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *) __pyx_self;
5737  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
5738  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
5739  {
5740  __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_cCoefficients_cppPseudoTimeStepp, __pyx_n_s_mprans_cMoveMeshMonitor); if (unlikely(!gen)) __PYX_ERR(0, 597, __pyx_L1_error)
5741  __Pyx_DECREF(__pyx_cur_scope);
5742  __Pyx_RefNannyFinishContext();
5743  return (PyObject *) gen;
5744  }
5745 
5746  /* function exit code */
5747  __pyx_L1_error:;
5748  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5749  __pyx_r = NULL;
5750  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5751  __Pyx_XGIVEREF(__pyx_r);
5752  __Pyx_RefNannyFinishContext();
5753  return __pyx_r;
5754 }
5755 
5756 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
5757 {
5758  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
5759  PyObject *__pyx_r = NULL;
5760  int __pyx_t_1;
5761  int __pyx_t_2;
5762  int __pyx_t_3;
5763  Py_ssize_t __pyx_t_4;
5764  PyObject *__pyx_t_5 = NULL;
5765  int __pyx_lineno = 0;
5766  const char *__pyx_filename = NULL;
5767  int __pyx_clineno = 0;
5768  __Pyx_RefNannyDeclarations
5769  __Pyx_RefNannySetupContext("genexpr", 0);
5770  switch (__pyx_generator->resume_label) {
5771  case 0: goto __pyx_L3_first_run;
5772  case 1: goto __pyx_L6_resume_from_yield;
5773  default: /* CPython raises the right error here */
5774  __Pyx_RefNannyFinishContext();
5775  return NULL;
5776  }
5777  __pyx_L3_first_run:;
5778  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 597, __pyx_L1_error)
5779  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_comm_size;
5780  __pyx_t_2 = __pyx_t_1;
5781  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5782  __pyx_cur_scope->__pyx_v_i = __pyx_t_3;
5783  __pyx_t_4 = __pyx_cur_scope->__pyx_v_i;
5784  if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_cur_scope->__pyx_outer_scope->__pyx_v_counts_in.shape[0];
5785  __pyx_t_5 = PyInt_FromSsize_t(((*((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_counts_in.data + __pyx_t_4 * __pyx_cur_scope->__pyx_outer_scope->__pyx_v_counts_in.strides[0]) ))) * (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_coords_2doArray.shape[1]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error)
5786  __Pyx_GOTREF(__pyx_t_5);
5787  __pyx_r = __pyx_t_5;
5788  __pyx_t_5 = 0;
5789  __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
5790  __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
5791  __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
5792  __Pyx_XGIVEREF(__pyx_r);
5793  __Pyx_RefNannyFinishContext();
5794  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
5795  /* return from generator, yielding value */
5796  __pyx_generator->resume_label = 1;
5797  return __pyx_r;
5798  __pyx_L6_resume_from_yield:;
5799  __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
5800  __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
5801  __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
5802  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 597, __pyx_L1_error)
5803  }
5804  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
5805 
5806  /* function exit code */
5807  PyErr_SetNone(PyExc_StopIteration);
5808  goto __pyx_L0;
5809  __pyx_L1_error:;
5810  __Pyx_XDECREF(__pyx_t_5);
5811  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5812  __pyx_L0:;
5813  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
5814  #if !CYTHON_USE_EXC_INFO_STACK
5815  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
5816  #endif
5817  __pyx_generator->resume_label = -1;
5818  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
5819  __Pyx_RefNannyFinishContext();
5820  return __pyx_r;
5821 }
5822 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_5generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
5823 
5824 /* "mprans/cMoveMeshMonitor.pyx":598
5825  * [coords_2doArray,
5826  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
5827  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)), # <<<<<<<<<<<<<<
5828  * MPI.DOUBLE],
5829  * root=rank_recv)
5830  */
5831 
5832 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_3genexpr(PyObject *__pyx_self) {
5833  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *__pyx_cur_scope;
5834  PyObject *__pyx_r = NULL;
5835  __Pyx_RefNannyDeclarations
5836  int __pyx_lineno = 0;
5837  const char *__pyx_filename = NULL;
5838  int __pyx_clineno = 0;
5839  __Pyx_RefNannySetupContext("genexpr", 0);
5840  __pyx_cur_scope = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *)__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr(__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL);
5841  if (unlikely(!__pyx_cur_scope)) {
5842  __pyx_cur_scope = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *)Py_None);
5843  __Pyx_INCREF(Py_None);
5844  __PYX_ERR(0, 598, __pyx_L1_error)
5845  } else {
5846  __Pyx_GOTREF(__pyx_cur_scope);
5847  }
5848  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *) __pyx_self;
5849  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
5850  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
5851  {
5852  __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_5generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_cCoefficients_cppPseudoTimeStepp, __pyx_n_s_mprans_cMoveMeshMonitor); if (unlikely(!gen)) __PYX_ERR(0, 598, __pyx_L1_error)
5853  __Pyx_DECREF(__pyx_cur_scope);
5854  __Pyx_RefNannyFinishContext();
5855  return (PyObject *) gen;
5856  }
5857 
5858  /* function exit code */
5859  __pyx_L1_error:;
5860  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5861  __pyx_r = NULL;
5862  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5863  __Pyx_XGIVEREF(__pyx_r);
5864  __Pyx_RefNannyFinishContext();
5865  return __pyx_r;
5866 }
5867 
5868 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_5generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
5869 {
5870  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *)__pyx_generator->closure);
5871  PyObject *__pyx_r = NULL;
5872  int __pyx_t_1;
5873  int __pyx_t_2;
5874  int __pyx_t_3;
5875  Py_ssize_t __pyx_t_4;
5876  PyObject *__pyx_t_5 = NULL;
5877  int __pyx_lineno = 0;
5878  const char *__pyx_filename = NULL;
5879  int __pyx_clineno = 0;
5880  __Pyx_RefNannyDeclarations
5881  __Pyx_RefNannySetupContext("genexpr", 0);
5882  switch (__pyx_generator->resume_label) {
5883  case 0: goto __pyx_L3_first_run;
5884  case 1: goto __pyx_L6_resume_from_yield;
5885  default: /* CPython raises the right error here */
5886  __Pyx_RefNannyFinishContext();
5887  return NULL;
5888  }
5889  __pyx_L3_first_run:;
5890  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 598, __pyx_L1_error)
5891  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_comm_size;
5892  __pyx_t_2 = __pyx_t_1;
5893  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5894  __pyx_cur_scope->__pyx_v_i = __pyx_t_3;
5895  __pyx_t_4 = __pyx_cur_scope->__pyx_v_i;
5896  if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_cur_scope->__pyx_outer_scope->__pyx_v_displacements_in.shape[0];
5897  __pyx_t_5 = PyInt_FromSsize_t(((*((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_displacements_in.data + __pyx_t_4 * __pyx_cur_scope->__pyx_outer_scope->__pyx_v_displacements_in.strides[0]) ))) * (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_coords_2doArray.shape[1]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 598, __pyx_L1_error)
5898  __Pyx_GOTREF(__pyx_t_5);
5899  __pyx_r = __pyx_t_5;
5900  __pyx_t_5 = 0;
5901  __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
5902  __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
5903  __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
5904  __Pyx_XGIVEREF(__pyx_r);
5905  __Pyx_RefNannyFinishContext();
5906  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
5907  /* return from generator, yielding value */
5908  __pyx_generator->resume_label = 1;
5909  return __pyx_r;
5910  __pyx_L6_resume_from_yield:;
5911  __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
5912  __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
5913  __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
5914  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 598, __pyx_L1_error)
5915  }
5916  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
5917 
5918  /* function exit code */
5919  PyErr_SetNone(PyExc_StopIteration);
5920  goto __pyx_L0;
5921  __pyx_L1_error:;
5922  __Pyx_XDECREF(__pyx_t_5);
5923  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5924  __pyx_L0:;
5925  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
5926  #if !CYTHON_USE_EXC_INFO_STACK
5927  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
5928  #endif
5929  __pyx_generator->resume_label = -1;
5930  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
5931  __Pyx_RefNannyFinishContext();
5932  return __pyx_r;
5933 }
5934 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_8generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
5935 
5936 /* "mprans/cMoveMeshMonitor.pyx":793
5937  * comm.Gatherv(coords_2rank[rank_recv],
5938  * [coords_2doArray,
5939  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)), # <<<<<<<<<<<<<<
5940  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
5941  * MPI.DOUBLE],
5942  */
5943 
5944 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_6genexpr(PyObject *__pyx_self) {
5945  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
5946  PyObject *__pyx_r = NULL;
5947  __Pyx_RefNannyDeclarations
5948  int __pyx_lineno = 0;
5949  const char *__pyx_filename = NULL;
5950  int __pyx_clineno = 0;
5951  __Pyx_RefNannySetupContext("genexpr", 0);
5952  __pyx_cur_scope = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *)__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr(__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
5953  if (unlikely(!__pyx_cur_scope)) {
5954  __pyx_cur_scope = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *)Py_None);
5955  __Pyx_INCREF(Py_None);
5956  __PYX_ERR(0, 793, __pyx_L1_error)
5957  } else {
5958  __Pyx_GOTREF(__pyx_cur_scope);
5959  }
5960  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *) __pyx_self;
5961  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
5962  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
5963  {
5964  __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_8generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_cCoefficients_cppPseudoTimeStepp, __pyx_n_s_mprans_cMoveMeshMonitor); if (unlikely(!gen)) __PYX_ERR(0, 793, __pyx_L1_error)
5965  __Pyx_DECREF(__pyx_cur_scope);
5966  __Pyx_RefNannyFinishContext();
5967  return (PyObject *) gen;
5968  }
5969 
5970  /* function exit code */
5971  __pyx_L1_error:;
5972  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5973  __pyx_r = NULL;
5974  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5975  __Pyx_XGIVEREF(__pyx_r);
5976  __Pyx_RefNannyFinishContext();
5977  return __pyx_r;
5978 }
5979 
5980 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_8generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
5981 {
5982  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
5983  PyObject *__pyx_r = NULL;
5984  int __pyx_t_1;
5985  int __pyx_t_2;
5986  int __pyx_t_3;
5987  Py_ssize_t __pyx_t_4;
5988  PyObject *__pyx_t_5 = NULL;
5989  int __pyx_lineno = 0;
5990  const char *__pyx_filename = NULL;
5991  int __pyx_clineno = 0;
5992  __Pyx_RefNannyDeclarations
5993  __Pyx_RefNannySetupContext("genexpr", 0);
5994  switch (__pyx_generator->resume_label) {
5995  case 0: goto __pyx_L3_first_run;
5996  case 1: goto __pyx_L6_resume_from_yield;
5997  default: /* CPython raises the right error here */
5998  __Pyx_RefNannyFinishContext();
5999  return NULL;
6000  }
6001  __pyx_L3_first_run:;
6002  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 793, __pyx_L1_error)
6003  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_comm_size;
6004  __pyx_t_2 = __pyx_t_1;
6005  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6006  __pyx_cur_scope->__pyx_v_i = __pyx_t_3;
6007  __pyx_t_4 = __pyx_cur_scope->__pyx_v_i;
6008  if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_cur_scope->__pyx_outer_scope->__pyx_v_counts_in.shape[0];
6009  __pyx_t_5 = PyInt_FromSsize_t(((*((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_counts_in.data + __pyx_t_4 * __pyx_cur_scope->__pyx_outer_scope->__pyx_v_counts_in.strides[0]) ))) * (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_coords_2doArray.shape[1]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error)
6010  __Pyx_GOTREF(__pyx_t_5);
6011  __pyx_r = __pyx_t_5;
6012  __pyx_t_5 = 0;
6013  __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
6014  __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
6015  __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
6016  __Pyx_XGIVEREF(__pyx_r);
6017  __Pyx_RefNannyFinishContext();
6018  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
6019  /* return from generator, yielding value */
6020  __pyx_generator->resume_label = 1;
6021  return __pyx_r;
6022  __pyx_L6_resume_from_yield:;
6023  __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
6024  __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
6025  __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
6026  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 793, __pyx_L1_error)
6027  }
6028  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
6029 
6030  /* function exit code */
6031  PyErr_SetNone(PyExc_StopIteration);
6032  goto __pyx_L0;
6033  __pyx_L1_error:;
6034  __Pyx_XDECREF(__pyx_t_5);
6035  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
6036  __pyx_L0:;
6037  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
6038  #if !CYTHON_USE_EXC_INFO_STACK
6039  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
6040  #endif
6041  __pyx_generator->resume_label = -1;
6042  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
6043  __Pyx_RefNannyFinishContext();
6044  return __pyx_r;
6045 }
6046 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_11generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
6047 
6048 /* "mprans/cMoveMeshMonitor.pyx":794
6049  * [coords_2doArray,
6050  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
6051  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)), # <<<<<<<<<<<<<<
6052  * MPI.DOUBLE],
6053  * root=rank_recv)
6054  */
6055 
6056 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_9genexpr(PyObject *__pyx_self) {
6057  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *__pyx_cur_scope;
6058  PyObject *__pyx_r = NULL;
6059  __Pyx_RefNannyDeclarations
6060  int __pyx_lineno = 0;
6061  const char *__pyx_filename = NULL;
6062  int __pyx_clineno = 0;
6063  __Pyx_RefNannySetupContext("genexpr", 0);
6064  __pyx_cur_scope = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *)__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr(__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL);
6065  if (unlikely(!__pyx_cur_scope)) {
6066  __pyx_cur_scope = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *)Py_None);
6067  __Pyx_INCREF(Py_None);
6068  __PYX_ERR(0, 794, __pyx_L1_error)
6069  } else {
6070  __Pyx_GOTREF(__pyx_cur_scope);
6071  }
6072  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *) __pyx_self;
6073  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
6074  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
6075  {
6076  __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_11generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_cCoefficients_cppPseudoTimeStepp, __pyx_n_s_mprans_cMoveMeshMonitor); if (unlikely(!gen)) __PYX_ERR(0, 794, __pyx_L1_error)
6077  __Pyx_DECREF(__pyx_cur_scope);
6078  __Pyx_RefNannyFinishContext();
6079  return (PyObject *) gen;
6080  }
6081 
6082  /* function exit code */
6083  __pyx_L1_error:;
6084  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
6085  __pyx_r = NULL;
6086  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
6087  __Pyx_XGIVEREF(__pyx_r);
6088  __Pyx_RefNannyFinishContext();
6089  return __pyx_r;
6090 }
6091 
6092 static PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_11generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
6093 {
6094  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *)__pyx_generator->closure);
6095  PyObject *__pyx_r = NULL;
6096  int __pyx_t_1;
6097  int __pyx_t_2;
6098  int __pyx_t_3;
6099  Py_ssize_t __pyx_t_4;
6100  PyObject *__pyx_t_5 = NULL;
6101  int __pyx_lineno = 0;
6102  const char *__pyx_filename = NULL;
6103  int __pyx_clineno = 0;
6104  __Pyx_RefNannyDeclarations
6105  __Pyx_RefNannySetupContext("genexpr", 0);
6106  switch (__pyx_generator->resume_label) {
6107  case 0: goto __pyx_L3_first_run;
6108  case 1: goto __pyx_L6_resume_from_yield;
6109  default: /* CPython raises the right error here */
6110  __Pyx_RefNannyFinishContext();
6111  return NULL;
6112  }
6113  __pyx_L3_first_run:;
6114  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 794, __pyx_L1_error)
6115  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_comm_size;
6116  __pyx_t_2 = __pyx_t_1;
6117  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6118  __pyx_cur_scope->__pyx_v_i = __pyx_t_3;
6119  __pyx_t_4 = __pyx_cur_scope->__pyx_v_i;
6120  if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_cur_scope->__pyx_outer_scope->__pyx_v_displacements_in.shape[0];
6121  __pyx_t_5 = PyInt_FromSsize_t(((*((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_displacements_in.data + __pyx_t_4 * __pyx_cur_scope->__pyx_outer_scope->__pyx_v_displacements_in.strides[0]) ))) * (__pyx_cur_scope->__pyx_outer_scope->__pyx_v_coords_2doArray.shape[1]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 794, __pyx_L1_error)
6122  __Pyx_GOTREF(__pyx_t_5);
6123  __pyx_r = __pyx_t_5;
6124  __pyx_t_5 = 0;
6125  __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
6126  __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
6127  __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
6128  __Pyx_XGIVEREF(__pyx_r);
6129  __Pyx_RefNannyFinishContext();
6130  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
6131  /* return from generator, yielding value */
6132  __pyx_generator->resume_label = 1;
6133  return __pyx_r;
6134  __pyx_L6_resume_from_yield:;
6135  __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
6136  __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
6137  __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
6138  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 794, __pyx_L1_error)
6139  }
6140  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
6141 
6142  /* function exit code */
6143  PyErr_SetNone(PyExc_StopIteration);
6144  goto __pyx_L0;
6145  __pyx_L1_error:;
6146  __Pyx_XDECREF(__pyx_t_5);
6147  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
6148  __pyx_L0:;
6149  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
6150  #if !CYTHON_USE_EXC_INFO_STACK
6151  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
6152  #endif
6153  __pyx_generator->resume_label = -1;
6154  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
6155  __Pyx_RefNannyFinishContext();
6156  return __pyx_r;
6157 }
6158 
6159 /* "mprans/cMoveMeshMonitor.pyx":202
6160  * eps=eps)
6161  *
6162  * cdef cppPseudoTimeSteppingParallel(self, # <<<<<<<<<<<<<<
6163  * double[:,:] xx,
6164  * double eps):
6165  */
6166 
6167 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPseudoTimeSteppingParallel(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, __Pyx_memviewslice __pyx_v_xx, double __pyx_v_eps) {
6168  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *__pyx_cur_scope;
6169  PyObject *__pyx_v_pc = NULL;
6170  int __pyx_v_ntimes_solved;
6171  int __pyx_v_ntimes_i;
6172  double __pyx_v_t_min;
6173  double __pyx_v_t_max;
6174  __Pyx_memviewslice __pyx_v_t_range = { 0, 0, { 0 }, { 0 }, { 0 } };
6175  int __pyx_v_ntimesteps;
6176  __Pyx_memviewslice __pyx_v_eN_phi = { 0, 0, { 0 }, { 0 }, { 0 } };
6177  __Pyx_memviewslice __pyx_v_normal = { 0, 0, { 0 }, { 0 }, { 0 } };
6178  double __pyx_v_t_last;
6179  double __pyx_v_dt;
6180  int __pyx_v_flag;
6181  bool __pyx_v_fixed;
6182  double __pyx_v_area;
6183  int __pyx_v_eN;
6184  double __pyx_v_ls_phi;
6185  double __pyx_v_f;
6186  double __pyx_v_Ccoeff;
6187  int __pyx_v_nd;
6188  __Pyx_memviewslice __pyx_v_dphi = { 0, 0, { 0 }, { 0 }, { 0 } };
6189  __Pyx_memviewslice __pyx_v_grads = { 0, 0, { 0 }, { 0 }, { 0 } };
6190  __Pyx_memviewslice __pyx_v_v_grad = { 0, 0, { 0 }, { 0 }, { 0 } };
6191  __Pyx_memviewslice __pyx_v_areas_nodes = { 0, 0, { 0 }, { 0 }, { 0 } };
6192  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_areas = { 0, 0, { 0 }, { 0 }, { 0 } };
6193  __Pyx_memviewslice __pyx_v_u_phi = { 0, 0, { 0 }, { 0 }, { 0 } };
6194  int __pyx_v_i;
6195  int __pyx_v_ii;
6196  int __pyx_v_iN;
6197  PyObject *__pyx_v_femSpace = 0;
6198  __Pyx_memviewslice __pyx_v_nodeArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6199  __Pyx_memviewslice __pyx_v_nodeStarOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
6200  __Pyx_memviewslice __pyx_v_nodeStarArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6201  __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
6202  __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6203  __Pyx_memviewslice __pyx_v_nodeMaterialTypes = { 0, 0, { 0 }, { 0 }, { 0 } };
6204  __Pyx_memviewslice __pyx_v_elementBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6205  __Pyx_memviewslice __pyx_v_elementBoundaryElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6206  __Pyx_memviewslice __pyx_v_elementBoundariesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6207  __Pyx_memviewslice __pyx_v_elementNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6208  __Pyx_memviewslice __pyx_v_elementBoundaryBarycentersArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6209  __Pyx_memviewslice __pyx_v_exteriorElementBoundariesBoolArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6210  int __pyx_v_bb_i;
6211  __Pyx_memviewslice __pyx_v_elementBoundaryNormalsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6212  int __pyx_v_nNodes_owned;
6213  int __pyx_v_nNodes_global;
6214  int __pyx_v_nElements_owned;
6215  CYTHON_UNUSED int __pyx_v_nElements_global;
6216  __Pyx_memviewslice __pyx_v_nodeNumbering_subdomain2global = { 0, 0, { 0 }, { 0 }, { 0 } };
6217  __Pyx_memviewslice __pyx_v_elementNumbering_subdomain2global = { 0, 0, { 0 }, { 0 }, { 0 } };
6218  __Pyx_memviewslice __pyx_v_nodeOffsets_subdomain_owned = { 0, 0, { 0 }, { 0 }, { 0 } };
6219  __Pyx_memviewslice __pyx_v_elementOffsets_subdomain_owned = { 0, 0, { 0 }, { 0 }, { 0 } };
6220  __Pyx_memviewslice __pyx_v_nearestNArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6221  __Pyx_memviewslice __pyx_v_typeNArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6222  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_elementNeighborsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6223  int __pyx_v_nElementBoundaries_owned;
6224  __Pyx_memviewslice __pyx_v_elementBoundaryNumbering_subdomain2global = { 0, 0, { 0 }, { 0 }, { 0 } };
6225  __Pyx_memviewslice __pyx_v_elementBoundaryOffsets_subdomain_owned = { 0, 0, { 0 }, { 0 }, { 0 } };
6226  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_elementBoundaryNodesArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6227  __Pyx_memviewslice __pyx_v_fixedNodesBoolArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6228  int __pyx_v_nSmoothOut;
6229  int __pyx_v_nSmoothIn;
6230  int __pyx_v_nSmooth;
6231  bool __pyx_v_inside_eN;
6232  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_vec = { 0, 0, { 0 }, { 0 }, { 0 } };
6233  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_vec2 = { 0, 0, { 0 }, { 0 }, { 0 } };
6234  __Pyx_memviewslice __pyx_v_fixed_dir = { 0, 0, { 0 }, { 0 }, { 0 } };
6235  int __pyx_v_nearestN;
6236  int __pyx_v_typeN;
6237  PyObject *__pyx_v_comm = NULL;
6238  int __pyx_v_my_rank;
6239  __Pyx_memviewslice __pyx_v_counts_local = { 0, 0, { 0 }, { 0 }, { 0 } };
6240  __Pyx_memviewslice __pyx_v_counts_total = { 0, 0, { 0 }, { 0 }, { 0 } };
6241  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_counts_out = { 0, 0, { 0 }, { 0 }, { 0 } };
6242  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_displacements_out = { 0, 0, { 0 }, { 0 }, { 0 } };
6243  int __pyx_v_ncomm;
6244  PyObject *__pyx_v_coords_2rank = 0;
6245  CYTHON_UNUSED PyObject *__pyx_v_nodes0_2rank = 0;
6246  CYTHON_UNUSED PyObject *__pyx_v_rank0_2rank = 0;
6247  CYTHON_UNUSED PyObject *__pyx_v_nearestN_2rank = 0;
6248  CYTHON_UNUSED PyObject *__pyx_v_typeN_2rank = 0;
6249  CYTHON_UNUSED PyObject *__pyx_v_dir_2rank = 0;
6250  CYTHON_UNUSED PyObject *__pyx_v_b_i_2rank = 0;
6251  bool __pyx_v_sendBack;
6252  int __pyx_v_nPending_disp;
6253  int __pyx_v_nPending_disp_total;
6254  int __pyx_v_node;
6255  int __pyx_v_node0;
6256  int __pyx_v_nNodes;
6257  double __pyx_v_dot;
6258  double __pyx_v_t;
6259  int __pyx_v_j;
6260  int __pyx_v_i_time;
6261  int __pyx_v_parallel_steps;
6262  int __pyx_v_new_rank;
6263  __Pyx_memviewslice __pyx_v_coords = { 0, 0, { 0 }, { 0 }, { 0 } };
6264  CYTHON_UNUSED int __pyx_v_b_i_global;
6265  __Pyx_memviewslice __pyx_v_bound_bar = { 0, 0, { 0 }, { 0 }, { 0 } };
6266  __Pyx_memviewslice __pyx_v_result = { 0, 0, { 0 }, { 0 }, { 0 } };
6267  CYTHON_UNUSED double __pyx_v_array_size_local;
6268  PyObject *__pyx_v_rank = NULL;
6269  __Pyx_memviewslice __pyx_v_nodesSentBoolArray = { 0, 0, { 0 }, { 0 }, { 0 } };
6270  CYTHON_UNUSED bool __pyx_v_pending;
6271  CYTHON_UNUSED __Pyx_memviewslice __pyx_v_starting_coords = { 0, 0, { 0 }, { 0 }, { 0 } };
6272  int __pyx_v_nEbn;
6273  int __pyx_v_nNel;
6274  int __pyx_v_ndi;
6275  PyObject *__pyx_v_exc = NULL;
6276  PyObject *__pyx_v_xi = NULL;
6277  int __pyx_v_rank_recv;
6278  PyObject *__pyx_v_array_size = NULL;
6279  CYTHON_UNUSED PyObject *__pyx_v_datatype = NULL;
6280  PyObject *__pyx_v_solFound_2doArray = NULL;
6281  PyObject *__pyx_v_rank0 = NULL;
6282  int __pyx_v_ind;
6283  CYTHON_UNUSED int __pyx_v_iS;
6284  int __pyx_v_simultaneous;
6285  PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_2generator = 0;
6286  PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_5generator1 = 0;
6287  PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_8generator2 = 0;
6288  PyObject *__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_11generator3 = 0;
6289  PyObject *__pyx_r = NULL;
6290  __Pyx_RefNannyDeclarations
6291  PyObject *__pyx_t_1 = NULL;
6292  int __pyx_t_2;
6293  PyObject *__pyx_t_3 = NULL;
6294  PyObject *__pyx_t_4 = NULL;
6295  PyObject *__pyx_t_5 = NULL;
6296  PyObject *__pyx_t_6 = NULL;
6297  PyObject *__pyx_t_7 = NULL;
6298  PyObject *__pyx_t_8 = NULL;
6299  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
6300  size_t __pyx_t_10;
6301  __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
6302  double __pyx_t_12;
6303  __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
6304  __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
6305  Py_ssize_t __pyx_t_15;
6306  PyObject *(*__pyx_t_16)(PyObject *);
6307  Py_ssize_t __pyx_t_17;
6308  __Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } };
6309  int __pyx_t_19;
6310  int __pyx_t_20;
6311  int __pyx_t_21;
6312  int __pyx_t_22;
6313  int __pyx_t_23;
6314  int __pyx_t_24;
6315  Py_ssize_t __pyx_t_25;
6316  Py_ssize_t __pyx_t_26;
6317  int __pyx_t_27;
6318  int __pyx_t_28;
6319  int __pyx_t_29;
6320  int __pyx_t_30;
6321  Py_ssize_t __pyx_t_31;
6322  Py_ssize_t __pyx_t_32;
6323  Py_ssize_t __pyx_t_33;
6324  Py_ssize_t __pyx_t_34;
6325  Py_ssize_t __pyx_t_35;
6326  Py_ssize_t __pyx_t_36;
6327  PyObject *__pyx_t_37 = NULL;
6328  PyObject *__pyx_t_38 = NULL;
6329  PyObject *__pyx_t_39 = NULL;
6330  int __pyx_t_40;
6331  Py_ssize_t __pyx_t_41;
6332  PyObject *__pyx_t_42 = NULL;
6333  PyObject *__pyx_t_43 = NULL;
6334  PyObject *__pyx_t_44 = NULL;
6335  PyObject *__pyx_t_45 = NULL;
6336  PyObject *__pyx_t_46 = NULL;
6337  PyObject *__pyx_t_47 = NULL;
6338  Py_ssize_t __pyx_t_48;
6339  Py_ssize_t __pyx_t_49;
6340  PyObject *__pyx_t_50 = NULL;
6341  PyObject *__pyx_t_51 = NULL;
6342  PyObject *__pyx_t_52 = NULL;
6343  PyObject *__pyx_t_53 = NULL;
6344  int __pyx_lineno = 0;
6345  const char *__pyx_filename = NULL;
6346  int __pyx_clineno = 0;
6347  __Pyx_RefNannySetupContext("cppPseudoTimeSteppingParallel", 0);
6348  __pyx_cur_scope = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *)__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel(__pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel, __pyx_empty_tuple, NULL);
6349  if (unlikely(!__pyx_cur_scope)) {
6350  __pyx_cur_scope = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *)Py_None);
6351  __Pyx_INCREF(Py_None);
6352  __PYX_ERR(0, 202, __pyx_L1_error)
6353  } else {
6354  __Pyx_GOTREF(__pyx_cur_scope);
6355  }
6356 
6357  /* "mprans/cMoveMeshMonitor.pyx":205
6358  * double[:,:] xx,
6359  * double eps):
6360  * pc = self.pyCoefficients # <<<<<<<<<<<<<<
6361  * cdef int ntimes_solved = pc.ntimes_solved
6362  * cdef int ntimes_i = pc.ntimes_i
6363  */
6364  __pyx_t_1 = __pyx_v_self->pyCoefficients;
6365  __Pyx_INCREF(__pyx_t_1);
6366  __pyx_v_pc = __pyx_t_1;
6367  __pyx_t_1 = 0;
6368 
6369  /* "mprans/cMoveMeshMonitor.pyx":206
6370  * double eps):
6371  * pc = self.pyCoefficients
6372  * cdef int ntimes_solved = pc.ntimes_solved # <<<<<<<<<<<<<<
6373  * cdef int ntimes_i = pc.ntimes_i
6374  * cdef double t_min = 1./ntimes_solved*(ntimes_i)
6375  */
6376  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_ntimes_solved); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
6377  __Pyx_GOTREF(__pyx_t_1);
6378  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L1_error)
6379  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6380  __pyx_v_ntimes_solved = __pyx_t_2;
6381 
6382  /* "mprans/cMoveMeshMonitor.pyx":207
6383  * pc = self.pyCoefficients
6384  * cdef int ntimes_solved = pc.ntimes_solved
6385  * cdef int ntimes_i = pc.ntimes_i # <<<<<<<<<<<<<<
6386  * cdef double t_min = 1./ntimes_solved*(ntimes_i)
6387  * cdef double t_max = t_min+1./ntimes_solved
6388  */
6389  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_ntimes_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
6390  __Pyx_GOTREF(__pyx_t_1);
6391  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L1_error)
6392  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6393  __pyx_v_ntimes_i = __pyx_t_2;
6394 
6395  /* "mprans/cMoveMeshMonitor.pyx":208
6396  * cdef int ntimes_solved = pc.ntimes_solved
6397  * cdef int ntimes_i = pc.ntimes_i
6398  * cdef double t_min = 1./ntimes_solved*(ntimes_i) # <<<<<<<<<<<<<<
6399  * cdef double t_max = t_min+1./ntimes_solved
6400  * logEvent("Pseudo-time stepping with dt={eps} ({t_min}<t<{t_max})".format(eps=eps, t_max=t_max, t_min=t_min),
6401  */
6402  __pyx_v_t_min = ((1. / __pyx_v_ntimes_solved) * __pyx_v_ntimes_i);
6403 
6404  /* "mprans/cMoveMeshMonitor.pyx":209
6405  * cdef int ntimes_i = pc.ntimes_i
6406  * cdef double t_min = 1./ntimes_solved*(ntimes_i)
6407  * cdef double t_max = t_min+1./ntimes_solved # <<<<<<<<<<<<<<
6408  * logEvent("Pseudo-time stepping with dt={eps} ({t_min}<t<{t_max})".format(eps=eps, t_max=t_max, t_min=t_min),
6409  * level=3)
6410  */
6411  __pyx_v_t_max = (__pyx_v_t_min + (1. / __pyx_v_ntimes_solved));
6412 
6413  /* "mprans/cMoveMeshMonitor.pyx":210
6414  * cdef double t_min = 1./ntimes_solved*(ntimes_i)
6415  * cdef double t_max = t_min+1./ntimes_solved
6416  * logEvent("Pseudo-time stepping with dt={eps} ({t_min}<t<{t_max})".format(eps=eps, t_max=t_max, t_min=t_min), # <<<<<<<<<<<<<<
6417  * level=3)
6418  * cdef double[:] t_range = np.linspace(t_min, t_max, int((t_max-t_min)/eps+1))[1:]
6419  */
6420  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
6421  __Pyx_GOTREF(__pyx_t_1);
6422  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Pseudo_time_stepping_with_dt_eps, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
6423  __Pyx_GOTREF(__pyx_t_3);
6424  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
6425  __Pyx_GOTREF(__pyx_t_4);
6426  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error)
6427  __Pyx_GOTREF(__pyx_t_5);
6428  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_eps, __pyx_t_5) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
6429  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6430  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_t_max); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error)
6431  __Pyx_GOTREF(__pyx_t_5);
6432  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_t_max, __pyx_t_5) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
6433  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6434  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_t_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error)
6435  __Pyx_GOTREF(__pyx_t_5);
6436  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_t_min, __pyx_t_5) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
6437  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6438  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error)
6439  __Pyx_GOTREF(__pyx_t_5);
6440  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6441  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6442  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
6443  __Pyx_GOTREF(__pyx_t_4);
6444  __Pyx_GIVEREF(__pyx_t_5);
6445  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6446  __pyx_t_5 = 0;
6447 
6448  /* "mprans/cMoveMeshMonitor.pyx":211
6449  * cdef double t_max = t_min+1./ntimes_solved
6450  * logEvent("Pseudo-time stepping with dt={eps} ({t_min}<t<{t_max})".format(eps=eps, t_max=t_max, t_min=t_min),
6451  * level=3) # <<<<<<<<<<<<<<
6452  * cdef double[:] t_range = np.linspace(t_min, t_max, int((t_max-t_min)/eps+1))[1:]
6453  * cdef int ntimesteps = len(t_range)
6454  */
6455  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
6456  __Pyx_GOTREF(__pyx_t_5);
6457  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_level, __pyx_int_3) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
6458 
6459  /* "mprans/cMoveMeshMonitor.pyx":210
6460  * cdef double t_min = 1./ntimes_solved*(ntimes_i)
6461  * cdef double t_max = t_min+1./ntimes_solved
6462  * logEvent("Pseudo-time stepping with dt={eps} ({t_min}<t<{t_max})".format(eps=eps, t_max=t_max, t_min=t_min), # <<<<<<<<<<<<<<
6463  * level=3)
6464  * cdef double[:] t_range = np.linspace(t_min, t_max, int((t_max-t_min)/eps+1))[1:]
6465  */
6466  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
6467  __Pyx_GOTREF(__pyx_t_3);
6468  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6469  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6470  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6471  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6472 
6473  /* "mprans/cMoveMeshMonitor.pyx":212
6474  * logEvent("Pseudo-time stepping with dt={eps} ({t_min}<t<{t_max})".format(eps=eps, t_max=t_max, t_min=t_min),
6475  * level=3)
6476  * cdef double[:] t_range = np.linspace(t_min, t_max, int((t_max-t_min)/eps+1))[1:] # <<<<<<<<<<<<<<
6477  * cdef int ntimesteps = len(t_range)
6478  * cdef int[:] eN_phi = np.zeros(len(xx), dtype=np.int32)
6479  */
6480  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
6481  __Pyx_GOTREF(__pyx_t_5);
6482  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_linspace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
6483  __Pyx_GOTREF(__pyx_t_4);
6484  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6485  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_t_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error)
6486  __Pyx_GOTREF(__pyx_t_5);
6487  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_t_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
6488  __Pyx_GOTREF(__pyx_t_1);
6489  __pyx_t_6 = __Pyx_PyInt_FromDouble((((__pyx_v_t_max - __pyx_v_t_min) / __pyx_v_eps) + 1.0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error)
6490  __Pyx_GOTREF(__pyx_t_6);
6491  __pyx_t_7 = NULL;
6492  __pyx_t_2 = 0;
6493  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
6494  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
6495  if (likely(__pyx_t_7)) {
6496  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
6497  __Pyx_INCREF(__pyx_t_7);
6498  __Pyx_INCREF(function);
6499  __Pyx_DECREF_SET(__pyx_t_4, function);
6500  __pyx_t_2 = 1;
6501  }
6502  }
6503  #if CYTHON_FAST_PYCALL
6504  if (PyFunction_Check(__pyx_t_4)) {
6505  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_5, __pyx_t_1, __pyx_t_6};
6506  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_2, 3+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
6507  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6508  __Pyx_GOTREF(__pyx_t_3);
6509  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6510  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6511  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6512  } else
6513  #endif
6514  #if CYTHON_FAST_PYCCALL
6515  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
6516  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_5, __pyx_t_1, __pyx_t_6};
6517  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_2, 3+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
6518  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6519  __Pyx_GOTREF(__pyx_t_3);
6520  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6521  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6522  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6523  } else
6524  #endif
6525  {
6526  __pyx_t_8 = PyTuple_New(3+__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L1_error)
6527  __Pyx_GOTREF(__pyx_t_8);
6528  if (__pyx_t_7) {
6529  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
6530  }
6531  __Pyx_GIVEREF(__pyx_t_5);
6532  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_2, __pyx_t_5);
6533  __Pyx_GIVEREF(__pyx_t_1);
6534  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_2, __pyx_t_1);
6535  __Pyx_GIVEREF(__pyx_t_6);
6536  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_2, __pyx_t_6);
6537  __pyx_t_5 = 0;
6538  __pyx_t_1 = 0;
6539  __pyx_t_6 = 0;
6540  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
6541  __Pyx_GOTREF(__pyx_t_3);
6542  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6543  }
6544  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6545  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_3, 1, 0, NULL, NULL, &__pyx_slice__4, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
6546  __Pyx_GOTREF(__pyx_t_4);
6547  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6548  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 212, __pyx_L1_error)
6549  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6550  __pyx_v_t_range = __pyx_t_9;
6551  __pyx_t_9.memview = NULL;
6552  __pyx_t_9.data = NULL;
6553 
6554  /* "mprans/cMoveMeshMonitor.pyx":213
6555  * level=3)
6556  * cdef double[:] t_range = np.linspace(t_min, t_max, int((t_max-t_min)/eps+1))[1:]
6557  * cdef int ntimesteps = len(t_range) # <<<<<<<<<<<<<<
6558  * cdef int[:] eN_phi = np.zeros(len(xx), dtype=np.int32)
6559  * cdef double[:] normal = np.zeros(3)
6560  */
6561  __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_v_t_range);
6562  __pyx_v_ntimesteps = __pyx_t_10;
6563 
6564  /* "mprans/cMoveMeshMonitor.pyx":214
6565  * cdef double[:] t_range = np.linspace(t_min, t_max, int((t_max-t_min)/eps+1))[1:]
6566  * cdef int ntimesteps = len(t_range)
6567  * cdef int[:] eN_phi = np.zeros(len(xx), dtype=np.int32) # <<<<<<<<<<<<<<
6568  * cdef double[:] normal = np.zeros(3)
6569  * cdef double t_last = t_min
6570  */
6571  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
6572  __Pyx_GOTREF(__pyx_t_4);
6573  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
6574  __Pyx_GOTREF(__pyx_t_3);
6575  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6576  __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_v_xx);
6577  __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
6578  __Pyx_GOTREF(__pyx_t_4);
6579  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 214, __pyx_L1_error)
6580  __Pyx_GOTREF(__pyx_t_8);
6581  __Pyx_GIVEREF(__pyx_t_4);
6582  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
6583  __pyx_t_4 = 0;
6584  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
6585  __Pyx_GOTREF(__pyx_t_4);
6586  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error)
6587  __Pyx_GOTREF(__pyx_t_6);
6588  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
6589  __Pyx_GOTREF(__pyx_t_1);
6590  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6591  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
6592  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6593  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
6594  __Pyx_GOTREF(__pyx_t_1);
6595  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6596  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6597  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6598  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 214, __pyx_L1_error)
6599  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6600  __pyx_v_eN_phi = __pyx_t_11;
6601  __pyx_t_11.memview = NULL;
6602  __pyx_t_11.data = NULL;
6603 
6604  /* "mprans/cMoveMeshMonitor.pyx":215
6605  * cdef int ntimesteps = len(t_range)
6606  * cdef int[:] eN_phi = np.zeros(len(xx), dtype=np.int32)
6607  * cdef double[:] normal = np.zeros(3) # <<<<<<<<<<<<<<
6608  * cdef double t_last = t_min
6609  * cdef double dt = 0
6610  */
6611  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
6612  __Pyx_GOTREF(__pyx_t_4);
6613  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error)
6614  __Pyx_GOTREF(__pyx_t_8);
6615  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6616  __pyx_t_4 = NULL;
6617  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
6618  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
6619  if (likely(__pyx_t_4)) {
6620  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
6621  __Pyx_INCREF(__pyx_t_4);
6622  __Pyx_INCREF(function);
6623  __Pyx_DECREF_SET(__pyx_t_8, function);
6624  }
6625  }
6626  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_int_3);
6627  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6628  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
6629  __Pyx_GOTREF(__pyx_t_1);
6630  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6631  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 215, __pyx_L1_error)
6632  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6633  __pyx_v_normal = __pyx_t_9;
6634  __pyx_t_9.memview = NULL;
6635  __pyx_t_9.data = NULL;
6636 
6637  /* "mprans/cMoveMeshMonitor.pyx":216
6638  * cdef int[:] eN_phi = np.zeros(len(xx), dtype=np.int32)
6639  * cdef double[:] normal = np.zeros(3)
6640  * cdef double t_last = t_min # <<<<<<<<<<<<<<
6641  * cdef double dt = 0
6642  * cdef int flag
6643  */
6644  __pyx_v_t_last = __pyx_v_t_min;
6645 
6646  /* "mprans/cMoveMeshMonitor.pyx":217
6647  * cdef double[:] normal = np.zeros(3)
6648  * cdef double t_last = t_min
6649  * cdef double dt = 0 # <<<<<<<<<<<<<<
6650  * cdef int flag
6651  * cdef bool fixed
6652  */
6653  __pyx_v_dt = 0.0;
6654 
6655  /* "mprans/cMoveMeshMonitor.pyx":220
6656  * cdef int flag
6657  * cdef bool fixed
6658  * cdef double area = 0 # <<<<<<<<<<<<<<
6659  * cdef int eN, eeN
6660  * cdef double ls_phi
6661  */
6662  __pyx_v_area = 0.0;
6663 
6664  /* "mprans/cMoveMeshMonitor.pyx":224
6665  * cdef double ls_phi
6666  * cdef double f
6667  * cdef double Ccoeff = pc.C # <<<<<<<<<<<<<<
6668  * cdef int nd = pc.nd
6669  * cdef double[:] dphi = np.zeros(nd)
6670  */
6671  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_C); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
6672  __Pyx_GOTREF(__pyx_t_1);
6673  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error)
6674  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6675  __pyx_v_Ccoeff = __pyx_t_12;
6676 
6677  /* "mprans/cMoveMeshMonitor.pyx":225
6678  * cdef double f
6679  * cdef double Ccoeff = pc.C
6680  * cdef int nd = pc.nd # <<<<<<<<<<<<<<
6681  * cdef double[:] dphi = np.zeros(nd)
6682  * cdef double[:,:] grads = pc.grads
6683  */
6684  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_nd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
6685  __Pyx_GOTREF(__pyx_t_1);
6686  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
6687  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6688  __pyx_v_nd = __pyx_t_2;
6689 
6690  /* "mprans/cMoveMeshMonitor.pyx":226
6691  * cdef double Ccoeff = pc.C
6692  * cdef int nd = pc.nd
6693  * cdef double[:] dphi = np.zeros(nd) # <<<<<<<<<<<<<<
6694  * cdef double[:,:] grads = pc.grads
6695  * cdef double[:] v_grad = np.zeros(3)
6696  */
6697  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 226, __pyx_L1_error)
6698  __Pyx_GOTREF(__pyx_t_8);
6699  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
6700  __Pyx_GOTREF(__pyx_t_4);
6701  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6702  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nd); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 226, __pyx_L1_error)
6703  __Pyx_GOTREF(__pyx_t_8);
6704  __pyx_t_3 = NULL;
6705  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
6706  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
6707  if (likely(__pyx_t_3)) {
6708  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
6709  __Pyx_INCREF(__pyx_t_3);
6710  __Pyx_INCREF(function);
6711  __Pyx_DECREF_SET(__pyx_t_4, function);
6712  }
6713  }
6714  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
6715  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6716  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6717  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
6718  __Pyx_GOTREF(__pyx_t_1);
6719  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6720  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 226, __pyx_L1_error)
6721  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6722  __pyx_v_dphi = __pyx_t_9;
6723  __pyx_t_9.memview = NULL;
6724  __pyx_t_9.data = NULL;
6725 
6726  /* "mprans/cMoveMeshMonitor.pyx":227
6727  * cdef int nd = pc.nd
6728  * cdef double[:] dphi = np.zeros(nd)
6729  * cdef double[:,:] grads = pc.grads # <<<<<<<<<<<<<<
6730  * cdef double[:] v_grad = np.zeros(3)
6731  * cdef double[:] areas_nodes = pc.areas_nodes,
6732  */
6733  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_grads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
6734  __Pyx_GOTREF(__pyx_t_1);
6735  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 227, __pyx_L1_error)
6736  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6737  __pyx_v_grads = __pyx_t_13;
6738  __pyx_t_13.memview = NULL;
6739  __pyx_t_13.data = NULL;
6740 
6741  /* "mprans/cMoveMeshMonitor.pyx":228
6742  * cdef double[:] dphi = np.zeros(nd)
6743  * cdef double[:,:] grads = pc.grads
6744  * cdef double[:] v_grad = np.zeros(3) # <<<<<<<<<<<<<<
6745  * cdef double[:] areas_nodes = pc.areas_nodes,
6746  * cdef double[:] areas = pc.areas
6747  */
6748  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
6749  __Pyx_GOTREF(__pyx_t_4);
6750  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 228, __pyx_L1_error)
6751  __Pyx_GOTREF(__pyx_t_8);
6752  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6753  __pyx_t_4 = NULL;
6754  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
6755  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
6756  if (likely(__pyx_t_4)) {
6757  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
6758  __Pyx_INCREF(__pyx_t_4);
6759  __Pyx_INCREF(function);
6760  __Pyx_DECREF_SET(__pyx_t_8, function);
6761  }
6762  }
6763  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_int_3);
6764  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6765  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
6766  __Pyx_GOTREF(__pyx_t_1);
6767  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6768  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 228, __pyx_L1_error)
6769  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6770  __pyx_v_v_grad = __pyx_t_9;
6771  __pyx_t_9.memview = NULL;
6772  __pyx_t_9.data = NULL;
6773 
6774  /* "mprans/cMoveMeshMonitor.pyx":229
6775  * cdef double[:,:] grads = pc.grads
6776  * cdef double[:] v_grad = np.zeros(3)
6777  * cdef double[:] areas_nodes = pc.areas_nodes, # <<<<<<<<<<<<<<
6778  * cdef double[:] areas = pc.areas
6779  * cdef double[:] u_phi = pc.u_phi
6780  */
6781  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_areas_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
6782  __Pyx_GOTREF(__pyx_t_1);
6783  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 229, __pyx_L1_error)
6784  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6785  __pyx_v_areas_nodes = __pyx_t_9;
6786  __pyx_t_9.memview = NULL;
6787  __pyx_t_9.data = NULL;
6788 
6789  /* "mprans/cMoveMeshMonitor.pyx":230
6790  * cdef double[:] v_grad = np.zeros(3)
6791  * cdef double[:] areas_nodes = pc.areas_nodes,
6792  * cdef double[:] areas = pc.areas # <<<<<<<<<<<<<<
6793  * cdef double[:] u_phi = pc.u_phi
6794  * cdef int i, ii
6795  */
6796  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_areas); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
6797  __Pyx_GOTREF(__pyx_t_1);
6798  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 230, __pyx_L1_error)
6799  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6800  __pyx_v_areas = __pyx_t_9;
6801  __pyx_t_9.memview = NULL;
6802  __pyx_t_9.data = NULL;
6803 
6804  /* "mprans/cMoveMeshMonitor.pyx":231
6805  * cdef double[:] areas_nodes = pc.areas_nodes,
6806  * cdef double[:] areas = pc.areas
6807  * cdef double[:] u_phi = pc.u_phi # <<<<<<<<<<<<<<
6808  * cdef int i, ii
6809  * cdef int iN
6810  */
6811  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_u_phi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
6812  __Pyx_GOTREF(__pyx_t_1);
6813  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
6814  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6815  __pyx_v_u_phi = __pyx_t_9;
6816  __pyx_t_9.memview = NULL;
6817  __pyx_t_9.data = NULL;
6818 
6819  /* "mprans/cMoveMeshMonitor.pyx":234
6820  * cdef int i, ii
6821  * cdef int iN
6822  * cdef object femSpace = pc.model.u[0].femSpace # <<<<<<<<<<<<<<
6823  * cdef bool find_nearest_node
6824  * # initialise mesh memoryview before loop
6825  */
6826  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_model); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
6827  __Pyx_GOTREF(__pyx_t_1);
6828  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_u); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error)
6829  __Pyx_GOTREF(__pyx_t_8);
6830  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6831  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
6832  __Pyx_GOTREF(__pyx_t_1);
6833  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6834  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_femSpace); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error)
6835  __Pyx_GOTREF(__pyx_t_8);
6836  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6837  __pyx_v_femSpace = __pyx_t_8;
6838  __pyx_t_8 = 0;
6839 
6840  /* "mprans/cMoveMeshMonitor.pyx":237
6841  * cdef bool find_nearest_node
6842  * # initialise mesh memoryview before loop
6843  * cdef double[:,:] nodeArray = pc.mesh.nodeArray # <<<<<<<<<<<<<<
6844  * cdef int[:] nodeStarOffsets = pc.mesh.nodeStarOffsets
6845  * cdef int[:] nodeStarArray = pc.mesh.nodeStarArray
6846  */
6847  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error)
6848  __Pyx_GOTREF(__pyx_t_8);
6849  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nodeArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
6850  __Pyx_GOTREF(__pyx_t_1);
6851  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6852  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 237, __pyx_L1_error)
6853  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6854  __pyx_v_nodeArray = __pyx_t_13;
6855  __pyx_t_13.memview = NULL;
6856  __pyx_t_13.data = NULL;
6857 
6858  /* "mprans/cMoveMeshMonitor.pyx":238
6859  * # initialise mesh memoryview before loop
6860  * cdef double[:,:] nodeArray = pc.mesh.nodeArray
6861  * cdef int[:] nodeStarOffsets = pc.mesh.nodeStarOffsets # <<<<<<<<<<<<<<
6862  * cdef int[:] nodeStarArray = pc.mesh.nodeStarArray
6863  * cdef int[:] nodeElementOffsets = pc.mesh.nodeElementOffsets
6864  */
6865  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
6866  __Pyx_GOTREF(__pyx_t_1);
6867  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nodeStarOffsets); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error)
6868  __Pyx_GOTREF(__pyx_t_8);
6869  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6870  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 238, __pyx_L1_error)
6871  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6872  __pyx_v_nodeStarOffsets = __pyx_t_11;
6873  __pyx_t_11.memview = NULL;
6874  __pyx_t_11.data = NULL;
6875 
6876  /* "mprans/cMoveMeshMonitor.pyx":239
6877  * cdef double[:,:] nodeArray = pc.mesh.nodeArray
6878  * cdef int[:] nodeStarOffsets = pc.mesh.nodeStarOffsets
6879  * cdef int[:] nodeStarArray = pc.mesh.nodeStarArray # <<<<<<<<<<<<<<
6880  * cdef int[:] nodeElementOffsets = pc.mesh.nodeElementOffsets
6881  * cdef int[:] nodeElementsArray = pc.mesh.nodeElementsArray
6882  */
6883  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error)
6884  __Pyx_GOTREF(__pyx_t_8);
6885  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nodeStarArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
6886  __Pyx_GOTREF(__pyx_t_1);
6887  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6888  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 239, __pyx_L1_error)
6889  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6890  __pyx_v_nodeStarArray = __pyx_t_11;
6891  __pyx_t_11.memview = NULL;
6892  __pyx_t_11.data = NULL;
6893 
6894  /* "mprans/cMoveMeshMonitor.pyx":240
6895  * cdef int[:] nodeStarOffsets = pc.mesh.nodeStarOffsets
6896  * cdef int[:] nodeStarArray = pc.mesh.nodeStarArray
6897  * cdef int[:] nodeElementOffsets = pc.mesh.nodeElementOffsets # <<<<<<<<<<<<<<
6898  * cdef int[:] nodeElementsArray = pc.mesh.nodeElementsArray
6899  * cdef int[:] nodeMaterialTypes = pc.mesh.nodeMaterialTypes
6900  */
6901  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
6902  __Pyx_GOTREF(__pyx_t_1);
6903  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nodeElementOffsets); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error)
6904  __Pyx_GOTREF(__pyx_t_8);
6905  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6906  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 240, __pyx_L1_error)
6907  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6908  __pyx_v_nodeElementOffsets = __pyx_t_11;
6909  __pyx_t_11.memview = NULL;
6910  __pyx_t_11.data = NULL;
6911 
6912  /* "mprans/cMoveMeshMonitor.pyx":241
6913  * cdef int[:] nodeStarArray = pc.mesh.nodeStarArray
6914  * cdef int[:] nodeElementOffsets = pc.mesh.nodeElementOffsets
6915  * cdef int[:] nodeElementsArray = pc.mesh.nodeElementsArray # <<<<<<<<<<<<<<
6916  * cdef int[:] nodeMaterialTypes = pc.mesh.nodeMaterialTypes
6917  * cdef double[:,:] elementBarycentersArray = pc.mesh.elementBarycentersArray
6918  */
6919  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error)
6920  __Pyx_GOTREF(__pyx_t_8);
6921  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_nodeElementsArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
6922  __Pyx_GOTREF(__pyx_t_1);
6923  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6924  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 241, __pyx_L1_error)
6925  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6926  __pyx_v_nodeElementsArray = __pyx_t_11;
6927  __pyx_t_11.memview = NULL;
6928  __pyx_t_11.data = NULL;
6929 
6930  /* "mprans/cMoveMeshMonitor.pyx":242
6931  * cdef int[:] nodeElementOffsets = pc.mesh.nodeElementOffsets
6932  * cdef int[:] nodeElementsArray = pc.mesh.nodeElementsArray
6933  * cdef int[:] nodeMaterialTypes = pc.mesh.nodeMaterialTypes # <<<<<<<<<<<<<<
6934  * cdef double[:,:] elementBarycentersArray = pc.mesh.elementBarycentersArray
6935  * cdef int[:,:] elementBoundaryElementsArray = pc.mesh.elementBoundaryElementsArray
6936  */
6937  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
6938  __Pyx_GOTREF(__pyx_t_1);
6939  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nodeMaterialTypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error)
6940  __Pyx_GOTREF(__pyx_t_8);
6941  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6942  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 242, __pyx_L1_error)
6943  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6944  __pyx_v_nodeMaterialTypes = __pyx_t_11;
6945  __pyx_t_11.memview = NULL;
6946  __pyx_t_11.data = NULL;
6947 
6948  /* "mprans/cMoveMeshMonitor.pyx":243
6949  * cdef int[:] nodeElementsArray = pc.mesh.nodeElementsArray
6950  * cdef int[:] nodeMaterialTypes = pc.mesh.nodeMaterialTypes
6951  * cdef double[:,:] elementBarycentersArray = pc.mesh.elementBarycentersArray # <<<<<<<<<<<<<<
6952  * cdef int[:,:] elementBoundaryElementsArray = pc.mesh.elementBoundaryElementsArray
6953  * cdef int[:,:] elementBoundariesArray = pc.mesh.elementBoundariesArray
6954  */
6955  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error)
6956  __Pyx_GOTREF(__pyx_t_8);
6957  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_elementBarycentersArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
6958  __Pyx_GOTREF(__pyx_t_1);
6959  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6960  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 243, __pyx_L1_error)
6961  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6962  __pyx_v_elementBarycentersArray = __pyx_t_13;
6963  __pyx_t_13.memview = NULL;
6964  __pyx_t_13.data = NULL;
6965 
6966  /* "mprans/cMoveMeshMonitor.pyx":244
6967  * cdef int[:] nodeMaterialTypes = pc.mesh.nodeMaterialTypes
6968  * cdef double[:,:] elementBarycentersArray = pc.mesh.elementBarycentersArray
6969  * cdef int[:,:] elementBoundaryElementsArray = pc.mesh.elementBoundaryElementsArray # <<<<<<<<<<<<<<
6970  * cdef int[:,:] elementBoundariesArray = pc.mesh.elementBoundariesArray
6971  * cdef int[:,:] elementNodesArray = pc.mesh.elementNodesArray
6972  */
6973  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
6974  __Pyx_GOTREF(__pyx_t_1);
6975  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_elementBoundaryElementsArray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 244, __pyx_L1_error)
6976  __Pyx_GOTREF(__pyx_t_8);
6977  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6978  __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 244, __pyx_L1_error)
6979  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6980  __pyx_v_elementBoundaryElementsArray = __pyx_t_14;
6981  __pyx_t_14.memview = NULL;
6982  __pyx_t_14.data = NULL;
6983 
6984  /* "mprans/cMoveMeshMonitor.pyx":245
6985  * cdef double[:,:] elementBarycentersArray = pc.mesh.elementBarycentersArray
6986  * cdef int[:,:] elementBoundaryElementsArray = pc.mesh.elementBoundaryElementsArray
6987  * cdef int[:,:] elementBoundariesArray = pc.mesh.elementBoundariesArray # <<<<<<<<<<<<<<
6988  * cdef int[:,:] elementNodesArray = pc.mesh.elementNodesArray
6989  * cdef double[:,:] elementBoundaryBarycentersArray = pc.mesh.elementBoundaryBarycentersArray
6990  */
6991  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 245, __pyx_L1_error)
6992  __Pyx_GOTREF(__pyx_t_8);
6993  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_elementBoundariesArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
6994  __Pyx_GOTREF(__pyx_t_1);
6995  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6996  __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 245, __pyx_L1_error)
6997  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6998  __pyx_v_elementBoundariesArray = __pyx_t_14;
6999  __pyx_t_14.memview = NULL;
7000  __pyx_t_14.data = NULL;
7001 
7002  /* "mprans/cMoveMeshMonitor.pyx":246
7003  * cdef int[:,:] elementBoundaryElementsArray = pc.mesh.elementBoundaryElementsArray
7004  * cdef int[:,:] elementBoundariesArray = pc.mesh.elementBoundariesArray
7005  * cdef int[:,:] elementNodesArray = pc.mesh.elementNodesArray # <<<<<<<<<<<<<<
7006  * cdef double[:,:] elementBoundaryBarycentersArray = pc.mesh.elementBoundaryBarycentersArray
7007  * cdef int[:] exteriorElementBoundariesBoolArray = np.zeros(pc.mesh.nElementBoundaries_global, dtype=np.int32)
7008  */
7009  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
7010  __Pyx_GOTREF(__pyx_t_1);
7011  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_elementNodesArray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 246, __pyx_L1_error)
7012  __Pyx_GOTREF(__pyx_t_8);
7013  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7014  __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 246, __pyx_L1_error)
7015  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7016  __pyx_v_elementNodesArray = __pyx_t_14;
7017  __pyx_t_14.memview = NULL;
7018  __pyx_t_14.data = NULL;
7019 
7020  /* "mprans/cMoveMeshMonitor.pyx":247
7021  * cdef int[:,:] elementBoundariesArray = pc.mesh.elementBoundariesArray
7022  * cdef int[:,:] elementNodesArray = pc.mesh.elementNodesArray
7023  * cdef double[:,:] elementBoundaryBarycentersArray = pc.mesh.elementBoundaryBarycentersArray # <<<<<<<<<<<<<<
7024  * cdef int[:] exteriorElementBoundariesBoolArray = np.zeros(pc.mesh.nElementBoundaries_global, dtype=np.int32)
7025  * cdef int bb_i
7026  */
7027  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 247, __pyx_L1_error)
7028  __Pyx_GOTREF(__pyx_t_8);
7029  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_elementBoundaryBarycentersArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
7030  __Pyx_GOTREF(__pyx_t_1);
7031  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7032  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 247, __pyx_L1_error)
7033  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7034  __pyx_v_elementBoundaryBarycentersArray = __pyx_t_13;
7035  __pyx_t_13.memview = NULL;
7036  __pyx_t_13.data = NULL;
7037 
7038  /* "mprans/cMoveMeshMonitor.pyx":248
7039  * cdef int[:,:] elementNodesArray = pc.mesh.elementNodesArray
7040  * cdef double[:,:] elementBoundaryBarycentersArray = pc.mesh.elementBoundaryBarycentersArray
7041  * cdef int[:] exteriorElementBoundariesBoolArray = np.zeros(pc.mesh.nElementBoundaries_global, dtype=np.int32) # <<<<<<<<<<<<<<
7042  * cdef int bb_i
7043  * for bb_i in pc.mesh.exteriorElementBoundariesArray:
7044  */
7045  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
7046  __Pyx_GOTREF(__pyx_t_1);
7047  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 248, __pyx_L1_error)
7048  __Pyx_GOTREF(__pyx_t_8);
7049  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7050  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
7051  __Pyx_GOTREF(__pyx_t_1);
7052  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nElementBoundaries_global); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
7053  __Pyx_GOTREF(__pyx_t_4);
7054  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7055  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
7056  __Pyx_GOTREF(__pyx_t_1);
7057  __Pyx_GIVEREF(__pyx_t_4);
7058  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
7059  __pyx_t_4 = 0;
7060  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
7061  __Pyx_GOTREF(__pyx_t_4);
7062  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
7063  __Pyx_GOTREF(__pyx_t_3);
7064  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error)
7065  __Pyx_GOTREF(__pyx_t_6);
7066  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7067  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
7068  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7069  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error)
7070  __Pyx_GOTREF(__pyx_t_6);
7071  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7072  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7073  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7074  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 248, __pyx_L1_error)
7075  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7076  __pyx_v_exteriorElementBoundariesBoolArray = __pyx_t_11;
7077  __pyx_t_11.memview = NULL;
7078  __pyx_t_11.data = NULL;
7079 
7080  /* "mprans/cMoveMeshMonitor.pyx":250
7081  * cdef int[:] exteriorElementBoundariesBoolArray = np.zeros(pc.mesh.nElementBoundaries_global, dtype=np.int32)
7082  * cdef int bb_i
7083  * for bb_i in pc.mesh.exteriorElementBoundariesArray: # <<<<<<<<<<<<<<
7084  * exteriorElementBoundariesBoolArray[bb_i] = 1
7085  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray
7086  */
7087  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error)
7088  __Pyx_GOTREF(__pyx_t_6);
7089  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exteriorElementBoundariesArray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
7090  __Pyx_GOTREF(__pyx_t_4);
7091  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7092  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
7093  __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_15 = 0;
7094  __pyx_t_16 = NULL;
7095  } else {
7096  __pyx_t_15 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error)
7097  __Pyx_GOTREF(__pyx_t_6);
7098  __pyx_t_16 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 250, __pyx_L1_error)
7099  }
7100  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7101  for (;;) {
7102  if (likely(!__pyx_t_16)) {
7103  if (likely(PyList_CheckExact(__pyx_t_6))) {
7104  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_6)) break;
7105  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7106  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
7107  #else
7108  __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
7109  __Pyx_GOTREF(__pyx_t_4);
7110  #endif
7111  } else {
7112  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
7113  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7114  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
7115  #else
7116  __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
7117  __Pyx_GOTREF(__pyx_t_4);
7118  #endif
7119  }
7120  } else {
7121  __pyx_t_4 = __pyx_t_16(__pyx_t_6);
7122  if (unlikely(!__pyx_t_4)) {
7123  PyObject* exc_type = PyErr_Occurred();
7124  if (exc_type) {
7125  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7126  else __PYX_ERR(0, 250, __pyx_L1_error)
7127  }
7128  break;
7129  }
7130  __Pyx_GOTREF(__pyx_t_4);
7131  }
7132  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L1_error)
7133  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7134  __pyx_v_bb_i = __pyx_t_2;
7135 
7136  /* "mprans/cMoveMeshMonitor.pyx":251
7137  * cdef int bb_i
7138  * for bb_i in pc.mesh.exteriorElementBoundariesArray:
7139  * exteriorElementBoundariesBoolArray[bb_i] = 1 # <<<<<<<<<<<<<<
7140  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray
7141  * cdef int nNodes_owned = pc.mesh.nNodes_owned
7142  */
7143  __pyx_t_17 = __pyx_v_bb_i;
7144  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_exteriorElementBoundariesBoolArray.shape[0];
7145  *((int *) ( /* dim=0 */ (__pyx_v_exteriorElementBoundariesBoolArray.data + __pyx_t_17 * __pyx_v_exteriorElementBoundariesBoolArray.strides[0]) )) = 1;
7146 
7147  /* "mprans/cMoveMeshMonitor.pyx":250
7148  * cdef int[:] exteriorElementBoundariesBoolArray = np.zeros(pc.mesh.nElementBoundaries_global, dtype=np.int32)
7149  * cdef int bb_i
7150  * for bb_i in pc.mesh.exteriorElementBoundariesArray: # <<<<<<<<<<<<<<
7151  * exteriorElementBoundariesBoolArray[bb_i] = 1
7152  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray
7153  */
7154  }
7155  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7156 
7157  /* "mprans/cMoveMeshMonitor.pyx":252
7158  * for bb_i in pc.mesh.exteriorElementBoundariesArray:
7159  * exteriorElementBoundariesBoolArray[bb_i] = 1
7160  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray # <<<<<<<<<<<<<<
7161  * cdef int nNodes_owned = pc.mesh.nNodes_owned
7162  * cdef int nNodes_global = pc.mesh.nNodes_global
7163  */
7164  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error)
7165  __Pyx_GOTREF(__pyx_t_6);
7166  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_elementBoundaryNormalsArray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
7167  __Pyx_GOTREF(__pyx_t_4);
7168  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7169  __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 252, __pyx_L1_error)
7170  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7171  __pyx_v_elementBoundaryNormalsArray = __pyx_t_18;
7172  __pyx_t_18.memview = NULL;
7173  __pyx_t_18.data = NULL;
7174 
7175  /* "mprans/cMoveMeshMonitor.pyx":253
7176  * exteriorElementBoundariesBoolArray[bb_i] = 1
7177  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray
7178  * cdef int nNodes_owned = pc.mesh.nNodes_owned # <<<<<<<<<<<<<<
7179  * cdef int nNodes_global = pc.mesh.nNodes_global
7180  * cdef int nElements_owned = pc.mesh.nElements_owned
7181  */
7182  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error)
7183  __Pyx_GOTREF(__pyx_t_4);
7184  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nNodes_owned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error)
7185  __Pyx_GOTREF(__pyx_t_6);
7186  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7187  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L1_error)
7188  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7189  __pyx_v_nNodes_owned = __pyx_t_2;
7190 
7191  /* "mprans/cMoveMeshMonitor.pyx":254
7192  * cdef double[:,:,:] elementBoundaryNormalsArray = pc.mesh.elementBoundaryNormalsArray
7193  * cdef int nNodes_owned = pc.mesh.nNodes_owned
7194  * cdef int nNodes_global = pc.mesh.nNodes_global # <<<<<<<<<<<<<<
7195  * cdef int nElements_owned = pc.mesh.nElements_owned
7196  * cdef int nElements_global = pc.mesh.nElements_global
7197  */
7198  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error)
7199  __Pyx_GOTREF(__pyx_t_6);
7200  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nNodes_global); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
7201  __Pyx_GOTREF(__pyx_t_4);
7202  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7203  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 254, __pyx_L1_error)
7204  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7205  __pyx_v_nNodes_global = __pyx_t_2;
7206 
7207  /* "mprans/cMoveMeshMonitor.pyx":255
7208  * cdef int nNodes_owned = pc.mesh.nNodes_owned
7209  * cdef int nNodes_global = pc.mesh.nNodes_global
7210  * cdef int nElements_owned = pc.mesh.nElements_owned # <<<<<<<<<<<<<<
7211  * cdef int nElements_global = pc.mesh.nElements_global
7212  * cdef int[:] nodeNumbering_subdomain2global = pc.mesh.globalMesh.nodeNumbering_subdomain2global
7213  */
7214  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
7215  __Pyx_GOTREF(__pyx_t_4);
7216  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nElements_owned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error)
7217  __Pyx_GOTREF(__pyx_t_6);
7218  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7219  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L1_error)
7220  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7221  __pyx_v_nElements_owned = __pyx_t_2;
7222 
7223  /* "mprans/cMoveMeshMonitor.pyx":256
7224  * cdef int nNodes_global = pc.mesh.nNodes_global
7225  * cdef int nElements_owned = pc.mesh.nElements_owned
7226  * cdef int nElements_global = pc.mesh.nElements_global # <<<<<<<<<<<<<<
7227  * cdef int[:] nodeNumbering_subdomain2global = pc.mesh.globalMesh.nodeNumbering_subdomain2global
7228  * cdef int[:] elementNumbering_subdomain2global = pc.mesh.globalMesh.elementNumbering_subdomain2global
7229  */
7230  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
7231  __Pyx_GOTREF(__pyx_t_6);
7232  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nElements_global); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
7233  __Pyx_GOTREF(__pyx_t_4);
7234  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7235  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L1_error)
7236  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7237  __pyx_v_nElements_global = __pyx_t_2;
7238 
7239  /* "mprans/cMoveMeshMonitor.pyx":257
7240  * cdef int nElements_owned = pc.mesh.nElements_owned
7241  * cdef int nElements_global = pc.mesh.nElements_global
7242  * cdef int[:] nodeNumbering_subdomain2global = pc.mesh.globalMesh.nodeNumbering_subdomain2global # <<<<<<<<<<<<<<
7243  * cdef int[:] elementNumbering_subdomain2global = pc.mesh.globalMesh.elementNumbering_subdomain2global
7244  * cdef int[:] nodeOffsets_subdomain_owned = pc.mesh.globalMesh.nodeOffsets_subdomain_owned
7245  */
7246  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
7247  __Pyx_GOTREF(__pyx_t_4);
7248  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_globalMesh); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error)
7249  __Pyx_GOTREF(__pyx_t_6);
7250  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7251  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nodeNumbering_subdomain2global); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
7252  __Pyx_GOTREF(__pyx_t_4);
7253  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7254  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 257, __pyx_L1_error)
7255  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7256  __pyx_v_nodeNumbering_subdomain2global = __pyx_t_11;
7257  __pyx_t_11.memview = NULL;
7258  __pyx_t_11.data = NULL;
7259 
7260  /* "mprans/cMoveMeshMonitor.pyx":258
7261  * cdef int nElements_global = pc.mesh.nElements_global
7262  * cdef int[:] nodeNumbering_subdomain2global = pc.mesh.globalMesh.nodeNumbering_subdomain2global
7263  * cdef int[:] elementNumbering_subdomain2global = pc.mesh.globalMesh.elementNumbering_subdomain2global # <<<<<<<<<<<<<<
7264  * cdef int[:] nodeOffsets_subdomain_owned = pc.mesh.globalMesh.nodeOffsets_subdomain_owned
7265  * cdef int[:] elementOffsets_subdomain_owned = pc.mesh.globalMesh.elementOffsets_subdomain_owned
7266  */
7267  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
7268  __Pyx_GOTREF(__pyx_t_4);
7269  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_globalMesh); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error)
7270  __Pyx_GOTREF(__pyx_t_6);
7271  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7272  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_elementNumbering_subdomain2globa); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
7273  __Pyx_GOTREF(__pyx_t_4);
7274  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7275  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 258, __pyx_L1_error)
7276  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7277  __pyx_v_elementNumbering_subdomain2global = __pyx_t_11;
7278  __pyx_t_11.memview = NULL;
7279  __pyx_t_11.data = NULL;
7280 
7281  /* "mprans/cMoveMeshMonitor.pyx":259
7282  * cdef int[:] nodeNumbering_subdomain2global = pc.mesh.globalMesh.nodeNumbering_subdomain2global
7283  * cdef int[:] elementNumbering_subdomain2global = pc.mesh.globalMesh.elementNumbering_subdomain2global
7284  * cdef int[:] nodeOffsets_subdomain_owned = pc.mesh.globalMesh.nodeOffsets_subdomain_owned # <<<<<<<<<<<<<<
7285  * cdef int[:] elementOffsets_subdomain_owned = pc.mesh.globalMesh.elementOffsets_subdomain_owned
7286  * cdef int[:] nearestNArray = np.array([i for i in range(len(xx))], dtype=np.int32)
7287  */
7288  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
7289  __Pyx_GOTREF(__pyx_t_4);
7290  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_globalMesh); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error)
7291  __Pyx_GOTREF(__pyx_t_6);
7292  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7293  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_nodeOffsets_subdomain_owned); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
7294  __Pyx_GOTREF(__pyx_t_4);
7295  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7296  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 259, __pyx_L1_error)
7297  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7298  __pyx_v_nodeOffsets_subdomain_owned = __pyx_t_11;
7299  __pyx_t_11.memview = NULL;
7300  __pyx_t_11.data = NULL;
7301 
7302  /* "mprans/cMoveMeshMonitor.pyx":260
7303  * cdef int[:] elementNumbering_subdomain2global = pc.mesh.globalMesh.elementNumbering_subdomain2global
7304  * cdef int[:] nodeOffsets_subdomain_owned = pc.mesh.globalMesh.nodeOffsets_subdomain_owned
7305  * cdef int[:] elementOffsets_subdomain_owned = pc.mesh.globalMesh.elementOffsets_subdomain_owned # <<<<<<<<<<<<<<
7306  * cdef int[:] nearestNArray = np.array([i for i in range(len(xx))], dtype=np.int32)
7307  * cdef int[:] typeNArray = np.zeros(nNodes_global, dtype=np.int32)
7308  */
7309  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
7310  __Pyx_GOTREF(__pyx_t_4);
7311  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_globalMesh); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error)
7312  __Pyx_GOTREF(__pyx_t_6);
7313  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7314  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_elementOffsets_subdomain_owned); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
7315  __Pyx_GOTREF(__pyx_t_4);
7316  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7317  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 260, __pyx_L1_error)
7318  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7319  __pyx_v_elementOffsets_subdomain_owned = __pyx_t_11;
7320  __pyx_t_11.memview = NULL;
7321  __pyx_t_11.data = NULL;
7322 
7323  /* "mprans/cMoveMeshMonitor.pyx":261
7324  * cdef int[:] nodeOffsets_subdomain_owned = pc.mesh.globalMesh.nodeOffsets_subdomain_owned
7325  * cdef int[:] elementOffsets_subdomain_owned = pc.mesh.globalMesh.elementOffsets_subdomain_owned
7326  * cdef int[:] nearestNArray = np.array([i for i in range(len(xx))], dtype=np.int32) # <<<<<<<<<<<<<<
7327  * cdef int[:] typeNArray = np.zeros(nNodes_global, dtype=np.int32)
7328  * cdef int[:,:] elementNeighborsArray = pc.mesh.elementNeighborsArray
7329  */
7330  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
7331  __Pyx_GOTREF(__pyx_t_4);
7332  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
7333  __Pyx_GOTREF(__pyx_t_6);
7334  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7335  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
7336  __Pyx_GOTREF(__pyx_t_4);
7337  __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_v_xx);
7338  __pyx_t_15 = __pyx_t_10;
7339  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_15; __pyx_t_2+=1) {
7340  __pyx_v_i = __pyx_t_2;
7341  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
7342  __Pyx_GOTREF(__pyx_t_1);
7343  if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 261, __pyx_L1_error)
7344  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7345  }
7346  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
7347  __Pyx_GOTREF(__pyx_t_1);
7348  __Pyx_GIVEREF(__pyx_t_4);
7349  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
7350  __pyx_t_4 = 0;
7351  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
7352  __Pyx_GOTREF(__pyx_t_4);
7353  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 261, __pyx_L1_error)
7354  __Pyx_GOTREF(__pyx_t_8);
7355  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
7356  __Pyx_GOTREF(__pyx_t_3);
7357  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7358  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
7359  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7360  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
7361  __Pyx_GOTREF(__pyx_t_3);
7362  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7363  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7364  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7365  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 261, __pyx_L1_error)
7366  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7367  __pyx_v_nearestNArray = __pyx_t_11;
7368  __pyx_t_11.memview = NULL;
7369  __pyx_t_11.data = NULL;
7370 
7371  /* "mprans/cMoveMeshMonitor.pyx":262
7372  * cdef int[:] elementOffsets_subdomain_owned = pc.mesh.globalMesh.elementOffsets_subdomain_owned
7373  * cdef int[:] nearestNArray = np.array([i for i in range(len(xx))], dtype=np.int32)
7374  * cdef int[:] typeNArray = np.zeros(nNodes_global, dtype=np.int32) # <<<<<<<<<<<<<<
7375  * cdef int[:,:] elementNeighborsArray = pc.mesh.elementNeighborsArray
7376  * cdef int nElementBoundaries_owned = pc.mesh.nElementBoundaries_owned
7377  */
7378  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
7379  __Pyx_GOTREF(__pyx_t_3);
7380  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
7381  __Pyx_GOTREF(__pyx_t_4);
7382  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7383  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nNodes_global); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
7384  __Pyx_GOTREF(__pyx_t_3);
7385  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
7386  __Pyx_GOTREF(__pyx_t_1);
7387  __Pyx_GIVEREF(__pyx_t_3);
7388  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
7389  __pyx_t_3 = 0;
7390  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
7391  __Pyx_GOTREF(__pyx_t_3);
7392  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error)
7393  __Pyx_GOTREF(__pyx_t_6);
7394  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L1_error)
7395  __Pyx_GOTREF(__pyx_t_8);
7396  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7397  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 262, __pyx_L1_error)
7398  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7399  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L1_error)
7400  __Pyx_GOTREF(__pyx_t_8);
7401  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7402  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7403  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7404  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 262, __pyx_L1_error)
7405  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7406  __pyx_v_typeNArray = __pyx_t_11;
7407  __pyx_t_11.memview = NULL;
7408  __pyx_t_11.data = NULL;
7409 
7410  /* "mprans/cMoveMeshMonitor.pyx":263
7411  * cdef int[:] nearestNArray = np.array([i for i in range(len(xx))], dtype=np.int32)
7412  * cdef int[:] typeNArray = np.zeros(nNodes_global, dtype=np.int32)
7413  * cdef int[:,:] elementNeighborsArray = pc.mesh.elementNeighborsArray # <<<<<<<<<<<<<<
7414  * cdef int nElementBoundaries_owned = pc.mesh.nElementBoundaries_owned
7415  * cdef int[:] elementBoundaryNumbering_subdomain2global = pc.mesh.globalMesh.elementBoundaryNumbering_subdomain2global
7416  */
7417  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 263, __pyx_L1_error)
7418  __Pyx_GOTREF(__pyx_t_8);
7419  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_elementNeighborsArray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
7420  __Pyx_GOTREF(__pyx_t_3);
7421  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7422  __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 263, __pyx_L1_error)
7423  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7424  __pyx_v_elementNeighborsArray = __pyx_t_14;
7425  __pyx_t_14.memview = NULL;
7426  __pyx_t_14.data = NULL;
7427 
7428  /* "mprans/cMoveMeshMonitor.pyx":264
7429  * cdef int[:] typeNArray = np.zeros(nNodes_global, dtype=np.int32)
7430  * cdef int[:,:] elementNeighborsArray = pc.mesh.elementNeighborsArray
7431  * cdef int nElementBoundaries_owned = pc.mesh.nElementBoundaries_owned # <<<<<<<<<<<<<<
7432  * cdef int[:] elementBoundaryNumbering_subdomain2global = pc.mesh.globalMesh.elementBoundaryNumbering_subdomain2global
7433  * cdef int[:] elementBoundaryOffsets_subdomain_owned = pc.mesh.globalMesh.elementBoundaryOffsets_subdomain_owned
7434  */
7435  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
7436  __Pyx_GOTREF(__pyx_t_3);
7437  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nElementBoundaries_owned); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __pyx_L1_error)
7438  __Pyx_GOTREF(__pyx_t_8);
7439  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7440  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error)
7441  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7442  __pyx_v_nElementBoundaries_owned = __pyx_t_2;
7443 
7444  /* "mprans/cMoveMeshMonitor.pyx":265
7445  * cdef int[:,:] elementNeighborsArray = pc.mesh.elementNeighborsArray
7446  * cdef int nElementBoundaries_owned = pc.mesh.nElementBoundaries_owned
7447  * cdef int[:] elementBoundaryNumbering_subdomain2global = pc.mesh.globalMesh.elementBoundaryNumbering_subdomain2global # <<<<<<<<<<<<<<
7448  * cdef int[:] elementBoundaryOffsets_subdomain_owned = pc.mesh.globalMesh.elementBoundaryOffsets_subdomain_owned
7449  * cdef int[:,:] elementBoundaryNodesArray = pc.mesh.elementBoundaryNodesArray
7450  */
7451  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 265, __pyx_L1_error)
7452  __Pyx_GOTREF(__pyx_t_8);
7453  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_globalMesh); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
7454  __Pyx_GOTREF(__pyx_t_3);
7455  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7456  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_elementBoundaryNumbering_subdoma); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 265, __pyx_L1_error)
7457  __Pyx_GOTREF(__pyx_t_8);
7458  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7459  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 265, __pyx_L1_error)
7460  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7461  __pyx_v_elementBoundaryNumbering_subdomain2global = __pyx_t_11;
7462  __pyx_t_11.memview = NULL;
7463  __pyx_t_11.data = NULL;
7464 
7465  /* "mprans/cMoveMeshMonitor.pyx":266
7466  * cdef int nElementBoundaries_owned = pc.mesh.nElementBoundaries_owned
7467  * cdef int[:] elementBoundaryNumbering_subdomain2global = pc.mesh.globalMesh.elementBoundaryNumbering_subdomain2global
7468  * cdef int[:] elementBoundaryOffsets_subdomain_owned = pc.mesh.globalMesh.elementBoundaryOffsets_subdomain_owned # <<<<<<<<<<<<<<
7469  * cdef int[:,:] elementBoundaryNodesArray = pc.mesh.elementBoundaryNodesArray
7470  * cdef int[:] fixedNodesBoolArray = pc.mesh.fixedNodesBoolArray
7471  */
7472  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 266, __pyx_L1_error)
7473  __Pyx_GOTREF(__pyx_t_8);
7474  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_globalMesh); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
7475  __Pyx_GOTREF(__pyx_t_3);
7476  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7477  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_elementBoundaryOffsets_subdomain); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 266, __pyx_L1_error)
7478  __Pyx_GOTREF(__pyx_t_8);
7479  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7480  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 266, __pyx_L1_error)
7481  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7482  __pyx_v_elementBoundaryOffsets_subdomain_owned = __pyx_t_11;
7483  __pyx_t_11.memview = NULL;
7484  __pyx_t_11.data = NULL;
7485 
7486  /* "mprans/cMoveMeshMonitor.pyx":267
7487  * cdef int[:] elementBoundaryNumbering_subdomain2global = pc.mesh.globalMesh.elementBoundaryNumbering_subdomain2global
7488  * cdef int[:] elementBoundaryOffsets_subdomain_owned = pc.mesh.globalMesh.elementBoundaryOffsets_subdomain_owned
7489  * cdef int[:,:] elementBoundaryNodesArray = pc.mesh.elementBoundaryNodesArray # <<<<<<<<<<<<<<
7490  * cdef int[:] fixedNodesBoolArray = pc.mesh.fixedNodesBoolArray
7491  * cdef int nSmoothOut = pc.nSmoothOut
7492  */
7493  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 267, __pyx_L1_error)
7494  __Pyx_GOTREF(__pyx_t_8);
7495  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_elementBoundaryNodesArray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error)
7496  __Pyx_GOTREF(__pyx_t_3);
7497  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7498  __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 267, __pyx_L1_error)
7499  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7500  __pyx_v_elementBoundaryNodesArray = __pyx_t_14;
7501  __pyx_t_14.memview = NULL;
7502  __pyx_t_14.data = NULL;
7503 
7504  /* "mprans/cMoveMeshMonitor.pyx":268
7505  * cdef int[:] elementBoundaryOffsets_subdomain_owned = pc.mesh.globalMesh.elementBoundaryOffsets_subdomain_owned
7506  * cdef int[:,:] elementBoundaryNodesArray = pc.mesh.elementBoundaryNodesArray
7507  * cdef int[:] fixedNodesBoolArray = pc.mesh.fixedNodesBoolArray # <<<<<<<<<<<<<<
7508  * cdef int nSmoothOut = pc.nSmoothOut
7509  * cdef int nSmoothIn = pc.nSmoothIn
7510  */
7511  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_mesh); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
7512  __Pyx_GOTREF(__pyx_t_3);
7513  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fixedNodesBoolArray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 268, __pyx_L1_error)
7514  __Pyx_GOTREF(__pyx_t_8);
7515  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7516  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 268, __pyx_L1_error)
7517  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7518  __pyx_v_fixedNodesBoolArray = __pyx_t_11;
7519  __pyx_t_11.memview = NULL;
7520  __pyx_t_11.data = NULL;
7521 
7522  /* "mprans/cMoveMeshMonitor.pyx":269
7523  * cdef int[:,:] elementBoundaryNodesArray = pc.mesh.elementBoundaryNodesArray
7524  * cdef int[:] fixedNodesBoolArray = pc.mesh.fixedNodesBoolArray
7525  * cdef int nSmoothOut = pc.nSmoothOut # <<<<<<<<<<<<<<
7526  * cdef int nSmoothIn = pc.nSmoothIn
7527  * cdef int nSmooth = 0
7528  */
7529  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_nSmoothOut); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 269, __pyx_L1_error)
7530  __Pyx_GOTREF(__pyx_t_8);
7531  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
7532  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7533  __pyx_v_nSmoothOut = __pyx_t_2;
7534 
7535  /* "mprans/cMoveMeshMonitor.pyx":270
7536  * cdef int[:] fixedNodesBoolArray = pc.mesh.fixedNodesBoolArray
7537  * cdef int nSmoothOut = pc.nSmoothOut
7538  * cdef int nSmoothIn = pc.nSmoothIn # <<<<<<<<<<<<<<
7539  * cdef int nSmooth = 0
7540  * cdef bool inside_eN = False
7541  */
7542  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_nSmoothIn); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 270, __pyx_L1_error)
7543  __Pyx_GOTREF(__pyx_t_8);
7544  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
7545  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7546  __pyx_v_nSmoothIn = __pyx_t_2;
7547 
7548  /* "mprans/cMoveMeshMonitor.pyx":271
7549  * cdef int nSmoothOut = pc.nSmoothOut
7550  * cdef int nSmoothIn = pc.nSmoothIn
7551  * cdef int nSmooth = 0 # <<<<<<<<<<<<<<
7552  * cdef bool inside_eN = False
7553  * cdef double[:] vec = np.zeros(3)
7554  */
7555  __pyx_v_nSmooth = 0;
7556 
7557  /* "mprans/cMoveMeshMonitor.pyx":272
7558  * cdef int nSmoothIn = pc.nSmoothIn
7559  * cdef int nSmooth = 0
7560  * cdef bool inside_eN = False # <<<<<<<<<<<<<<
7561  * cdef double[:] vec = np.zeros(3)
7562  * cdef double[:] vec2 = np.zeros(3)
7563  */
7564  __pyx_v_inside_eN = 0;
7565 
7566  /* "mprans/cMoveMeshMonitor.pyx":273
7567  * cdef int nSmooth = 0
7568  * cdef bool inside_eN = False
7569  * cdef double[:] vec = np.zeros(3) # <<<<<<<<<<<<<<
7570  * cdef double[:] vec2 = np.zeros(3)
7571  * cdef double vec_dist
7572  */
7573  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
7574  __Pyx_GOTREF(__pyx_t_3);
7575  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
7576  __Pyx_GOTREF(__pyx_t_1);
7577  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7578  __pyx_t_3 = NULL;
7579  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
7580  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
7581  if (likely(__pyx_t_3)) {
7582  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
7583  __Pyx_INCREF(__pyx_t_3);
7584  __Pyx_INCREF(function);
7585  __Pyx_DECREF_SET(__pyx_t_1, function);
7586  }
7587  }
7588  __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_int_3);
7589  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7590  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error)
7591  __Pyx_GOTREF(__pyx_t_8);
7592  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7593  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 273, __pyx_L1_error)
7594  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7595  __pyx_v_vec = __pyx_t_9;
7596  __pyx_t_9.memview = NULL;
7597  __pyx_t_9.data = NULL;
7598 
7599  /* "mprans/cMoveMeshMonitor.pyx":274
7600  * cdef bool inside_eN = False
7601  * cdef double[:] vec = np.zeros(3)
7602  * cdef double[:] vec2 = np.zeros(3) # <<<<<<<<<<<<<<
7603  * cdef double vec_dist
7604  * cdef double[:] fixed_dir = np.ones(3)
7605  */
7606  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
7607  __Pyx_GOTREF(__pyx_t_1);
7608  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
7609  __Pyx_GOTREF(__pyx_t_3);
7610  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7611  __pyx_t_1 = NULL;
7612  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
7613  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
7614  if (likely(__pyx_t_1)) {
7615  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7616  __Pyx_INCREF(__pyx_t_1);
7617  __Pyx_INCREF(function);
7618  __Pyx_DECREF_SET(__pyx_t_3, function);
7619  }
7620  }
7621  __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
7622  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7623  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error)
7624  __Pyx_GOTREF(__pyx_t_8);
7625  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7626  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 274, __pyx_L1_error)
7627  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7628  __pyx_v_vec2 = __pyx_t_9;
7629  __pyx_t_9.memview = NULL;
7630  __pyx_t_9.data = NULL;
7631 
7632  /* "mprans/cMoveMeshMonitor.pyx":276
7633  * cdef double[:] vec2 = np.zeros(3)
7634  * cdef double vec_dist
7635  * cdef double[:] fixed_dir = np.ones(3) # <<<<<<<<<<<<<<
7636  * cdef int nearestN
7637  * cdef int typeN
7638  */
7639  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
7640  __Pyx_GOTREF(__pyx_t_3);
7641  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
7642  __Pyx_GOTREF(__pyx_t_1);
7643  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7644  __pyx_t_3 = NULL;
7645  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
7646  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
7647  if (likely(__pyx_t_3)) {
7648  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
7649  __Pyx_INCREF(__pyx_t_3);
7650  __Pyx_INCREF(function);
7651  __Pyx_DECREF_SET(__pyx_t_1, function);
7652  }
7653  }
7654  __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_int_3);
7655  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7656  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error)
7657  __Pyx_GOTREF(__pyx_t_8);
7658  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7659  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 276, __pyx_L1_error)
7660  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7661  __pyx_v_fixed_dir = __pyx_t_9;
7662  __pyx_t_9.memview = NULL;
7663  __pyx_t_9.data = NULL;
7664 
7665  /* "mprans/cMoveMeshMonitor.pyx":279
7666  * cdef int nearestN
7667  * cdef int typeN
7668  * comm = Comm.get().comm.tompi4py() # <<<<<<<<<<<<<<
7669  * comm.barrier()
7670  * cdef int my_rank = comm.rank
7671  */
7672  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Comm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
7673  __Pyx_GOTREF(__pyx_t_3);
7674  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
7675  __Pyx_GOTREF(__pyx_t_4);
7676  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7677  __pyx_t_3 = NULL;
7678  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7679  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
7680  if (likely(__pyx_t_3)) {
7681  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
7682  __Pyx_INCREF(__pyx_t_3);
7683  __Pyx_INCREF(function);
7684  __Pyx_DECREF_SET(__pyx_t_4, function);
7685  }
7686  }
7687  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
7688  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7689  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
7690  __Pyx_GOTREF(__pyx_t_1);
7691  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7692  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_comm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
7693  __Pyx_GOTREF(__pyx_t_4);
7694  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7695  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tompi4py); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
7696  __Pyx_GOTREF(__pyx_t_1);
7697  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7698  __pyx_t_4 = NULL;
7699  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7700  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
7701  if (likely(__pyx_t_4)) {
7702  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
7703  __Pyx_INCREF(__pyx_t_4);
7704  __Pyx_INCREF(function);
7705  __Pyx_DECREF_SET(__pyx_t_1, function);
7706  }
7707  }
7708  __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
7709  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7710  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error)
7711  __Pyx_GOTREF(__pyx_t_8);
7712  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7713  __pyx_v_comm = __pyx_t_8;
7714  __pyx_t_8 = 0;
7715 
7716  /* "mprans/cMoveMeshMonitor.pyx":280
7717  * cdef int typeN
7718  * comm = Comm.get().comm.tompi4py()
7719  * comm.barrier() # <<<<<<<<<<<<<<
7720  * cdef int my_rank = comm.rank
7721  * cdef int comm_size = comm.size
7722  */
7723  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
7724  __Pyx_GOTREF(__pyx_t_1);
7725  __pyx_t_4 = NULL;
7726  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7727  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
7728  if (likely(__pyx_t_4)) {
7729  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
7730  __Pyx_INCREF(__pyx_t_4);
7731  __Pyx_INCREF(function);
7732  __Pyx_DECREF_SET(__pyx_t_1, function);
7733  }
7734  }
7735  __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
7736  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7737  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 280, __pyx_L1_error)
7738  __Pyx_GOTREF(__pyx_t_8);
7739  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7740  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7741 
7742  /* "mprans/cMoveMeshMonitor.pyx":281
7743  * comm = Comm.get().comm.tompi4py()
7744  * comm.barrier()
7745  * cdef int my_rank = comm.rank # <<<<<<<<<<<<<<
7746  * cdef int comm_size = comm.size
7747  * cdef int[:] counts_local = np.zeros(comm_size, dtype=np.int32)
7748  */
7749  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_rank); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __pyx_L1_error)
7750  __Pyx_GOTREF(__pyx_t_8);
7751  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
7752  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7753  __pyx_v_my_rank = __pyx_t_2;
7754 
7755  /* "mprans/cMoveMeshMonitor.pyx":282
7756  * comm.barrier()
7757  * cdef int my_rank = comm.rank
7758  * cdef int comm_size = comm.size # <<<<<<<<<<<<<<
7759  * cdef int[:] counts_local = np.zeros(comm_size, dtype=np.int32)
7760  * cdef int[:,:] counts_total = np.zeros((comm_size, comm_size), dtype=np.int32)
7761  */
7762  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error)
7763  __Pyx_GOTREF(__pyx_t_8);
7764  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error)
7765  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7766  __pyx_cur_scope->__pyx_v_comm_size = __pyx_t_2;
7767 
7768  /* "mprans/cMoveMeshMonitor.pyx":283
7769  * cdef int my_rank = comm.rank
7770  * cdef int comm_size = comm.size
7771  * cdef int[:] counts_local = np.zeros(comm_size, dtype=np.int32) # <<<<<<<<<<<<<<
7772  * cdef int[:,:] counts_total = np.zeros((comm_size, comm_size), dtype=np.int32)
7773  *
7774  */
7775  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L1_error)
7776  __Pyx_GOTREF(__pyx_t_8);
7777  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
7778  __Pyx_GOTREF(__pyx_t_1);
7779  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7780  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L1_error)
7781  __Pyx_GOTREF(__pyx_t_8);
7782  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
7783  __Pyx_GOTREF(__pyx_t_4);
7784  __Pyx_GIVEREF(__pyx_t_8);
7785  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
7786  __pyx_t_8 = 0;
7787  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L1_error)
7788  __Pyx_GOTREF(__pyx_t_8);
7789  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
7790  __Pyx_GOTREF(__pyx_t_3);
7791  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L1_error)
7792  __Pyx_GOTREF(__pyx_t_6);
7793  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7794  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 283, __pyx_L1_error)
7795  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7796  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L1_error)
7797  __Pyx_GOTREF(__pyx_t_6);
7798  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7799  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7800  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7801  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 283, __pyx_L1_error)
7802  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7803  __pyx_v_counts_local = __pyx_t_11;
7804  __pyx_t_11.memview = NULL;
7805  __pyx_t_11.data = NULL;
7806 
7807  /* "mprans/cMoveMeshMonitor.pyx":284
7808  * cdef int comm_size = comm.size
7809  * cdef int[:] counts_local = np.zeros(comm_size, dtype=np.int32)
7810  * cdef int[:,:] counts_total = np.zeros((comm_size, comm_size), dtype=np.int32) # <<<<<<<<<<<<<<
7811  *
7812  * # the counts and displacements for nodes coming in from other processors
7813  */
7814  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error)
7815  __Pyx_GOTREF(__pyx_t_6);
7816  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error)
7817  __Pyx_GOTREF(__pyx_t_8);
7818  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7819  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error)
7820  __Pyx_GOTREF(__pyx_t_6);
7821  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
7822  __Pyx_GOTREF(__pyx_t_4);
7823  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
7824  __Pyx_GOTREF(__pyx_t_1);
7825  __Pyx_GIVEREF(__pyx_t_6);
7826  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
7827  __Pyx_GIVEREF(__pyx_t_4);
7828  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
7829  __pyx_t_6 = 0;
7830  __pyx_t_4 = 0;
7831  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
7832  __Pyx_GOTREF(__pyx_t_4);
7833  __Pyx_GIVEREF(__pyx_t_1);
7834  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7835  __pyx_t_1 = 0;
7836  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
7837  __Pyx_GOTREF(__pyx_t_1);
7838  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error)
7839  __Pyx_GOTREF(__pyx_t_6);
7840  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error)
7841  __Pyx_GOTREF(__pyx_t_3);
7842  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7843  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 284, __pyx_L1_error)
7844  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7845  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error)
7846  __Pyx_GOTREF(__pyx_t_3);
7847  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7848  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7849  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7850  __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 284, __pyx_L1_error)
7851  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7852  __pyx_v_counts_total = __pyx_t_14;
7853  __pyx_t_14.memview = NULL;
7854  __pyx_t_14.data = NULL;
7855 
7856  /* "mprans/cMoveMeshMonitor.pyx":287
7857  *
7858  * # the counts and displacements for nodes coming in from other processors
7859  * cdef int[:] counts_in = np.zeros(comm_size, dtype=np.int32) # <<<<<<<<<<<<<<
7860  * cdef int[:] displacements_in = np.zeros(comm_size, dtype=np.int32)
7861  * # the counts and displacements args_ coming back from other processors
7862  */
7863  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
7864  __Pyx_GOTREF(__pyx_t_3);
7865  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
7866  __Pyx_GOTREF(__pyx_t_1);
7867  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7868  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
7869  __Pyx_GOTREF(__pyx_t_3);
7870  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
7871  __Pyx_GOTREF(__pyx_t_4);
7872  __Pyx_GIVEREF(__pyx_t_3);
7873  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
7874  __pyx_t_3 = 0;
7875  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
7876  __Pyx_GOTREF(__pyx_t_3);
7877  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
7878  __Pyx_GOTREF(__pyx_t_8);
7879  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 287, __pyx_L1_error)
7880  __Pyx_GOTREF(__pyx_t_6);
7881  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7882  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
7883  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7884  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 287, __pyx_L1_error)
7885  __Pyx_GOTREF(__pyx_t_6);
7886  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7887  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7888  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7889  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 287, __pyx_L1_error)
7890  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7891  __pyx_cur_scope->__pyx_v_counts_in = __pyx_t_11;
7892  __pyx_t_11.memview = NULL;
7893  __pyx_t_11.data = NULL;
7894 
7895  /* "mprans/cMoveMeshMonitor.pyx":288
7896  * # the counts and displacements for nodes coming in from other processors
7897  * cdef int[:] counts_in = np.zeros(comm_size, dtype=np.int32)
7898  * cdef int[:] displacements_in = np.zeros(comm_size, dtype=np.int32) # <<<<<<<<<<<<<<
7899  * # the counts and displacements args_ coming back from other processors
7900  * cdef int[:] counts_out = np.zeros(comm_size, dtype=np.int32)
7901  */
7902  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error)
7903  __Pyx_GOTREF(__pyx_t_6);
7904  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
7905  __Pyx_GOTREF(__pyx_t_3);
7906  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7907  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error)
7908  __Pyx_GOTREF(__pyx_t_6);
7909  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
7910  __Pyx_GOTREF(__pyx_t_4);
7911  __Pyx_GIVEREF(__pyx_t_6);
7912  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
7913  __pyx_t_6 = 0;
7914  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error)
7915  __Pyx_GOTREF(__pyx_t_6);
7916  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
7917  __Pyx_GOTREF(__pyx_t_1);
7918  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error)
7919  __Pyx_GOTREF(__pyx_t_8);
7920  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7921  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
7922  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7923  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error)
7924  __Pyx_GOTREF(__pyx_t_8);
7925  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7926  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7927  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7928  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 288, __pyx_L1_error)
7929  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7930  __pyx_cur_scope->__pyx_v_displacements_in = __pyx_t_11;
7931  __pyx_t_11.memview = NULL;
7932  __pyx_t_11.data = NULL;
7933 
7934  /* "mprans/cMoveMeshMonitor.pyx":290
7935  * cdef int[:] displacements_in = np.zeros(comm_size, dtype=np.int32)
7936  * # the counts and displacements args_ coming back from other processors
7937  * cdef int[:] counts_out = np.zeros(comm_size, dtype=np.int32) # <<<<<<<<<<<<<<
7938  * cdef int[:] displacements_out = np.zeros(comm_size, dtype=np.int32)
7939  * # number of communications
7940  */
7941  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error)
7942  __Pyx_GOTREF(__pyx_t_8);
7943  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error)
7944  __Pyx_GOTREF(__pyx_t_6);
7945  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7946  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error)
7947  __Pyx_GOTREF(__pyx_t_8);
7948  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error)
7949  __Pyx_GOTREF(__pyx_t_4);
7950  __Pyx_GIVEREF(__pyx_t_8);
7951  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
7952  __pyx_t_8 = 0;
7953  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error)
7954  __Pyx_GOTREF(__pyx_t_8);
7955  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error)
7956  __Pyx_GOTREF(__pyx_t_3);
7957  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
7958  __Pyx_GOTREF(__pyx_t_1);
7959  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7960  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 290, __pyx_L1_error)
7961  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7962  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
7963  __Pyx_GOTREF(__pyx_t_1);
7964  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7965  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7966  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7967  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 290, __pyx_L1_error)
7968  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7969  __pyx_v_counts_out = __pyx_t_11;
7970  __pyx_t_11.memview = NULL;
7971  __pyx_t_11.data = NULL;
7972 
7973  /* "mprans/cMoveMeshMonitor.pyx":291
7974  * # the counts and displacements args_ coming back from other processors
7975  * cdef int[:] counts_out = np.zeros(comm_size, dtype=np.int32)
7976  * cdef int[:] displacements_out = np.zeros(comm_size, dtype=np.int32) # <<<<<<<<<<<<<<
7977  * # number of communications
7978  * cdef int ncomm = 0
7979  */
7980  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
7981  __Pyx_GOTREF(__pyx_t_1);
7982  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error)
7983  __Pyx_GOTREF(__pyx_t_8);
7984  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7985  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
7986  __Pyx_GOTREF(__pyx_t_1);
7987  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
7988  __Pyx_GOTREF(__pyx_t_4);
7989  __Pyx_GIVEREF(__pyx_t_1);
7990  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7991  __pyx_t_1 = 0;
7992  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
7993  __Pyx_GOTREF(__pyx_t_1);
7994  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error)
7995  __Pyx_GOTREF(__pyx_t_6);
7996  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
7997  __Pyx_GOTREF(__pyx_t_3);
7998  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7999  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 291, __pyx_L1_error)
8000  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8001  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
8002  __Pyx_GOTREF(__pyx_t_3);
8003  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8004  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8005  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8006  __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 291, __pyx_L1_error)
8007  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8008  __pyx_v_displacements_out = __pyx_t_11;
8009  __pyx_t_11.memview = NULL;
8010  __pyx_t_11.data = NULL;
8011 
8012  /* "mprans/cMoveMeshMonitor.pyx":293
8013  * cdef int[:] displacements_out = np.zeros(comm_size, dtype=np.int32)
8014  * # number of communications
8015  * cdef int ncomm = 0 # <<<<<<<<<<<<<<
8016  * # coords to send
8017  * cdef dict coords_2rank = {}
8018  */
8019  __pyx_v_ncomm = 0;
8020 
8021  /* "mprans/cMoveMeshMonitor.pyx":295
8022  * cdef int ncomm = 0
8023  * # coords to send
8024  * cdef dict coords_2rank = {} # <<<<<<<<<<<<<<
8025  * # nodes to send
8026  * cdef dict nodes0_2rank = {}
8027  */
8028  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
8029  __Pyx_GOTREF(__pyx_t_3);
8030  __pyx_v_coords_2rank = ((PyObject*)__pyx_t_3);
8031  __pyx_t_3 = 0;
8032 
8033  /* "mprans/cMoveMeshMonitor.pyx":297
8034  * cdef dict coords_2rank = {}
8035  * # nodes to send
8036  * cdef dict nodes0_2rank = {} # <<<<<<<<<<<<<<
8037  * # original rank of sending rank
8038  * cdef dict rank0_2rank = {}
8039  */
8040  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
8041  __Pyx_GOTREF(__pyx_t_3);
8042  __pyx_v_nodes0_2rank = ((PyObject*)__pyx_t_3);
8043  __pyx_t_3 = 0;
8044 
8045  /* "mprans/cMoveMeshMonitor.pyx":299
8046  * cdef dict nodes0_2rank = {}
8047  * # original rank of sending rank
8048  * cdef dict rank0_2rank = {} # <<<<<<<<<<<<<<
8049  * # original node number on sending rank
8050  * cdef dict nearestN_2rank = {}
8051  */
8052  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error)
8053  __Pyx_GOTREF(__pyx_t_3);
8054  __pyx_v_rank0_2rank = ((PyObject*)__pyx_t_3);
8055  __pyx_t_3 = 0;
8056 
8057  /* "mprans/cMoveMeshMonitor.pyx":301
8058  * cdef dict rank0_2rank = {}
8059  * # original node number on sending rank
8060  * cdef dict nearestN_2rank = {} # <<<<<<<<<<<<<<
8061  * # elements to send
8062  * cdef dict typeN_2rank = {}
8063  */
8064  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error)
8065  __Pyx_GOTREF(__pyx_t_3);
8066  __pyx_v_nearestN_2rank = ((PyObject*)__pyx_t_3);
8067  __pyx_t_3 = 0;
8068 
8069  /* "mprans/cMoveMeshMonitor.pyx":303
8070  * cdef dict nearestN_2rank = {}
8071  * # elements to send
8072  * cdef dict typeN_2rank = {} # <<<<<<<<<<<<<<
8073  * # direction to rank (for sliding nodes)
8074  * cdef dict dir_2rank = {}
8075  */
8076  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
8077  __Pyx_GOTREF(__pyx_t_3);
8078  __pyx_v_typeN_2rank = ((PyObject*)__pyx_t_3);
8079  __pyx_t_3 = 0;
8080 
8081  /* "mprans/cMoveMeshMonitor.pyx":305
8082  * cdef dict typeN_2rank = {}
8083  * # direction to rank (for sliding nodes)
8084  * cdef dict dir_2rank = {} # <<<<<<<<<<<<<<
8085  * cdef dict b_i_2rank = {}
8086  * # solutions
8087  */
8088  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error)
8089  __Pyx_GOTREF(__pyx_t_3);
8090  __pyx_v_dir_2rank = ((PyObject*)__pyx_t_3);
8091  __pyx_t_3 = 0;
8092 
8093  /* "mprans/cMoveMeshMonitor.pyx":306
8094  * # direction to rank (for sliding nodes)
8095  * cdef dict dir_2rank = {}
8096  * cdef dict b_i_2rank = {} # <<<<<<<<<<<<<<
8097  * # solutions
8098  * cdef bool solFound
8099  */
8100  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error)
8101  __Pyx_GOTREF(__pyx_t_3);
8102  __pyx_v_b_i_2rank = ((PyObject*)__pyx_t_3);
8103  __pyx_t_3 = 0;
8104 
8105  /* "mprans/cMoveMeshMonitor.pyx":309
8106  * # solutions
8107  * cdef bool solFound
8108  * cdef bool sendBack = False # <<<<<<<<<<<<<<
8109  * cdef int nPending_disp = 0 # number of pending solutions from other ranks
8110  * cdef int nPending_disp_total = 0 # number of pending solutions from other ranks
8111  */
8112  __pyx_v_sendBack = 0;
8113 
8114  /* "mprans/cMoveMeshMonitor.pyx":310
8115  * cdef bool solFound
8116  * cdef bool sendBack = False
8117  * cdef int nPending_disp = 0 # number of pending solutions from other ranks # <<<<<<<<<<<<<<
8118  * cdef int nPending_disp_total = 0 # number of pending solutions from other ranks
8119  * # declare variables for speed up
8120  */
8121  __pyx_v_nPending_disp = 0;
8122 
8123  /* "mprans/cMoveMeshMonitor.pyx":311
8124  * cdef bool sendBack = False
8125  * cdef int nPending_disp = 0 # number of pending solutions from other ranks
8126  * cdef int nPending_disp_total = 0 # number of pending solutions from other ranks # <<<<<<<<<<<<<<
8127  * # declare variables for speed up
8128  * cdef int node
8129  */
8130  __pyx_v_nPending_disp_total = 0;
8131 
8132  /* "mprans/cMoveMeshMonitor.pyx":324
8133  * cdef int new_rank
8134  * cdef int nodeEl
8135  * cdef double[:] coords = np.zeros(3) # <<<<<<<<<<<<<<
8136  * cdef int b_i, b_i_global
8137  * cdef double[:] bound_bar
8138  */
8139  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
8140  __Pyx_GOTREF(__pyx_t_1);
8141  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error)
8142  __Pyx_GOTREF(__pyx_t_4);
8143  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8144  __pyx_t_1 = NULL;
8145  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
8146  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
8147  if (likely(__pyx_t_1)) {
8148  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8149  __Pyx_INCREF(__pyx_t_1);
8150  __Pyx_INCREF(function);
8151  __Pyx_DECREF_SET(__pyx_t_4, function);
8152  }
8153  }
8154  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
8155  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8156  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error)
8157  __Pyx_GOTREF(__pyx_t_3);
8158  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8159  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 324, __pyx_L1_error)
8160  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8161  __pyx_v_coords = __pyx_t_9;
8162  __pyx_t_9.memview = NULL;
8163  __pyx_t_9.data = NULL;
8164 
8165  /* "mprans/cMoveMeshMonitor.pyx":330
8166  * cdef int[:] result2
8167  * cdef bool found
8168  * cdef double array_size_local = 0 # <<<<<<<<<<<<<<
8169  * if comm_size > 1:
8170  * for rank in range(comm_size):
8171  */
8172  __pyx_v_array_size_local = 0.0;
8173 
8174  /* "mprans/cMoveMeshMonitor.pyx":331
8175  * cdef bool found
8176  * cdef double array_size_local = 0
8177  * if comm_size > 1: # <<<<<<<<<<<<<<
8178  * for rank in range(comm_size):
8179  * # things to send to other processors to get solution
8180  */
8181  __pyx_t_19 = ((__pyx_cur_scope->__pyx_v_comm_size > 1) != 0);
8182  if (__pyx_t_19) {
8183 
8184  /* "mprans/cMoveMeshMonitor.pyx":332
8185  * cdef double array_size_local = 0
8186  * if comm_size > 1:
8187  * for rank in range(comm_size): # <<<<<<<<<<<<<<
8188  * # things to send to other processors to get solution
8189  * # things to send to other processors to get solution
8190  */
8191  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
8192  __Pyx_GOTREF(__pyx_t_3);
8193  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
8194  __Pyx_GOTREF(__pyx_t_4);
8195  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8196  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
8197  __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_15 = 0;
8198  __pyx_t_16 = NULL;
8199  } else {
8200  __pyx_t_15 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
8201  __Pyx_GOTREF(__pyx_t_3);
8202  __pyx_t_16 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 332, __pyx_L1_error)
8203  }
8204  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8205  for (;;) {
8206  if (likely(!__pyx_t_16)) {
8207  if (likely(PyList_CheckExact(__pyx_t_3))) {
8208  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_3)) break;
8209  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8210  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
8211  #else
8212  __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
8213  __Pyx_GOTREF(__pyx_t_4);
8214  #endif
8215  } else {
8216  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8217  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8218  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
8219  #else
8220  __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
8221  __Pyx_GOTREF(__pyx_t_4);
8222  #endif
8223  }
8224  } else {
8225  __pyx_t_4 = __pyx_t_16(__pyx_t_3);
8226  if (unlikely(!__pyx_t_4)) {
8227  PyObject* exc_type = PyErr_Occurred();
8228  if (exc_type) {
8229  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8230  else __PYX_ERR(0, 332, __pyx_L1_error)
8231  }
8232  break;
8233  }
8234  __Pyx_GOTREF(__pyx_t_4);
8235  }
8236  __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_4);
8237  __pyx_t_4 = 0;
8238 
8239  /* "mprans/cMoveMeshMonitor.pyx":351
8240  * # 13: fixed_dir[1]
8241  * # 14: fixed_dir[2]
8242  * coords_2rank[rank] = np.zeros((0, 15)) # <<<<<<<<<<<<<<
8243  * cdef double[:,:] coords_2doArray = np.zeros((0, 15))
8244  * # cdef int[:] solFound_2do
8245  */
8246  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
8247  __Pyx_GOTREF(__pyx_t_1);
8248  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 351, __pyx_L1_error)
8249  __Pyx_GOTREF(__pyx_t_8);
8250  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8251  __pyx_t_1 = NULL;
8252  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
8253  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
8254  if (likely(__pyx_t_1)) {
8255  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
8256  __Pyx_INCREF(__pyx_t_1);
8257  __Pyx_INCREF(function);
8258  __Pyx_DECREF_SET(__pyx_t_8, function);
8259  }
8260  }
8261  __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_1, __pyx_tuple__5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_tuple__5);
8262  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8263  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
8264  __Pyx_GOTREF(__pyx_t_4);
8265  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8266  if (unlikely(PyDict_SetItem(__pyx_v_coords_2rank, __pyx_v_rank, __pyx_t_4) < 0)) __PYX_ERR(0, 351, __pyx_L1_error)
8267  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8268 
8269  /* "mprans/cMoveMeshMonitor.pyx":332
8270  * cdef double array_size_local = 0
8271  * if comm_size > 1:
8272  * for rank in range(comm_size): # <<<<<<<<<<<<<<
8273  * # things to send to other processors to get solution
8274  * # things to send to other processors to get solution
8275  */
8276  }
8277  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8278 
8279  /* "mprans/cMoveMeshMonitor.pyx":331
8280  * cdef bool found
8281  * cdef double array_size_local = 0
8282  * if comm_size > 1: # <<<<<<<<<<<<<<
8283  * for rank in range(comm_size):
8284  * # things to send to other processors to get solution
8285  */
8286  }
8287 
8288  /* "mprans/cMoveMeshMonitor.pyx":352
8289  * # 14: fixed_dir[2]
8290  * coords_2rank[rank] = np.zeros((0, 15))
8291  * cdef double[:,:] coords_2doArray = np.zeros((0, 15)) # <<<<<<<<<<<<<<
8292  * # cdef int[:] solFound_2do
8293  * # cdef int[:] solFound_2doArray
8294  */
8295  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error)
8296  __Pyx_GOTREF(__pyx_t_4);
8297  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 352, __pyx_L1_error)
8298  __Pyx_GOTREF(__pyx_t_8);
8299  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8300  __pyx_t_4 = NULL;
8301  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
8302  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
8303  if (likely(__pyx_t_4)) {
8304  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
8305  __Pyx_INCREF(__pyx_t_4);
8306  __Pyx_INCREF(function);
8307  __Pyx_DECREF_SET(__pyx_t_8, function);
8308  }
8309  }
8310  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_tuple__5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_tuple__5);
8311  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8312  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error)
8313  __Pyx_GOTREF(__pyx_t_3);
8314  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8315  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 352, __pyx_L1_error)
8316  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8317  __pyx_cur_scope->__pyx_v_coords_2doArray = __pyx_t_13;
8318  __pyx_t_13.memview = NULL;
8319  __pyx_t_13.data = NULL;
8320 
8321  /* "mprans/cMoveMeshMonitor.pyx":355
8322  * # cdef int[:] solFound_2do
8323  * # cdef int[:] solFound_2doArray
8324  * cdef double[:] nodesSentBoolArray = np.zeros(len(xx)) # <<<<<<<<<<<<<<
8325  * cdef bool pending = False
8326  * cdef double[:] starting_coords = np.zeros(3)
8327  */
8328  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error)
8329  __Pyx_GOTREF(__pyx_t_8);
8330  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error)
8331  __Pyx_GOTREF(__pyx_t_4);
8332  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8333  __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_v_xx);
8334  __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error)
8335  __Pyx_GOTREF(__pyx_t_8);
8336  __pyx_t_1 = NULL;
8337  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
8338  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
8339  if (likely(__pyx_t_1)) {
8340  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8341  __Pyx_INCREF(__pyx_t_1);
8342  __Pyx_INCREF(function);
8343  __Pyx_DECREF_SET(__pyx_t_4, function);
8344  }
8345  }
8346  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
8347  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8348  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8349  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
8350  __Pyx_GOTREF(__pyx_t_3);
8351  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8352  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 355, __pyx_L1_error)
8353  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8354  __pyx_v_nodesSentBoolArray = __pyx_t_9;
8355  __pyx_t_9.memview = NULL;
8356  __pyx_t_9.data = NULL;
8357 
8358  /* "mprans/cMoveMeshMonitor.pyx":356
8359  * # cdef int[:] solFound_2doArray
8360  * cdef double[:] nodesSentBoolArray = np.zeros(len(xx))
8361  * cdef bool pending = False # <<<<<<<<<<<<<<
8362  * cdef double[:] starting_coords = np.zeros(3)
8363  * cdef int nEbn # number of boundaries per elements
8364  */
8365  __pyx_v_pending = 0;
8366 
8367  /* "mprans/cMoveMeshMonitor.pyx":357
8368  * cdef double[:] nodesSentBoolArray = np.zeros(len(xx))
8369  * cdef bool pending = False
8370  * cdef double[:] starting_coords = np.zeros(3) # <<<<<<<<<<<<<<
8371  * cdef int nEbn # number of boundaries per elements
8372  * cdef double[:] resultd
8373  */
8374  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error)
8375  __Pyx_GOTREF(__pyx_t_4);
8376  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 357, __pyx_L1_error)
8377  __Pyx_GOTREF(__pyx_t_8);
8378  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8379  __pyx_t_4 = NULL;
8380  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
8381  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
8382  if (likely(__pyx_t_4)) {
8383  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
8384  __Pyx_INCREF(__pyx_t_4);
8385  __Pyx_INCREF(function);
8386  __Pyx_DECREF_SET(__pyx_t_8, function);
8387  }
8388  }
8389  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_int_3);
8390  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8391  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error)
8392  __Pyx_GOTREF(__pyx_t_3);
8393  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8394  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 357, __pyx_L1_error)
8395  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8396  __pyx_v_starting_coords = __pyx_t_9;
8397  __pyx_t_9.memview = NULL;
8398  __pyx_t_9.data = NULL;
8399 
8400  /* "mprans/cMoveMeshMonitor.pyx":360
8401  * cdef int nEbn # number of boundaries per elements
8402  * cdef double[:] resultd
8403  * if nd == 2: # <<<<<<<<<<<<<<
8404  * nEbn = 3
8405  * elif nd == 3:
8406  */
8407  switch (__pyx_v_nd) {
8408  case 2:
8409 
8410  /* "mprans/cMoveMeshMonitor.pyx":361
8411  * cdef double[:] resultd
8412  * if nd == 2:
8413  * nEbn = 3 # <<<<<<<<<<<<<<
8414  * elif nd == 3:
8415  * nEbn = 4
8416  */
8417  __pyx_v_nEbn = 3;
8418 
8419  /* "mprans/cMoveMeshMonitor.pyx":360
8420  * cdef int nEbn # number of boundaries per elements
8421  * cdef double[:] resultd
8422  * if nd == 2: # <<<<<<<<<<<<<<
8423  * nEbn = 3
8424  * elif nd == 3:
8425  */
8426  break;
8427  case 3:
8428 
8429  /* "mprans/cMoveMeshMonitor.pyx":363
8430  * nEbn = 3
8431  * elif nd == 3:
8432  * nEbn = 4 # <<<<<<<<<<<<<<
8433  * cdef int nNel # number of nodes per elements
8434  * if nd == 2:
8435  */
8436  __pyx_v_nEbn = 4;
8437 
8438  /* "mprans/cMoveMeshMonitor.pyx":362
8439  * if nd == 2:
8440  * nEbn = 3
8441  * elif nd == 3: # <<<<<<<<<<<<<<
8442  * nEbn = 4
8443  * cdef int nNel # number of nodes per elements
8444  */
8445  break;
8446  default: break;
8447  }
8448 
8449  /* "mprans/cMoveMeshMonitor.pyx":365
8450  * nEbn = 4
8451  * cdef int nNel # number of nodes per elements
8452  * if nd == 2: # <<<<<<<<<<<<<<
8453  * nNel = 3
8454  * elif nd == 3:
8455  */
8456  switch (__pyx_v_nd) {
8457  case 2:
8458 
8459  /* "mprans/cMoveMeshMonitor.pyx":366
8460  * cdef int nNel # number of nodes per elements
8461  * if nd == 2:
8462  * nNel = 3 # <<<<<<<<<<<<<<
8463  * elif nd == 3:
8464  * nNel = 4
8465  */
8466  __pyx_v_nNel = 3;
8467 
8468  /* "mprans/cMoveMeshMonitor.pyx":365
8469  * nEbn = 4
8470  * cdef int nNel # number of nodes per elements
8471  * if nd == 2: # <<<<<<<<<<<<<<
8472  * nNel = 3
8473  * elif nd == 3:
8474  */
8475  break;
8476  case 3:
8477 
8478  /* "mprans/cMoveMeshMonitor.pyx":368
8479  * nNel = 3
8480  * elif nd == 3:
8481  * nNel = 4 # <<<<<<<<<<<<<<
8482  * for i_time in range(ntimesteps):
8483  * t = t_range[i_time]
8484  */
8485  __pyx_v_nNel = 4;
8486 
8487  /* "mprans/cMoveMeshMonitor.pyx":367
8488  * if nd == 2:
8489  * nNel = 3
8490  * elif nd == 3: # <<<<<<<<<<<<<<
8491  * nNel = 4
8492  * for i_time in range(ntimesteps):
8493  */
8494  break;
8495  default: break;
8496  }
8497 
8498  /* "mprans/cMoveMeshMonitor.pyx":369
8499  * elif nd == 3:
8500  * nNel = 4
8501  * for i_time in range(ntimesteps): # <<<<<<<<<<<<<<
8502  * t = t_range[i_time]
8503  * logEvent("Pseudo-time stepping t={t}".format(t=t), level=3)
8504  */
8505  __pyx_t_2 = __pyx_v_ntimesteps;
8506  __pyx_t_20 = __pyx_t_2;
8507  for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
8508  __pyx_v_i_time = __pyx_t_21;
8509 
8510  /* "mprans/cMoveMeshMonitor.pyx":370
8511  * nNel = 4
8512  * for i_time in range(ntimesteps):
8513  * t = t_range[i_time] # <<<<<<<<<<<<<<
8514  * logEvent("Pseudo-time stepping t={t}".format(t=t), level=3)
8515  * nPending_disp = 0
8516  */
8517  __pyx_t_17 = __pyx_v_i_time;
8518  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_t_range.shape[0];
8519  __pyx_v_t = (*((double *) ( /* dim=0 */ (__pyx_v_t_range.data + __pyx_t_17 * __pyx_v_t_range.strides[0]) )));
8520 
8521  /* "mprans/cMoveMeshMonitor.pyx":371
8522  * for i_time in range(ntimesteps):
8523  * t = t_range[i_time]
8524  * logEvent("Pseudo-time stepping t={t}".format(t=t), level=3) # <<<<<<<<<<<<<<
8525  * nPending_disp = 0
8526  * dt = t-t_last
8527  */
8528  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error)
8529  __Pyx_GOTREF(__pyx_t_3);
8530  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Pseudo_time_stepping_t_t, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 371, __pyx_L1_error)
8531  __Pyx_GOTREF(__pyx_t_8);
8532  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
8533  __Pyx_GOTREF(__pyx_t_4);
8534  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
8535  __Pyx_GOTREF(__pyx_t_1);
8536  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_t, __pyx_t_1) < 0) __PYX_ERR(0, 371, __pyx_L1_error)
8537  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8538  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
8539  __Pyx_GOTREF(__pyx_t_1);
8540  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8541  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8542  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
8543  __Pyx_GOTREF(__pyx_t_4);
8544  __Pyx_GIVEREF(__pyx_t_1);
8545  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
8546  __pyx_t_1 = 0;
8547  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
8548  __Pyx_GOTREF(__pyx_t_1);
8549  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_3) < 0) __PYX_ERR(0, 371, __pyx_L1_error)
8550  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 371, __pyx_L1_error)
8551  __Pyx_GOTREF(__pyx_t_8);
8552  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8553  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8554  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8555  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8556 
8557  /* "mprans/cMoveMeshMonitor.pyx":372
8558  * t = t_range[i_time]
8559  * logEvent("Pseudo-time stepping t={t}".format(t=t), level=3)
8560  * nPending_disp = 0 # <<<<<<<<<<<<<<
8561  * dt = t-t_last
8562  * t_last = t
8563  */
8564  __pyx_v_nPending_disp = 0;
8565 
8566  /* "mprans/cMoveMeshMonitor.pyx":373
8567  * logEvent("Pseudo-time stepping t={t}".format(t=t), level=3)
8568  * nPending_disp = 0
8569  * dt = t-t_last # <<<<<<<<<<<<<<
8570  * t_last = t
8571  * for node in range(nNodes_owned):
8572  */
8573  __pyx_v_dt = (__pyx_v_t - __pyx_v_t_last);
8574 
8575  /* "mprans/cMoveMeshMonitor.pyx":374
8576  * nPending_disp = 0
8577  * dt = t-t_last
8578  * t_last = t # <<<<<<<<<<<<<<
8579  * for node in range(nNodes_owned):
8580  * new_rank = my_rank
8581  */
8582  __pyx_v_t_last = __pyx_v_t;
8583 
8584  /* "mprans/cMoveMeshMonitor.pyx":375
8585  * dt = t-t_last
8586  * t_last = t
8587  * for node in range(nNodes_owned): # <<<<<<<<<<<<<<
8588  * new_rank = my_rank
8589  * # coords = xx[node]
8590  */
8591  __pyx_t_22 = __pyx_v_nNodes_owned;
8592  __pyx_t_23 = __pyx_t_22;
8593  for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
8594  __pyx_v_node = __pyx_t_24;
8595 
8596  /* "mprans/cMoveMeshMonitor.pyx":376
8597  * t_last = t
8598  * for node in range(nNodes_owned):
8599  * new_rank = my_rank # <<<<<<<<<<<<<<
8600  * # coords = xx[node]
8601  * coords[0] = xx[node, 0]
8602  */
8603  __pyx_v_new_rank = __pyx_v_my_rank;
8604 
8605  /* "mprans/cMoveMeshMonitor.pyx":378
8606  * new_rank = my_rank
8607  * # coords = xx[node]
8608  * coords[0] = xx[node, 0] # <<<<<<<<<<<<<<
8609  * coords[1] = xx[node, 1]
8610  * coords[2] = xx[node, 2]
8611  */
8612  __pyx_t_17 = __pyx_v_node;
8613  __pyx_t_25 = 0;
8614  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_xx.shape[0];
8615  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_xx.shape[1];
8616  __pyx_t_26 = 0;
8617  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
8618  *((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_xx.data + __pyx_t_17 * __pyx_v_xx.strides[0]) ) + __pyx_t_25 * __pyx_v_xx.strides[1]) )));
8619 
8620  /* "mprans/cMoveMeshMonitor.pyx":379
8621  * # coords = xx[node]
8622  * coords[0] = xx[node, 0]
8623  * coords[1] = xx[node, 1] # <<<<<<<<<<<<<<
8624  * coords[2] = xx[node, 2]
8625  * fixed = False
8626  */
8627  __pyx_t_25 = __pyx_v_node;
8628  __pyx_t_17 = 1;
8629  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_xx.shape[0];
8630  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_xx.shape[1];
8631  __pyx_t_26 = 1;
8632  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
8633  *((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_xx.data + __pyx_t_25 * __pyx_v_xx.strides[0]) ) + __pyx_t_17 * __pyx_v_xx.strides[1]) )));
8634 
8635  /* "mprans/cMoveMeshMonitor.pyx":380
8636  * coords[0] = xx[node, 0]
8637  * coords[1] = xx[node, 1]
8638  * coords[2] = xx[node, 2] # <<<<<<<<<<<<<<
8639  * fixed = False
8640  * pending = False
8641  */
8642  __pyx_t_17 = __pyx_v_node;
8643  __pyx_t_25 = 2;
8644  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_xx.shape[0];
8645  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_xx.shape[1];
8646  __pyx_t_26 = 2;
8647  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
8648  *((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_xx.data + __pyx_t_17 * __pyx_v_xx.strides[0]) ) + __pyx_t_25 * __pyx_v_xx.strides[1]) )));
8649 
8650  /* "mprans/cMoveMeshMonitor.pyx":381
8651  * coords[1] = xx[node, 1]
8652  * coords[2] = xx[node, 2]
8653  * fixed = False # <<<<<<<<<<<<<<
8654  * pending = False
8655  * area = 0.
8656  */
8657  __pyx_v_fixed = 0;
8658 
8659  /* "mprans/cMoveMeshMonitor.pyx":382
8660  * coords[2] = xx[node, 2]
8661  * fixed = False
8662  * pending = False # <<<<<<<<<<<<<<
8663  * area = 0.
8664  * flag = nodeMaterialTypes[node]
8665  */
8666  __pyx_v_pending = 0;
8667 
8668  /* "mprans/cMoveMeshMonitor.pyx":383
8669  * fixed = False
8670  * pending = False
8671  * area = 0. # <<<<<<<<<<<<<<
8672  * flag = nodeMaterialTypes[node]
8673  *
8674  */
8675  __pyx_v_area = 0.;
8676 
8677  /* "mprans/cMoveMeshMonitor.pyx":384
8678  * pending = False
8679  * area = 0.
8680  * flag = nodeMaterialTypes[node] # <<<<<<<<<<<<<<
8681  *
8682  * fixed_dir[0] = 1.
8683  */
8684  __pyx_t_25 = __pyx_v_node;
8685  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodeMaterialTypes.shape[0];
8686  __pyx_v_flag = (*((int *) ( /* dim=0 */ (__pyx_v_nodeMaterialTypes.data + __pyx_t_25 * __pyx_v_nodeMaterialTypes.strides[0]) )));
8687 
8688  /* "mprans/cMoveMeshMonitor.pyx":386
8689  * flag = nodeMaterialTypes[node]
8690  *
8691  * fixed_dir[0] = 1. # <<<<<<<<<<<<<<
8692  * fixed_dir[1] = 1.
8693  * fixed_dir[2] = 1.
8694  */
8695  __pyx_t_25 = 0;
8696  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_fixed_dir.shape[0];
8697  *((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_25 * __pyx_v_fixed_dir.strides[0]) )) = 1.;
8698 
8699  /* "mprans/cMoveMeshMonitor.pyx":387
8700  *
8701  * fixed_dir[0] = 1.
8702  * fixed_dir[1] = 1. # <<<<<<<<<<<<<<
8703  * fixed_dir[2] = 1.
8704  * b_i_global = -1
8705  */
8706  __pyx_t_25 = 1;
8707  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_fixed_dir.shape[0];
8708  *((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_25 * __pyx_v_fixed_dir.strides[0]) )) = 1.;
8709 
8710  /* "mprans/cMoveMeshMonitor.pyx":388
8711  * fixed_dir[0] = 1.
8712  * fixed_dir[1] = 1.
8713  * fixed_dir[2] = 1. # <<<<<<<<<<<<<<
8714  * b_i_global = -1
8715  * nearestN = nearestNArray[node]
8716  */
8717  __pyx_t_25 = 2;
8718  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_fixed_dir.shape[0];
8719  *((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_25 * __pyx_v_fixed_dir.strides[0]) )) = 1.;
8720 
8721  /* "mprans/cMoveMeshMonitor.pyx":389
8722  * fixed_dir[1] = 1.
8723  * fixed_dir[2] = 1.
8724  * b_i_global = -1 # <<<<<<<<<<<<<<
8725  * nearestN = nearestNArray[node]
8726  * typeN = typeNArray[node]
8727  */
8728  __pyx_v_b_i_global = -1;
8729 
8730  /* "mprans/cMoveMeshMonitor.pyx":390
8731  * fixed_dir[2] = 1.
8732  * b_i_global = -1
8733  * nearestN = nearestNArray[node] # <<<<<<<<<<<<<<
8734  * typeN = typeNArray[node]
8735  * for ndi in range(nd):
8736  */
8737  __pyx_t_25 = __pyx_v_node;
8738  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nearestNArray.shape[0];
8739  __pyx_v_nearestN = (*((int *) ( /* dim=0 */ (__pyx_v_nearestNArray.data + __pyx_t_25 * __pyx_v_nearestNArray.strides[0]) )));
8740 
8741  /* "mprans/cMoveMeshMonitor.pyx":391
8742  * b_i_global = -1
8743  * nearestN = nearestNArray[node]
8744  * typeN = typeNArray[node] # <<<<<<<<<<<<<<
8745  * for ndi in range(nd):
8746  * v_grad[ndi] = 0.
8747  */
8748  __pyx_t_25 = __pyx_v_node;
8749  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_typeNArray.shape[0];
8750  __pyx_v_typeN = (*((int *) ( /* dim=0 */ (__pyx_v_typeNArray.data + __pyx_t_25 * __pyx_v_typeNArray.strides[0]) )));
8751 
8752  /* "mprans/cMoveMeshMonitor.pyx":392
8753  * nearestN = nearestNArray[node]
8754  * typeN = typeNArray[node]
8755  * for ndi in range(nd): # <<<<<<<<<<<<<<
8756  * v_grad[ndi] = 0.
8757  * dphi[ndi] = 0.
8758  */
8759  __pyx_t_27 = __pyx_v_nd;
8760  __pyx_t_28 = __pyx_t_27;
8761  for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
8762  __pyx_v_ndi = __pyx_t_29;
8763 
8764  /* "mprans/cMoveMeshMonitor.pyx":393
8765  * typeN = typeNArray[node]
8766  * for ndi in range(nd):
8767  * v_grad[ndi] = 0. # <<<<<<<<<<<<<<
8768  * dphi[ndi] = 0.
8769  * if nodesSentBoolArray[node] == 1:
8770  */
8771  __pyx_t_25 = __pyx_v_ndi;
8772  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_v_grad.shape[0];
8773  *((double *) ( /* dim=0 */ (__pyx_v_v_grad.data + __pyx_t_25 * __pyx_v_v_grad.strides[0]) )) = 0.;
8774 
8775  /* "mprans/cMoveMeshMonitor.pyx":394
8776  * for ndi in range(nd):
8777  * v_grad[ndi] = 0.
8778  * dphi[ndi] = 0. # <<<<<<<<<<<<<<
8779  * if nodesSentBoolArray[node] == 1:
8780  * pending = True
8781  */
8782  __pyx_t_25 = __pyx_v_ndi;
8783  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_dphi.shape[0];
8784  *((double *) ( /* dim=0 */ (__pyx_v_dphi.data + __pyx_t_25 * __pyx_v_dphi.strides[0]) )) = 0.;
8785  }
8786 
8787  /* "mprans/cMoveMeshMonitor.pyx":395
8788  * v_grad[ndi] = 0.
8789  * dphi[ndi] = 0.
8790  * if nodesSentBoolArray[node] == 1: # <<<<<<<<<<<<<<
8791  * pending = True
8792  * nPending_disp += 1
8793  */
8794  __pyx_t_25 = __pyx_v_node;
8795  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodesSentBoolArray.shape[0];
8796  __pyx_t_19 = (((*((double *) ( /* dim=0 */ (__pyx_v_nodesSentBoolArray.data + __pyx_t_25 * __pyx_v_nodesSentBoolArray.strides[0]) ))) == 1.0) != 0);
8797  if (__pyx_t_19) {
8798 
8799  /* "mprans/cMoveMeshMonitor.pyx":396
8800  * dphi[ndi] = 0.
8801  * if nodesSentBoolArray[node] == 1:
8802  * pending = True # <<<<<<<<<<<<<<
8803  * nPending_disp += 1
8804  * elif nodesSentBoolArray[node] == 0:
8805  */
8806  __pyx_v_pending = 1;
8807 
8808  /* "mprans/cMoveMeshMonitor.pyx":397
8809  * if nodesSentBoolArray[node] == 1:
8810  * pending = True
8811  * nPending_disp += 1 # <<<<<<<<<<<<<<
8812  * elif nodesSentBoolArray[node] == 0:
8813  * if flag != 0:
8814  */
8815  __pyx_v_nPending_disp = (__pyx_v_nPending_disp + 1);
8816 
8817  /* "mprans/cMoveMeshMonitor.pyx":395
8818  * v_grad[ndi] = 0.
8819  * dphi[ndi] = 0.
8820  * if nodesSentBoolArray[node] == 1: # <<<<<<<<<<<<<<
8821  * pending = True
8822  * nPending_disp += 1
8823  */
8824  goto __pyx_L16;
8825  }
8826 
8827  /* "mprans/cMoveMeshMonitor.pyx":398
8828  * pending = True
8829  * nPending_disp += 1
8830  * elif nodesSentBoolArray[node] == 0: # <<<<<<<<<<<<<<
8831  * if flag != 0:
8832  * if fixedNodesBoolArray[node] == 1:
8833  */
8834  __pyx_t_25 = __pyx_v_node;
8835  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodesSentBoolArray.shape[0];
8836  __pyx_t_19 = (((*((double *) ( /* dim=0 */ (__pyx_v_nodesSentBoolArray.data + __pyx_t_25 * __pyx_v_nodesSentBoolArray.strides[0]) ))) == 0.0) != 0);
8837  if (__pyx_t_19) {
8838 
8839  /* "mprans/cMoveMeshMonitor.pyx":399
8840  * nPending_disp += 1
8841  * elif nodesSentBoolArray[node] == 0:
8842  * if flag != 0: # <<<<<<<<<<<<<<
8843  * if fixedNodesBoolArray[node] == 1:
8844  * fixed = True
8845  */
8846  __pyx_t_19 = ((__pyx_v_flag != 0) != 0);
8847  if (__pyx_t_19) {
8848 
8849  /* "mprans/cMoveMeshMonitor.pyx":400
8850  * elif nodesSentBoolArray[node] == 0:
8851  * if flag != 0:
8852  * if fixedNodesBoolArray[node] == 1: # <<<<<<<<<<<<<<
8853  * fixed = True
8854  * else:
8855  */
8856  __pyx_t_25 = __pyx_v_node;
8857  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_fixedNodesBoolArray.shape[0];
8858  __pyx_t_19 = (((*((int *) ( /* dim=0 */ (__pyx_v_fixedNodesBoolArray.data + __pyx_t_25 * __pyx_v_fixedNodesBoolArray.strides[0]) ))) == 1) != 0);
8859  if (__pyx_t_19) {
8860 
8861  /* "mprans/cMoveMeshMonitor.pyx":401
8862  * if flag != 0:
8863  * if fixedNodesBoolArray[node] == 1:
8864  * fixed = True # <<<<<<<<<<<<<<
8865  * else:
8866  * ms.cyFindBoundaryDirectionTriangle(
8867  */
8868  __pyx_v_fixed = 1;
8869 
8870  /* "mprans/cMoveMeshMonitor.pyx":400
8871  * elif nodesSentBoolArray[node] == 0:
8872  * if flag != 0:
8873  * if fixedNodesBoolArray[node] == 1: # <<<<<<<<<<<<<<
8874  * fixed = True
8875  * else:
8876  */
8877  goto __pyx_L18;
8878  }
8879 
8880  /* "mprans/cMoveMeshMonitor.pyx":403
8881  * fixed = True
8882  * else:
8883  * ms.cyFindBoundaryDirectionTriangle( # <<<<<<<<<<<<<<
8884  * dir_=fixed_dir,
8885  * node=node,
8886  */
8887  /*else*/ {
8888 
8889  /* "mprans/cMoveMeshMonitor.pyx":409
8890  * nodeStarOffsets=nodeStarOffsets,
8891  * nodeStarArray=nodeStarArray,
8892  * nodeMaterialTypes=nodeMaterialTypes, # <<<<<<<<<<<<<<
8893  * )
8894  * if not fixed: # either flag==0 or not fixed
8895  */
8896  __pyx_f_7proteus_6mprans_13MeshSmoothing_cyFindBoundaryDirectionTriangle(__pyx_v_fixed_dir, __pyx_v_node, __pyx_v_nodeArray, __pyx_v_nodeStarOffsets, __pyx_v_nodeStarArray, __pyx_v_nodeMaterialTypes);
8897  }
8898  __pyx_L18:;
8899 
8900  /* "mprans/cMoveMeshMonitor.pyx":399
8901  * nPending_disp += 1
8902  * elif nodesSentBoolArray[node] == 0:
8903  * if flag != 0: # <<<<<<<<<<<<<<
8904  * if fixedNodesBoolArray[node] == 1:
8905  * fixed = True
8906  */
8907  }
8908 
8909  /* "mprans/cMoveMeshMonitor.pyx":411
8910  * nodeMaterialTypes=nodeMaterialTypes,
8911  * )
8912  * if not fixed: # either flag==0 or not fixed # <<<<<<<<<<<<<<
8913  * if coords[0] == nodeArray[node, 0] and coords[1] == nodeArray[node, 1] and coords[2] == nodeArray[node, 2]: # nodes are at original position (no search)
8914  * # if i_time == 0:
8915  */
8916  __pyx_t_19 = ((!(__pyx_v_fixed != 0)) != 0);
8917  if (__pyx_t_19) {
8918 
8919  /* "mprans/cMoveMeshMonitor.pyx":412
8920  * )
8921  * if not fixed: # either flag==0 or not fixed
8922  * if coords[0] == nodeArray[node, 0] and coords[1] == nodeArray[node, 1] and coords[2] == nodeArray[node, 2]: # nodes are at original position (no search) # <<<<<<<<<<<<<<
8923  * # if i_time == 0:
8924  * for ndi in range(nd):
8925  */
8926  __pyx_t_25 = 0;
8927  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_coords.shape[0];
8928  __pyx_t_17 = __pyx_v_node;
8929  __pyx_t_26 = 0;
8930  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeArray.shape[0];
8931  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_nodeArray.shape[1];
8932  __pyx_t_30 = (((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_25 * __pyx_v_coords.strides[0]) ))) == (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_17 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_26 * __pyx_v_nodeArray.strides[1]) )))) != 0);
8933  if (__pyx_t_30) {
8934  } else {
8935  __pyx_t_19 = __pyx_t_30;
8936  goto __pyx_L21_bool_binop_done;
8937  }
8938  __pyx_t_26 = 1;
8939  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
8940  __pyx_t_17 = __pyx_v_node;
8941  __pyx_t_25 = 1;
8942  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeArray.shape[0];
8943  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodeArray.shape[1];
8944  __pyx_t_30 = (((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) ))) == (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_17 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_25 * __pyx_v_nodeArray.strides[1]) )))) != 0);
8945  if (__pyx_t_30) {
8946  } else {
8947  __pyx_t_19 = __pyx_t_30;
8948  goto __pyx_L21_bool_binop_done;
8949  }
8950  __pyx_t_25 = 2;
8951  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_coords.shape[0];
8952  __pyx_t_17 = __pyx_v_node;
8953  __pyx_t_26 = 2;
8954  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeArray.shape[0];
8955  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_nodeArray.shape[1];
8956  __pyx_t_30 = (((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_25 * __pyx_v_coords.strides[0]) ))) == (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_17 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_26 * __pyx_v_nodeArray.strides[1]) )))) != 0);
8957  __pyx_t_19 = __pyx_t_30;
8958  __pyx_L21_bool_binop_done:;
8959  if (__pyx_t_19) {
8960 
8961  /* "mprans/cMoveMeshMonitor.pyx":414
8962  * if coords[0] == nodeArray[node, 0] and coords[1] == nodeArray[node, 1] and coords[2] == nodeArray[node, 2]: # nodes are at original position (no search)
8963  * # if i_time == 0:
8964  * for ndi in range(nd): # <<<<<<<<<<<<<<
8965  * v_grad[ndi] = grads[node, ndi]
8966  * area = areas_nodes[node]
8967  */
8968  __pyx_t_27 = __pyx_v_nd;
8969  __pyx_t_28 = __pyx_t_27;
8970  for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
8971  __pyx_v_ndi = __pyx_t_29;
8972 
8973  /* "mprans/cMoveMeshMonitor.pyx":415
8974  * # if i_time == 0:
8975  * for ndi in range(nd):
8976  * v_grad[ndi] = grads[node, ndi] # <<<<<<<<<<<<<<
8977  * area = areas_nodes[node]
8978  * eN = -1
8979  */
8980  __pyx_t_26 = __pyx_v_node;
8981  __pyx_t_17 = __pyx_v_ndi;
8982  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_grads.shape[0];
8983  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_grads.shape[1];
8984  __pyx_t_25 = __pyx_v_ndi;
8985  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_v_grad.shape[0];
8986  *((double *) ( /* dim=0 */ (__pyx_v_v_grad.data + __pyx_t_25 * __pyx_v_v_grad.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_grads.data + __pyx_t_26 * __pyx_v_grads.strides[0]) ) + __pyx_t_17 * __pyx_v_grads.strides[1]) )));
8987  }
8988 
8989  /* "mprans/cMoveMeshMonitor.pyx":416
8990  * for ndi in range(nd):
8991  * v_grad[ndi] = grads[node, ndi]
8992  * area = areas_nodes[node] # <<<<<<<<<<<<<<
8993  * eN = -1
8994  * eN_phi[node] = eN
8995  */
8996  __pyx_t_17 = __pyx_v_node;
8997  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_areas_nodes.shape[0];
8998  __pyx_v_area = (*((double *) ( /* dim=0 */ (__pyx_v_areas_nodes.data + __pyx_t_17 * __pyx_v_areas_nodes.strides[0]) )));
8999 
9000  /* "mprans/cMoveMeshMonitor.pyx":417
9001  * v_grad[ndi] = grads[node, ndi]
9002  * area = areas_nodes[node]
9003  * eN = -1 # <<<<<<<<<<<<<<
9004  * eN_phi[node] = eN
9005  * if u_phi is not None:
9006  */
9007  __pyx_v_eN = -1;
9008 
9009  /* "mprans/cMoveMeshMonitor.pyx":418
9010  * area = areas_nodes[node]
9011  * eN = -1
9012  * eN_phi[node] = eN # <<<<<<<<<<<<<<
9013  * if u_phi is not None:
9014  * ls_phi = u_phi[node]
9015  */
9016  __pyx_t_17 = __pyx_v_node;
9017  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_eN_phi.shape[0];
9018  *((int *) ( /* dim=0 */ (__pyx_v_eN_phi.data + __pyx_t_17 * __pyx_v_eN_phi.strides[0]) )) = __pyx_v_eN;
9019 
9020  /* "mprans/cMoveMeshMonitor.pyx":419
9021  * eN = -1
9022  * eN_phi[node] = eN
9023  * if u_phi is not None: # <<<<<<<<<<<<<<
9024  * ls_phi = u_phi[node]
9025  * else:
9026  */
9027  __pyx_t_19 = ((((PyObject *) __pyx_v_u_phi.memview) != Py_None) != 0);
9028  if (__pyx_t_19) {
9029 
9030  /* "mprans/cMoveMeshMonitor.pyx":420
9031  * eN_phi[node] = eN
9032  * if u_phi is not None:
9033  * ls_phi = u_phi[node] # <<<<<<<<<<<<<<
9034  * else:
9035  * ls_phi = 1e12
9036  */
9037  __pyx_t_17 = __pyx_v_node;
9038  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_u_phi.shape[0];
9039  __pyx_v_ls_phi = (*((double *) ( /* dim=0 */ (__pyx_v_u_phi.data + __pyx_t_17 * __pyx_v_u_phi.strides[0]) )));
9040 
9041  /* "mprans/cMoveMeshMonitor.pyx":419
9042  * eN = -1
9043  * eN_phi[node] = eN
9044  * if u_phi is not None: # <<<<<<<<<<<<<<
9045  * ls_phi = u_phi[node]
9046  * else:
9047  */
9048  goto __pyx_L26;
9049  }
9050 
9051  /* "mprans/cMoveMeshMonitor.pyx":422
9052  * ls_phi = u_phi[node]
9053  * else:
9054  * ls_phi = 1e12 # <<<<<<<<<<<<<<
9055  * f = pc.evaluateFunAtX(x=coords, ls_phi=ls_phi)
9056  * for ndi in range(nd):
9057  */
9058  /*else*/ {
9059  __pyx_v_ls_phi = 1e12;
9060  }
9061  __pyx_L26:;
9062 
9063  /* "mprans/cMoveMeshMonitor.pyx":423
9064  * else:
9065  * ls_phi = 1e12
9066  * f = pc.evaluateFunAtX(x=coords, ls_phi=ls_phi) # <<<<<<<<<<<<<<
9067  * for ndi in range(nd):
9068  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
9069  */
9070  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_evaluateFunAtX); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 423, __pyx_L1_error)
9071  __Pyx_GOTREF(__pyx_t_8);
9072  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
9073  __Pyx_GOTREF(__pyx_t_1);
9074  __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
9075  __Pyx_GOTREF(__pyx_t_4);
9076  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_x, __pyx_t_4) < 0) __PYX_ERR(0, 423, __pyx_L1_error)
9077  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9078  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_ls_phi); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
9079  __Pyx_GOTREF(__pyx_t_4);
9080  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ls_phi, __pyx_t_4) < 0) __PYX_ERR(0, 423, __pyx_L1_error)
9081  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9082  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
9083  __Pyx_GOTREF(__pyx_t_4);
9084  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9085  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9086  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error)
9087  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9088  __pyx_v_f = __pyx_t_12;
9089 
9090  /* "mprans/cMoveMeshMonitor.pyx":424
9091  * ls_phi = 1e12
9092  * f = pc.evaluateFunAtX(x=coords, ls_phi=ls_phi)
9093  * for ndi in range(nd): # <<<<<<<<<<<<<<
9094  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
9095  * coords[ndi] += dphi[ndi]*dt*fixed_dir[ndi]
9096  */
9097  __pyx_t_27 = __pyx_v_nd;
9098  __pyx_t_28 = __pyx_t_27;
9099  for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
9100  __pyx_v_ndi = __pyx_t_29;
9101 
9102  /* "mprans/cMoveMeshMonitor.pyx":425
9103  * f = pc.evaluateFunAtX(x=coords, ls_phi=ls_phi)
9104  * for ndi in range(nd):
9105  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area) # <<<<<<<<<<<<<<
9106  * coords[ndi] += dphi[ndi]*dt*fixed_dir[ndi]
9107  * xx[node, ndi] = coords[ndi]
9108  */
9109  __pyx_t_17 = __pyx_v_ndi;
9110  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_v_grad.shape[0];
9111  __pyx_t_26 = __pyx_v_ndi;
9112  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_dphi.shape[0];
9113  *((double *) ( /* dim=0 */ (__pyx_v_dphi.data + __pyx_t_26 * __pyx_v_dphi.strides[0]) )) = ((*((double *) ( /* dim=0 */ (__pyx_v_v_grad.data + __pyx_t_17 * __pyx_v_v_grad.strides[0]) ))) / (((__pyx_v_t * 1.) / (__pyx_v_f * __pyx_v_Ccoeff)) + (((1.0 - __pyx_v_t) * 1.) / __pyx_v_area)));
9114 
9115  /* "mprans/cMoveMeshMonitor.pyx":426
9116  * for ndi in range(nd):
9117  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
9118  * coords[ndi] += dphi[ndi]*dt*fixed_dir[ndi] # <<<<<<<<<<<<<<
9119  * xx[node, ndi] = coords[ndi]
9120  * else: # find node that moved already (search)
9121  */
9122  __pyx_t_17 = __pyx_v_ndi;
9123  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_dphi.shape[0];
9124  __pyx_t_26 = __pyx_v_ndi;
9125  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_fixed_dir.shape[0];
9126  __pyx_t_25 = __pyx_v_ndi;
9127  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_coords.shape[0];
9128  *((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_25 * __pyx_v_coords.strides[0]) )) += (((*((double *) ( /* dim=0 */ (__pyx_v_dphi.data + __pyx_t_17 * __pyx_v_dphi.strides[0]) ))) * __pyx_v_dt) * (*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_26 * __pyx_v_fixed_dir.strides[0]) ))));
9129 
9130  /* "mprans/cMoveMeshMonitor.pyx":427
9131  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
9132  * coords[ndi] += dphi[ndi]*dt*fixed_dir[ndi]
9133  * xx[node, ndi] = coords[ndi] # <<<<<<<<<<<<<<
9134  * else: # find node that moved already (search)
9135  * result = findN(coords=coords,
9136  */
9137  __pyx_t_26 = __pyx_v_ndi;
9138  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
9139  __pyx_t_17 = __pyx_v_node;
9140  __pyx_t_25 = __pyx_v_ndi;
9141  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_xx.shape[0];
9142  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_xx.shape[1];
9143  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_xx.data + __pyx_t_17 * __pyx_v_xx.strides[0]) ) + __pyx_t_25 * __pyx_v_xx.strides[1]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )));
9144  }
9145 
9146  /* "mprans/cMoveMeshMonitor.pyx":412
9147  * )
9148  * if not fixed: # either flag==0 or not fixed
9149  * if coords[0] == nodeArray[node, 0] and coords[1] == nodeArray[node, 1] and coords[2] == nodeArray[node, 2]: # nodes are at original position (no search) # <<<<<<<<<<<<<<
9150  * # if i_time == 0:
9151  * for ndi in range(nd):
9152  */
9153  goto __pyx_L20;
9154  }
9155 
9156  /* "mprans/cMoveMeshMonitor.pyx":429
9157  * xx[node, ndi] = coords[ndi]
9158  * else: # find node that moved already (search)
9159  * result = findN(coords=coords, # <<<<<<<<<<<<<<
9160  * nodeArray=nodeArray,
9161  * nodeStarOffsets=nodeStarOffsets,
9162  */
9163  /*else*/ {
9164 
9165  /* "mprans/cMoveMeshMonitor.pyx":433
9166  * nodeStarOffsets=nodeStarOffsets,
9167  * nodeStarArray=nodeStarArray,
9168  * nearestN=nearestNArray[node], # <<<<<<<<<<<<<<
9169  * typeN = typeNArray[node],
9170  * my_rank=my_rank,
9171  */
9172  __pyx_t_26 = __pyx_v_node;
9173  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_nearestNArray.shape[0];
9174 
9175  /* "mprans/cMoveMeshMonitor.pyx":434
9176  * nodeStarArray=nodeStarArray,
9177  * nearestN=nearestNArray[node],
9178  * typeN = typeNArray[node], # <<<<<<<<<<<<<<
9179  * my_rank=my_rank,
9180  * nNodes_owned=nNodes_owned,
9181  */
9182  __pyx_t_25 = __pyx_v_node;
9183  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_typeNArray.shape[0];
9184 
9185  /* "mprans/cMoveMeshMonitor.pyx":429
9186  * xx[node, ndi] = coords[ndi]
9187  * else: # find node that moved already (search)
9188  * result = findN(coords=coords, # <<<<<<<<<<<<<<
9189  * nodeArray=nodeArray,
9190  * nodeStarOffsets=nodeStarOffsets,
9191  */
9192  __pyx_t_11 = __pyx_f_6mprans_16cMoveMeshMonitor_findN(__pyx_v_coords, __pyx_v_nodeArray, __pyx_v_nodeStarOffsets, __pyx_v_nodeStarArray, (*((int *) ( /* dim=0 */ (__pyx_v_nearestNArray.data + __pyx_t_26 * __pyx_v_nearestNArray.strides[0]) ))), (*((int *) ( /* dim=0 */ (__pyx_v_typeNArray.data + __pyx_t_25 * __pyx_v_typeNArray.strides[0]) ))), __pyx_v_my_rank, __pyx_v_nNodes_owned, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementBoundaryNormalsArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_exteriorElementBoundariesBoolArray, __pyx_v_nElements_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nElementBoundaries_owned, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_elementNodesArray, __pyx_v_nodeMaterialTypes, __pyx_v_nNel); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 429, __pyx_L1_error)
9193  __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1);
9194  __pyx_v_result = __pyx_t_11;
9195  __pyx_t_11.memview = NULL;
9196  __pyx_t_11.data = NULL;
9197 
9198  /* "mprans/cMoveMeshMonitor.pyx":456
9199  * elementNodesArray=elementNodesArray,
9200  * nNel=nNel)
9201  * nearestN = result[0] # <<<<<<<<<<<<<<
9202  * typeN = result[1]
9203  * new_rank = result[2]
9204  */
9205  __pyx_t_25 = 0;
9206  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_result.shape[0];
9207  __pyx_v_nearestN = (*((int *) ( /* dim=0 */ (__pyx_v_result.data + __pyx_t_25 * __pyx_v_result.strides[0]) )));
9208 
9209  /* "mprans/cMoveMeshMonitor.pyx":457
9210  * nNel=nNel)
9211  * nearestN = result[0]
9212  * typeN = result[1] # <<<<<<<<<<<<<<
9213  * new_rank = result[2]
9214  * if new_rank == my_rank:
9215  */
9216  __pyx_t_25 = 1;
9217  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_result.shape[0];
9218  __pyx_v_typeN = (*((int *) ( /* dim=0 */ (__pyx_v_result.data + __pyx_t_25 * __pyx_v_result.strides[0]) )));
9219 
9220  /* "mprans/cMoveMeshMonitor.pyx":458
9221  * nearestN = result[0]
9222  * typeN = result[1]
9223  * new_rank = result[2] # <<<<<<<<<<<<<<
9224  * if new_rank == my_rank:
9225  * inside_eN = True
9226  */
9227  __pyx_t_25 = 2;
9228  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_result.shape[0];
9229  __pyx_v_new_rank = (*((int *) ( /* dim=0 */ (__pyx_v_result.data + __pyx_t_25 * __pyx_v_result.strides[0]) )));
9230 
9231  /* "mprans/cMoveMeshMonitor.pyx":459
9232  * typeN = result[1]
9233  * new_rank = result[2]
9234  * if new_rank == my_rank: # <<<<<<<<<<<<<<
9235  * inside_eN = True
9236  * nearestNArray[node] = nearestN
9237  */
9238  __pyx_t_19 = ((__pyx_v_new_rank == __pyx_v_my_rank) != 0);
9239  if (__pyx_t_19) {
9240 
9241  /* "mprans/cMoveMeshMonitor.pyx":460
9242  * new_rank = result[2]
9243  * if new_rank == my_rank:
9244  * inside_eN = True # <<<<<<<<<<<<<<
9245  * nearestNArray[node] = nearestN
9246  * typeNArray[node] = typeN
9247  */
9248  __pyx_v_inside_eN = 1;
9249 
9250  /* "mprans/cMoveMeshMonitor.pyx":461
9251  * if new_rank == my_rank:
9252  * inside_eN = True
9253  * nearestNArray[node] = nearestN # <<<<<<<<<<<<<<
9254  * typeNArray[node] = typeN
9255  * if typeN == 2 and flag != 0:
9256  */
9257  __pyx_t_25 = __pyx_v_node;
9258  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nearestNArray.shape[0];
9259  *((int *) ( /* dim=0 */ (__pyx_v_nearestNArray.data + __pyx_t_25 * __pyx_v_nearestNArray.strides[0]) )) = __pyx_v_nearestN;
9260 
9261  /* "mprans/cMoveMeshMonitor.pyx":462
9262  * inside_eN = True
9263  * nearestNArray[node] = nearestN
9264  * typeNArray[node] = typeN # <<<<<<<<<<<<<<
9265  * if typeN == 2 and flag != 0:
9266  * # get an element from there
9267  */
9268  __pyx_t_25 = __pyx_v_node;
9269  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_typeNArray.shape[0];
9270  *((int *) ( /* dim=0 */ (__pyx_v_typeNArray.data + __pyx_t_25 * __pyx_v_typeNArray.strides[0]) )) = __pyx_v_typeN;
9271 
9272  /* "mprans/cMoveMeshMonitor.pyx":463
9273  * nearestNArray[node] = nearestN
9274  * typeNArray[node] = typeN
9275  * if typeN == 2 and flag != 0: # <<<<<<<<<<<<<<
9276  * # get an element from there
9277  * if elementBoundaryElementsArray[nearestN, 0] == -1 or elementBoundaryElementsArray[nearestN, 0] > nElements_owned:
9278  */
9279  __pyx_t_30 = ((__pyx_v_typeN == 2) != 0);
9280  if (__pyx_t_30) {
9281  } else {
9282  __pyx_t_19 = __pyx_t_30;
9283  goto __pyx_L31_bool_binop_done;
9284  }
9285  __pyx_t_30 = ((__pyx_v_flag != 0) != 0);
9286  __pyx_t_19 = __pyx_t_30;
9287  __pyx_L31_bool_binop_done:;
9288  if (__pyx_t_19) {
9289 
9290  /* "mprans/cMoveMeshMonitor.pyx":465
9291  * if typeN == 2 and flag != 0:
9292  * # get an element from there
9293  * if elementBoundaryElementsArray[nearestN, 0] == -1 or elementBoundaryElementsArray[nearestN, 0] > nElements_owned: # <<<<<<<<<<<<<<
9294  * nearestN = elementBoundaryElementsArray[nearestN, 1]
9295  * typeN = 1
9296  */
9297  __pyx_t_25 = __pyx_v_nearestN;
9298  __pyx_t_26 = 0;
9299  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[0];
9300  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[1];
9301  __pyx_t_30 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) == -1L) != 0);
9302  if (!__pyx_t_30) {
9303  } else {
9304  __pyx_t_19 = __pyx_t_30;
9305  goto __pyx_L34_bool_binop_done;
9306  }
9307  __pyx_t_26 = __pyx_v_nearestN;
9308  __pyx_t_25 = 0;
9309  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[0];
9310  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[1];
9311  __pyx_t_30 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) > __pyx_v_nElements_owned) != 0);
9312  __pyx_t_19 = __pyx_t_30;
9313  __pyx_L34_bool_binop_done:;
9314  if (__pyx_t_19) {
9315 
9316  /* "mprans/cMoveMeshMonitor.pyx":466
9317  * # get an element from there
9318  * if elementBoundaryElementsArray[nearestN, 0] == -1 or elementBoundaryElementsArray[nearestN, 0] > nElements_owned:
9319  * nearestN = elementBoundaryElementsArray[nearestN, 1] # <<<<<<<<<<<<<<
9320  * typeN = 1
9321  * elif elementBoundaryElementsArray[nearestN, 1] == -1 or elementBoundaryElementsArray[nearestN, 1] > nElements_owned:
9322  */
9323  __pyx_t_25 = __pyx_v_nearestN;
9324  __pyx_t_26 = 1;
9325  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[0];
9326  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[1];
9327  __pyx_v_nearestN = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
9328 
9329  /* "mprans/cMoveMeshMonitor.pyx":467
9330  * if elementBoundaryElementsArray[nearestN, 0] == -1 or elementBoundaryElementsArray[nearestN, 0] > nElements_owned:
9331  * nearestN = elementBoundaryElementsArray[nearestN, 1]
9332  * typeN = 1 # <<<<<<<<<<<<<<
9333  * elif elementBoundaryElementsArray[nearestN, 1] == -1 or elementBoundaryElementsArray[nearestN, 1] > nElements_owned:
9334  * nearestN = elementBoundaryElementsArray[nearestN, 0]
9335  */
9336  __pyx_v_typeN = 1;
9337 
9338  /* "mprans/cMoveMeshMonitor.pyx":465
9339  * if typeN == 2 and flag != 0:
9340  * # get an element from there
9341  * if elementBoundaryElementsArray[nearestN, 0] == -1 or elementBoundaryElementsArray[nearestN, 0] > nElements_owned: # <<<<<<<<<<<<<<
9342  * nearestN = elementBoundaryElementsArray[nearestN, 1]
9343  * typeN = 1
9344  */
9345  goto __pyx_L33;
9346  }
9347 
9348  /* "mprans/cMoveMeshMonitor.pyx":468
9349  * nearestN = elementBoundaryElementsArray[nearestN, 1]
9350  * typeN = 1
9351  * elif elementBoundaryElementsArray[nearestN, 1] == -1 or elementBoundaryElementsArray[nearestN, 1] > nElements_owned: # <<<<<<<<<<<<<<
9352  * nearestN = elementBoundaryElementsArray[nearestN, 0]
9353  * typeN = 1
9354  */
9355  __pyx_t_26 = __pyx_v_nearestN;
9356  __pyx_t_25 = 1;
9357  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[0];
9358  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[1];
9359  __pyx_t_30 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) == -1L) != 0);
9360  if (!__pyx_t_30) {
9361  } else {
9362  __pyx_t_19 = __pyx_t_30;
9363  goto __pyx_L36_bool_binop_done;
9364  }
9365  __pyx_t_25 = __pyx_v_nearestN;
9366  __pyx_t_26 = 1;
9367  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[0];
9368  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[1];
9369  __pyx_t_30 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) > __pyx_v_nElements_owned) != 0);
9370  __pyx_t_19 = __pyx_t_30;
9371  __pyx_L36_bool_binop_done:;
9372  if (__pyx_t_19) {
9373 
9374  /* "mprans/cMoveMeshMonitor.pyx":469
9375  * typeN = 1
9376  * elif elementBoundaryElementsArray[nearestN, 1] == -1 or elementBoundaryElementsArray[nearestN, 1] > nElements_owned:
9377  * nearestN = elementBoundaryElementsArray[nearestN, 0] # <<<<<<<<<<<<<<
9378  * typeN = 1
9379  * else:
9380  */
9381  __pyx_t_26 = __pyx_v_nearestN;
9382  __pyx_t_25 = 0;
9383  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[0];
9384  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[1];
9385  __pyx_v_nearestN = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
9386 
9387  /* "mprans/cMoveMeshMonitor.pyx":470
9388  * elif elementBoundaryElementsArray[nearestN, 1] == -1 or elementBoundaryElementsArray[nearestN, 1] > nElements_owned:
9389  * nearestN = elementBoundaryElementsArray[nearestN, 0]
9390  * typeN = 1 # <<<<<<<<<<<<<<
9391  * else:
9392  * nearestN = elementBoundaryElementsArray[nearestN, 0]
9393  */
9394  __pyx_v_typeN = 1;
9395 
9396  /* "mprans/cMoveMeshMonitor.pyx":468
9397  * nearestN = elementBoundaryElementsArray[nearestN, 1]
9398  * typeN = 1
9399  * elif elementBoundaryElementsArray[nearestN, 1] == -1 or elementBoundaryElementsArray[nearestN, 1] > nElements_owned: # <<<<<<<<<<<<<<
9400  * nearestN = elementBoundaryElementsArray[nearestN, 0]
9401  * typeN = 1
9402  */
9403  goto __pyx_L33;
9404  }
9405 
9406  /* "mprans/cMoveMeshMonitor.pyx":472
9407  * typeN = 1
9408  * else:
9409  * nearestN = elementBoundaryElementsArray[nearestN, 0] # <<<<<<<<<<<<<<
9410  * typeN = 1
9411  *
9412  */
9413  /*else*/ {
9414  __pyx_t_25 = __pyx_v_nearestN;
9415  __pyx_t_26 = 0;
9416  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryElementsArray.shape[0];
9417  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryElementsArray.shape[1];
9418  __pyx_v_nearestN = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_25 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
9419 
9420  /* "mprans/cMoveMeshMonitor.pyx":473
9421  * else:
9422  * nearestN = elementBoundaryElementsArray[nearestN, 0]
9423  * typeN = 1 # <<<<<<<<<<<<<<
9424  *
9425  * # fixed_dir[0] = nodeArray[elementBoundaryNodesArray[1], 0]-nodeArray[elementBoudnaryNodesArray[0], 0]
9426  */
9427  __pyx_v_typeN = 1;
9428  }
9429  __pyx_L33:;
9430 
9431  /* "mprans/cMoveMeshMonitor.pyx":463
9432  * nearestNArray[node] = nearestN
9433  * typeNArray[node] = typeN
9434  * if typeN == 2 and flag != 0: # <<<<<<<<<<<<<<
9435  * # get an element from there
9436  * if elementBoundaryElementsArray[nearestN, 0] == -1 or elementBoundaryElementsArray[nearestN, 0] > nElements_owned:
9437  */
9438  }
9439 
9440  /* "mprans/cMoveMeshMonitor.pyx":479
9441  * # fixed_dir[2] = nodeArray[elementBoundaryNodesArray[1], 2]-nodeArray[elementBoudnaryNodesArray[0], 2]
9442  *
9443  * for j in range(nEbn): # <<<<<<<<<<<<<<
9444  * bb_i = elementBoundariesArray[nearestN, j]
9445  * normal[0] = elementBoundaryNormalsArray[nearestN, j, 0]
9446  */
9447  __pyx_t_27 = __pyx_v_nEbn;
9448  __pyx_t_28 = __pyx_t_27;
9449  for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
9450  __pyx_v_j = __pyx_t_29;
9451 
9452  /* "mprans/cMoveMeshMonitor.pyx":480
9453  *
9454  * for j in range(nEbn):
9455  * bb_i = elementBoundariesArray[nearestN, j] # <<<<<<<<<<<<<<
9456  * normal[0] = elementBoundaryNormalsArray[nearestN, j, 0]
9457  * normal[1] = elementBoundaryNormalsArray[nearestN, j, 1]
9458  */
9459  __pyx_t_26 = __pyx_v_nearestN;
9460  __pyx_t_25 = __pyx_v_j;
9461  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundariesArray.shape[0];
9462  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundariesArray.shape[1];
9463  __pyx_v_bb_i = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundariesArray.data + __pyx_t_26 * __pyx_v_elementBoundariesArray.strides[0]) ) + __pyx_t_25 * __pyx_v_elementBoundariesArray.strides[1]) )));
9464 
9465  /* "mprans/cMoveMeshMonitor.pyx":481
9466  * for j in range(nEbn):
9467  * bb_i = elementBoundariesArray[nearestN, j]
9468  * normal[0] = elementBoundaryNormalsArray[nearestN, j, 0] # <<<<<<<<<<<<<<
9469  * normal[1] = elementBoundaryNormalsArray[nearestN, j, 1]
9470  * normal[2] = elementBoundaryNormalsArray[nearestN, j, 2]
9471  */
9472  __pyx_t_25 = __pyx_v_nearestN;
9473  __pyx_t_26 = __pyx_v_j;
9474  __pyx_t_17 = 0;
9475  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryNormalsArray.shape[0];
9476  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryNormalsArray.shape[1];
9477  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBoundaryNormalsArray.shape[2];
9478  __pyx_t_31 = 0;
9479  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_normal.shape[0];
9480  *((double *) ( /* dim=0 */ (__pyx_v_normal.data + __pyx_t_31 * __pyx_v_normal.strides[0]) )) = (*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryNormalsArray.data + __pyx_t_25 * __pyx_v_elementBoundaryNormalsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryNormalsArray.strides[1]) ) + __pyx_t_17 * __pyx_v_elementBoundaryNormalsArray.strides[2]) )));
9481 
9482  /* "mprans/cMoveMeshMonitor.pyx":482
9483  * bb_i = elementBoundariesArray[nearestN, j]
9484  * normal[0] = elementBoundaryNormalsArray[nearestN, j, 0]
9485  * normal[1] = elementBoundaryNormalsArray[nearestN, j, 1] # <<<<<<<<<<<<<<
9486  * normal[2] = elementBoundaryNormalsArray[nearestN, j, 2]
9487  * bound_bar = elementBoundaryBarycentersArray[bb_i]
9488  */
9489  __pyx_t_17 = __pyx_v_nearestN;
9490  __pyx_t_26 = __pyx_v_j;
9491  __pyx_t_25 = 1;
9492  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBoundaryNormalsArray.shape[0];
9493  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryNormalsArray.shape[1];
9494  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryNormalsArray.shape[2];
9495  __pyx_t_31 = 1;
9496  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_normal.shape[0];
9497  *((double *) ( /* dim=0 */ (__pyx_v_normal.data + __pyx_t_31 * __pyx_v_normal.strides[0]) )) = (*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryNormalsArray.data + __pyx_t_17 * __pyx_v_elementBoundaryNormalsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryNormalsArray.strides[1]) ) + __pyx_t_25 * __pyx_v_elementBoundaryNormalsArray.strides[2]) )));
9498 
9499  /* "mprans/cMoveMeshMonitor.pyx":483
9500  * normal[0] = elementBoundaryNormalsArray[nearestN, j, 0]
9501  * normal[1] = elementBoundaryNormalsArray[nearestN, j, 1]
9502  * normal[2] = elementBoundaryNormalsArray[nearestN, j, 2] # <<<<<<<<<<<<<<
9503  * bound_bar = elementBoundaryBarycentersArray[bb_i]
9504  * dot = (bound_bar[0]-coords[0])*normal[0]+(bound_bar[1]-coords[1])*normal[1]+(bound_bar[2]-coords[2])*normal[2]
9505  */
9506  __pyx_t_25 = __pyx_v_nearestN;
9507  __pyx_t_26 = __pyx_v_j;
9508  __pyx_t_17 = 2;
9509  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_elementBoundaryNormalsArray.shape[0];
9510  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBoundaryNormalsArray.shape[1];
9511  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBoundaryNormalsArray.shape[2];
9512  __pyx_t_31 = 2;
9513  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_normal.shape[0];
9514  *((double *) ( /* dim=0 */ (__pyx_v_normal.data + __pyx_t_31 * __pyx_v_normal.strides[0]) )) = (*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryNormalsArray.data + __pyx_t_25 * __pyx_v_elementBoundaryNormalsArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBoundaryNormalsArray.strides[1]) ) + __pyx_t_17 * __pyx_v_elementBoundaryNormalsArray.strides[2]) )));
9515 
9516  /* "mprans/cMoveMeshMonitor.pyx":484
9517  * normal[1] = elementBoundaryNormalsArray[nearestN, j, 1]
9518  * normal[2] = elementBoundaryNormalsArray[nearestN, j, 2]
9519  * bound_bar = elementBoundaryBarycentersArray[bb_i] # <<<<<<<<<<<<<<
9520  * dot = (bound_bar[0]-coords[0])*normal[0]+(bound_bar[1]-coords[1])*normal[1]+(bound_bar[2]-coords[2])*normal[2]
9521  * if dot < 0.:
9522  */
9523  __pyx_t_9.data = __pyx_v_elementBoundaryBarycentersArray.data;
9524  __pyx_t_9.memview = __pyx_v_elementBoundaryBarycentersArray.memview;
9525  __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
9526  {
9527  Py_ssize_t __pyx_tmp_idx = __pyx_v_bb_i;
9528  Py_ssize_t __pyx_tmp_shape = __pyx_v_elementBoundaryBarycentersArray.shape[0];
9529  Py_ssize_t __pyx_tmp_stride = __pyx_v_elementBoundaryBarycentersArray.strides[0];
9530  if (__pyx_tmp_idx < 0)
9531  __pyx_tmp_idx += __pyx_tmp_shape;
9532  __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
9533 }
9534 
9535 __pyx_t_9.shape[0] = __pyx_v_elementBoundaryBarycentersArray.shape[1];
9536 __pyx_t_9.strides[0] = __pyx_v_elementBoundaryBarycentersArray.strides[1];
9537  __pyx_t_9.suboffsets[0] = -1;
9538 
9539 __PYX_XDEC_MEMVIEW(&__pyx_v_bound_bar, 1);
9540  __pyx_v_bound_bar = __pyx_t_9;
9541  __pyx_t_9.memview = NULL;
9542  __pyx_t_9.data = NULL;
9543 
9544  /* "mprans/cMoveMeshMonitor.pyx":485
9545  * normal[2] = elementBoundaryNormalsArray[nearestN, j, 2]
9546  * bound_bar = elementBoundaryBarycentersArray[bb_i]
9547  * dot = (bound_bar[0]-coords[0])*normal[0]+(bound_bar[1]-coords[1])*normal[1]+(bound_bar[2]-coords[2])*normal[2] # <<<<<<<<<<<<<<
9548  * if dot < 0.:
9549  * inside_eN = False
9550  */
9551  __pyx_t_17 = 0;
9552  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_bound_bar.shape[0];
9553  __pyx_t_26 = 0;
9554  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
9555  __pyx_t_25 = 0;
9556  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_normal.shape[0];
9557  __pyx_t_31 = 1;
9558  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_bound_bar.shape[0];
9559  __pyx_t_32 = 1;
9560  if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_v_coords.shape[0];
9561  __pyx_t_33 = 1;
9562  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_normal.shape[0];
9563  __pyx_t_34 = 2;
9564  if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_bound_bar.shape[0];
9565  __pyx_t_35 = 2;
9566  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
9567  __pyx_t_36 = 2;
9568  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_normal.shape[0];
9569  __pyx_v_dot = (((((*((double *) ( /* dim=0 */ (__pyx_v_bound_bar.data + __pyx_t_17 * __pyx_v_bound_bar.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )))) * (*((double *) ( /* dim=0 */ (__pyx_v_normal.data + __pyx_t_25 * __pyx_v_normal.strides[0]) )))) + (((*((double *) ( /* dim=0 */ (__pyx_v_bound_bar.data + __pyx_t_31 * __pyx_v_bound_bar.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_32 * __pyx_v_coords.strides[0]) )))) * (*((double *) ( /* dim=0 */ (__pyx_v_normal.data + __pyx_t_33 * __pyx_v_normal.strides[0]) ))))) + (((*((double *) ( /* dim=0 */ (__pyx_v_bound_bar.data + __pyx_t_34 * __pyx_v_bound_bar.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )))) * (*((double *) ( /* dim=0 */ (__pyx_v_normal.data + __pyx_t_36 * __pyx_v_normal.strides[0]) )))));
9570 
9571  /* "mprans/cMoveMeshMonitor.pyx":486
9572  * bound_bar = elementBoundaryBarycentersArray[bb_i]
9573  * dot = (bound_bar[0]-coords[0])*normal[0]+(bound_bar[1]-coords[1])*normal[1]+(bound_bar[2]-coords[2])*normal[2]
9574  * if dot < 0.: # <<<<<<<<<<<<<<
9575  * inside_eN = False
9576  * try:
9577  */
9578  __pyx_t_19 = ((__pyx_v_dot < 0.) != 0);
9579  if (__pyx_t_19) {
9580 
9581  /* "mprans/cMoveMeshMonitor.pyx":487
9582  * dot = (bound_bar[0]-coords[0])*normal[0]+(bound_bar[1]-coords[1])*normal[1]+(bound_bar[2]-coords[2])*normal[2]
9583  * if dot < 0.:
9584  * inside_eN = False # <<<<<<<<<<<<<<
9585  * try:
9586  * raise AssertionError('did not find containing element! coords outside domain?')
9587  */
9588  __pyx_v_inside_eN = 0;
9589 
9590  /* "mprans/cMoveMeshMonitor.pyx":488
9591  * if dot < 0.:
9592  * inside_eN = False
9593  * try: # <<<<<<<<<<<<<<
9594  * raise AssertionError('did not find containing element! coords outside domain?')
9595  * except AssertionError as exc:
9596  */
9597  {
9598  __Pyx_PyThreadState_declare
9599  __Pyx_PyThreadState_assign
9600  __Pyx_ExceptionSave(&__pyx_t_37, &__pyx_t_38, &__pyx_t_39);
9601  __Pyx_XGOTREF(__pyx_t_37);
9602  __Pyx_XGOTREF(__pyx_t_38);
9603  __Pyx_XGOTREF(__pyx_t_39);
9604  /*try:*/ {
9605 
9606  /* "mprans/cMoveMeshMonitor.pyx":489
9607  * inside_eN = False
9608  * try:
9609  * raise AssertionError('did not find containing element! coords outside domain?') # <<<<<<<<<<<<<<
9610  * except AssertionError as exc:
9611  * print('Error: ', exc)
9612  */
9613  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 489, __pyx_L41_error)
9614  __Pyx_GOTREF(__pyx_t_4);
9615  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
9616  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9617  __PYX_ERR(0, 489, __pyx_L41_error)
9618 
9619  /* "mprans/cMoveMeshMonitor.pyx":488
9620  * if dot < 0.:
9621  * inside_eN = False
9622  * try: # <<<<<<<<<<<<<<
9623  * raise AssertionError('did not find containing element! coords outside domain?')
9624  * except AssertionError as exc:
9625  */
9626  }
9627  __pyx_L41_error:;
9628  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9629  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
9630  __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
9631  __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
9632  __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
9633  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9634  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9635  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9636  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9637  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9638  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9639  __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
9640 
9641  /* "mprans/cMoveMeshMonitor.pyx":490
9642  * try:
9643  * raise AssertionError('did not find containing element! coords outside domain?')
9644  * except AssertionError as exc: # <<<<<<<<<<<<<<
9645  * print('Error: ', exc)
9646  * print('node number', node)
9647  */
9648  __pyx_t_40 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AssertionError);
9649  if (__pyx_t_40) {
9650  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel", __pyx_clineno, __pyx_lineno, __pyx_filename);
9651  if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_8) < 0) __PYX_ERR(0, 490, __pyx_L43_except_error)
9652  __Pyx_GOTREF(__pyx_t_4);
9653  __Pyx_GOTREF(__pyx_t_1);
9654  __Pyx_GOTREF(__pyx_t_8);
9655  __Pyx_INCREF(__pyx_t_1);
9656  __Pyx_XDECREF_SET(__pyx_v_exc, __pyx_t_1);
9657 
9658  /* "mprans/cMoveMeshMonitor.pyx":491
9659  * raise AssertionError('did not find containing element! coords outside domain?')
9660  * except AssertionError as exc:
9661  * print('Error: ', exc) # <<<<<<<<<<<<<<
9662  * print('node number', node)
9663  * print('node materialType: ',
9664  */
9665  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L43_except_error)
9666  __Pyx_GOTREF(__pyx_t_3);
9667  __Pyx_INCREF(__pyx_kp_s_Error);
9668  __Pyx_GIVEREF(__pyx_kp_s_Error);
9669  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_Error);
9670  __Pyx_INCREF(__pyx_v_exc);
9671  __Pyx_GIVEREF(__pyx_v_exc);
9672  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_exc);
9673  if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 491, __pyx_L43_except_error)
9674  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9675 
9676  /* "mprans/cMoveMeshMonitor.pyx":492
9677  * except AssertionError as exc:
9678  * print('Error: ', exc)
9679  * print('node number', node) # <<<<<<<<<<<<<<
9680  * print('node materialType: ',
9681  * nodeMaterialTypes[node])
9682  */
9683  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L43_except_error)
9684  __Pyx_GOTREF(__pyx_t_3);
9685  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 492, __pyx_L43_except_error)
9686  __Pyx_GOTREF(__pyx_t_6);
9687  __Pyx_INCREF(__pyx_kp_s_node_number);
9688  __Pyx_GIVEREF(__pyx_kp_s_node_number);
9689  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_s_node_number);
9690  __Pyx_GIVEREF(__pyx_t_3);
9691  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
9692  __pyx_t_3 = 0;
9693  if (__Pyx_PrintOne(0, __pyx_t_6) < 0) __PYX_ERR(0, 492, __pyx_L43_except_error)
9694  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9695 
9696  /* "mprans/cMoveMeshMonitor.pyx":494
9697  * print('node number', node)
9698  * print('node materialType: ',
9699  * nodeMaterialTypes[node]) # <<<<<<<<<<<<<<
9700  * print('node old coordinates: ',
9701  * nodeArray[node, 0],
9702  */
9703  __pyx_t_36 = __pyx_v_node;
9704  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_nodeMaterialTypes.shape[0];
9705  __pyx_t_6 = __Pyx_PyInt_From_int((*((int *) ( /* dim=0 */ (__pyx_v_nodeMaterialTypes.data + __pyx_t_36 * __pyx_v_nodeMaterialTypes.strides[0]) )))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L43_except_error)
9706  __Pyx_GOTREF(__pyx_t_6);
9707 
9708  /* "mprans/cMoveMeshMonitor.pyx":493
9709  * print('Error: ', exc)
9710  * print('node number', node)
9711  * print('node materialType: ', # <<<<<<<<<<<<<<
9712  * nodeMaterialTypes[node])
9713  * print('node old coordinates: ',
9714  */
9715  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L43_except_error)
9716  __Pyx_GOTREF(__pyx_t_3);
9717  __Pyx_INCREF(__pyx_kp_s_node_materialType);
9718  __Pyx_GIVEREF(__pyx_kp_s_node_materialType);
9719  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_node_materialType);
9720  __Pyx_GIVEREF(__pyx_t_6);
9721  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
9722  __pyx_t_6 = 0;
9723  if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 493, __pyx_L43_except_error)
9724  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9725 
9726  /* "mprans/cMoveMeshMonitor.pyx":496
9727  * nodeMaterialTypes[node])
9728  * print('node old coordinates: ',
9729  * nodeArray[node, 0], # <<<<<<<<<<<<<<
9730  * nodeArray[node, 1],
9731  * nodeArray[node, 2])
9732  */
9733  __pyx_t_36 = __pyx_v_node;
9734  __pyx_t_35 = 0;
9735  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_nodeArray.shape[0];
9736  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_nodeArray.shape[1];
9737  __pyx_t_3 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_36 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_35 * __pyx_v_nodeArray.strides[1]) )))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L43_except_error)
9738  __Pyx_GOTREF(__pyx_t_3);
9739 
9740  /* "mprans/cMoveMeshMonitor.pyx":497
9741  * print('node old coordinates: ',
9742  * nodeArray[node, 0],
9743  * nodeArray[node, 1], # <<<<<<<<<<<<<<
9744  * nodeArray[node, 2])
9745  * print('node new coordinates: ',
9746  */
9747  __pyx_t_35 = __pyx_v_node;
9748  __pyx_t_36 = 1;
9749  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_nodeArray.shape[0];
9750  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_nodeArray.shape[1];
9751  __pyx_t_6 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_35 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_36 * __pyx_v_nodeArray.strides[1]) )))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 497, __pyx_L43_except_error)
9752  __Pyx_GOTREF(__pyx_t_6);
9753 
9754  /* "mprans/cMoveMeshMonitor.pyx":498
9755  * nodeArray[node, 0],
9756  * nodeArray[node, 1],
9757  * nodeArray[node, 2]) # <<<<<<<<<<<<<<
9758  * print('node new coordinates: ',
9759  * coords[0],
9760  */
9761  __pyx_t_36 = __pyx_v_node;
9762  __pyx_t_35 = 2;
9763  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_nodeArray.shape[0];
9764  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_nodeArray.shape[1];
9765  __pyx_t_5 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_36 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_35 * __pyx_v_nodeArray.strides[1]) )))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 498, __pyx_L43_except_error)
9766  __Pyx_GOTREF(__pyx_t_5);
9767 
9768  /* "mprans/cMoveMeshMonitor.pyx":495
9769  * print('node materialType: ',
9770  * nodeMaterialTypes[node])
9771  * print('node old coordinates: ', # <<<<<<<<<<<<<<
9772  * nodeArray[node, 0],
9773  * nodeArray[node, 1],
9774  */
9775  __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 495, __pyx_L43_except_error)
9776  __Pyx_GOTREF(__pyx_t_7);
9777  __Pyx_INCREF(__pyx_kp_s_node_old_coordinates);
9778  __Pyx_GIVEREF(__pyx_kp_s_node_old_coordinates);
9779  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_node_old_coordinates);
9780  __Pyx_GIVEREF(__pyx_t_3);
9781  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
9782  __Pyx_GIVEREF(__pyx_t_6);
9783  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
9784  __Pyx_GIVEREF(__pyx_t_5);
9785  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5);
9786  __pyx_t_3 = 0;
9787  __pyx_t_6 = 0;
9788  __pyx_t_5 = 0;
9789  if (__Pyx_PrintOne(0, __pyx_t_7) < 0) __PYX_ERR(0, 495, __pyx_L43_except_error)
9790  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9791 
9792  /* "mprans/cMoveMeshMonitor.pyx":500
9793  * nodeArray[node, 2])
9794  * print('node new coordinates: ',
9795  * coords[0], # <<<<<<<<<<<<<<
9796  * coords[1],
9797  * coords[2])
9798  */
9799  __pyx_t_35 = 0;
9800  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
9801  __pyx_t_7 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L43_except_error)
9802  __Pyx_GOTREF(__pyx_t_7);
9803 
9804  /* "mprans/cMoveMeshMonitor.pyx":501
9805  * print('node new coordinates: ',
9806  * coords[0],
9807  * coords[1], # <<<<<<<<<<<<<<
9808  * coords[2])
9809  * print('nearestN (element): ',
9810  */
9811  __pyx_t_35 = 1;
9812  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
9813  __pyx_t_5 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L43_except_error)
9814  __Pyx_GOTREF(__pyx_t_5);
9815 
9816  /* "mprans/cMoveMeshMonitor.pyx":502
9817  * coords[0],
9818  * coords[1],
9819  * coords[2]) # <<<<<<<<<<<<<<
9820  * print('nearestN (element): ',
9821  * nearestN,
9822  */
9823  __pyx_t_35 = 2;
9824  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
9825  __pyx_t_6 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L43_except_error)
9826  __Pyx_GOTREF(__pyx_t_6);
9827 
9828  /* "mprans/cMoveMeshMonitor.pyx":499
9829  * nodeArray[node, 1],
9830  * nodeArray[node, 2])
9831  * print('node new coordinates: ', # <<<<<<<<<<<<<<
9832  * coords[0],
9833  * coords[1],
9834  */
9835  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L43_except_error)
9836  __Pyx_GOTREF(__pyx_t_3);
9837  __Pyx_INCREF(__pyx_kp_s_node_new_coordinates);
9838  __Pyx_GIVEREF(__pyx_kp_s_node_new_coordinates);
9839  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_node_new_coordinates);
9840  __Pyx_GIVEREF(__pyx_t_7);
9841  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
9842  __Pyx_GIVEREF(__pyx_t_5);
9843  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5);
9844  __Pyx_GIVEREF(__pyx_t_6);
9845  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6);
9846  __pyx_t_7 = 0;
9847  __pyx_t_5 = 0;
9848  __pyx_t_6 = 0;
9849  if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 499, __pyx_L43_except_error)
9850  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9851 
9852  /* "mprans/cMoveMeshMonitor.pyx":504
9853  * coords[2])
9854  * print('nearestN (element): ',
9855  * nearestN, # <<<<<<<<<<<<<<
9856  * 'type (should be 1): ',
9857  * typeN)
9858  */
9859  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nearestN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L43_except_error)
9860  __Pyx_GOTREF(__pyx_t_3);
9861 
9862  /* "mprans/cMoveMeshMonitor.pyx":506
9863  * nearestN,
9864  * 'type (should be 1): ',
9865  * typeN) # <<<<<<<<<<<<<<
9866  * print('element barycenter: ',
9867  * elementBarycentersArray[nearestN,0],
9868  */
9869  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_typeN); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 506, __pyx_L43_except_error)
9870  __Pyx_GOTREF(__pyx_t_6);
9871 
9872  /* "mprans/cMoveMeshMonitor.pyx":503
9873  * coords[1],
9874  * coords[2])
9875  * print('nearestN (element): ', # <<<<<<<<<<<<<<
9876  * nearestN,
9877  * 'type (should be 1): ',
9878  */
9879  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L43_except_error)
9880  __Pyx_GOTREF(__pyx_t_5);
9881  __Pyx_INCREF(__pyx_kp_s_nearestN_element);
9882  __Pyx_GIVEREF(__pyx_kp_s_nearestN_element);
9883  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_nearestN_element);
9884  __Pyx_GIVEREF(__pyx_t_3);
9885  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
9886  __Pyx_INCREF(__pyx_kp_s_type_should_be_1);
9887  __Pyx_GIVEREF(__pyx_kp_s_type_should_be_1);
9888  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_s_type_should_be_1);
9889  __Pyx_GIVEREF(__pyx_t_6);
9890  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
9891  __pyx_t_3 = 0;
9892  __pyx_t_6 = 0;
9893  if (__Pyx_PrintOne(0, __pyx_t_5) < 0) __PYX_ERR(0, 503, __pyx_L43_except_error)
9894  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9895 
9896  /* "mprans/cMoveMeshMonitor.pyx":508
9897  * typeN)
9898  * print('element barycenter: ',
9899  * elementBarycentersArray[nearestN,0], # <<<<<<<<<<<<<<
9900  * elementBarycentersArray[nearestN,1],
9901  * elementBarycentersArray[nearestN,2])
9902  */
9903  __pyx_t_35 = __pyx_v_nearestN;
9904  __pyx_t_36 = 0;
9905  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementBarycentersArray.shape[0];
9906  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBarycentersArray.shape[1];
9907  __pyx_t_5 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_35 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementBarycentersArray.strides[1]) )))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L43_except_error)
9908  __Pyx_GOTREF(__pyx_t_5);
9909 
9910  /* "mprans/cMoveMeshMonitor.pyx":509
9911  * print('element barycenter: ',
9912  * elementBarycentersArray[nearestN,0],
9913  * elementBarycentersArray[nearestN,1], # <<<<<<<<<<<<<<
9914  * elementBarycentersArray[nearestN,2])
9915  * for ii in range(elementNodesArray.shape[1]):
9916  */
9917  __pyx_t_36 = __pyx_v_nearestN;
9918  __pyx_t_35 = 1;
9919  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBarycentersArray.shape[0];
9920  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementBarycentersArray.shape[1];
9921  __pyx_t_6 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_36 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_35 * __pyx_v_elementBarycentersArray.strides[1]) )))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L43_except_error)
9922  __Pyx_GOTREF(__pyx_t_6);
9923 
9924  /* "mprans/cMoveMeshMonitor.pyx":510
9925  * elementBarycentersArray[nearestN,0],
9926  * elementBarycentersArray[nearestN,1],
9927  * elementBarycentersArray[nearestN,2]) # <<<<<<<<<<<<<<
9928  * for ii in range(elementNodesArray.shape[1]):
9929  * print('element node: ',
9930  */
9931  __pyx_t_35 = __pyx_v_nearestN;
9932  __pyx_t_36 = 2;
9933  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementBarycentersArray.shape[0];
9934  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBarycentersArray.shape[1];
9935  __pyx_t_3 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_35 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementBarycentersArray.strides[1]) )))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L43_except_error)
9936  __Pyx_GOTREF(__pyx_t_3);
9937 
9938  /* "mprans/cMoveMeshMonitor.pyx":507
9939  * 'type (should be 1): ',
9940  * typeN)
9941  * print('element barycenter: ', # <<<<<<<<<<<<<<
9942  * elementBarycentersArray[nearestN,0],
9943  * elementBarycentersArray[nearestN,1],
9944  */
9945  __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 507, __pyx_L43_except_error)
9946  __Pyx_GOTREF(__pyx_t_7);
9947  __Pyx_INCREF(__pyx_kp_s_element_barycenter);
9948  __Pyx_GIVEREF(__pyx_kp_s_element_barycenter);
9949  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_element_barycenter);
9950  __Pyx_GIVEREF(__pyx_t_5);
9951  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
9952  __Pyx_GIVEREF(__pyx_t_6);
9953  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
9954  __Pyx_GIVEREF(__pyx_t_3);
9955  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_3);
9956  __pyx_t_5 = 0;
9957  __pyx_t_6 = 0;
9958  __pyx_t_3 = 0;
9959  if (__Pyx_PrintOne(0, __pyx_t_7) < 0) __PYX_ERR(0, 507, __pyx_L43_except_error)
9960  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9961 
9962  /* "mprans/cMoveMeshMonitor.pyx":511
9963  * elementBarycentersArray[nearestN,1],
9964  * elementBarycentersArray[nearestN,2])
9965  * for ii in range(elementNodesArray.shape[1]): # <<<<<<<<<<<<<<
9966  * print('element node: ',
9967  * elementNodesArray[nearestN, ii],
9968  */
9969  __pyx_t_15 = (__pyx_v_elementNodesArray.shape[1]);
9970  __pyx_t_41 = __pyx_t_15;
9971  for (__pyx_t_40 = 0; __pyx_t_40 < __pyx_t_41; __pyx_t_40+=1) {
9972  __pyx_v_ii = __pyx_t_40;
9973 
9974  /* "mprans/cMoveMeshMonitor.pyx":513
9975  * for ii in range(elementNodesArray.shape[1]):
9976  * print('element node: ',
9977  * elementNodesArray[nearestN, ii], # <<<<<<<<<<<<<<
9978  * nodeArray[elementNodesArray[nearestN, ii], 0],
9979  * nodeArray[elementNodesArray[nearestN, ii], 1],
9980  */
9981  __pyx_t_36 = __pyx_v_nearestN;
9982  __pyx_t_35 = __pyx_v_ii;
9983  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementNodesArray.shape[0];
9984  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementNodesArray.shape[1];
9985  __pyx_t_7 = __Pyx_PyInt_From_int((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_36 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_35 * __pyx_v_elementNodesArray.strides[1]) )))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L43_except_error)
9986  __Pyx_GOTREF(__pyx_t_7);
9987 
9988  /* "mprans/cMoveMeshMonitor.pyx":514
9989  * print('element node: ',
9990  * elementNodesArray[nearestN, ii],
9991  * nodeArray[elementNodesArray[nearestN, ii], 0], # <<<<<<<<<<<<<<
9992  * nodeArray[elementNodesArray[nearestN, ii], 1],
9993  * nodeArray[elementNodesArray[nearestN, ii], 2])
9994  */
9995  __pyx_t_35 = __pyx_v_nearestN;
9996  __pyx_t_36 = __pyx_v_ii;
9997  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementNodesArray.shape[0];
9998  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementNodesArray.shape[1];
9999  __pyx_t_34 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_35 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementNodesArray.strides[1]) )));
10000  __pyx_t_33 = 0;
10001  if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_nodeArray.shape[0];
10002  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_nodeArray.shape[1];
10003  __pyx_t_3 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_34 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_33 * __pyx_v_nodeArray.strides[1]) )))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L43_except_error)
10004  __Pyx_GOTREF(__pyx_t_3);
10005 
10006  /* "mprans/cMoveMeshMonitor.pyx":515
10007  * elementNodesArray[nearestN, ii],
10008  * nodeArray[elementNodesArray[nearestN, ii], 0],
10009  * nodeArray[elementNodesArray[nearestN, ii], 1], # <<<<<<<<<<<<<<
10010  * nodeArray[elementNodesArray[nearestN, ii], 2])
10011  * print('fixed_dir: ',
10012  */
10013  __pyx_t_36 = __pyx_v_nearestN;
10014  __pyx_t_35 = __pyx_v_ii;
10015  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementNodesArray.shape[0];
10016  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementNodesArray.shape[1];
10017  __pyx_t_33 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_36 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_35 * __pyx_v_elementNodesArray.strides[1]) )));
10018  __pyx_t_34 = 1;
10019  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_nodeArray.shape[0];
10020  if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_nodeArray.shape[1];
10021  __pyx_t_6 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_33 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_34 * __pyx_v_nodeArray.strides[1]) )))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 515, __pyx_L43_except_error)
10022  __Pyx_GOTREF(__pyx_t_6);
10023 
10024  /* "mprans/cMoveMeshMonitor.pyx":516
10025  * nodeArray[elementNodesArray[nearestN, ii], 0],
10026  * nodeArray[elementNodesArray[nearestN, ii], 1],
10027  * nodeArray[elementNodesArray[nearestN, ii], 2]) # <<<<<<<<<<<<<<
10028  * print('fixed_dir: ',
10029  * fixed_dir[0],
10030  */
10031  __pyx_t_35 = __pyx_v_nearestN;
10032  __pyx_t_36 = __pyx_v_ii;
10033  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementNodesArray.shape[0];
10034  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementNodesArray.shape[1];
10035  __pyx_t_34 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_35 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementNodesArray.strides[1]) )));
10036  __pyx_t_33 = 2;
10037  if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_nodeArray.shape[0];
10038  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_nodeArray.shape[1];
10039  __pyx_t_5 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_34 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_33 * __pyx_v_nodeArray.strides[1]) )))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L43_except_error)
10040  __Pyx_GOTREF(__pyx_t_5);
10041 
10042  /* "mprans/cMoveMeshMonitor.pyx":512
10043  * elementBarycentersArray[nearestN,2])
10044  * for ii in range(elementNodesArray.shape[1]):
10045  * print('element node: ', # <<<<<<<<<<<<<<
10046  * elementNodesArray[nearestN, ii],
10047  * nodeArray[elementNodesArray[nearestN, ii], 0],
10048  */
10049  __pyx_t_42 = PyTuple_New(5); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 512, __pyx_L43_except_error)
10050  __Pyx_GOTREF(__pyx_t_42);
10051  __Pyx_INCREF(__pyx_kp_s_element_node);
10052  __Pyx_GIVEREF(__pyx_kp_s_element_node);
10053  PyTuple_SET_ITEM(__pyx_t_42, 0, __pyx_kp_s_element_node);
10054  __Pyx_GIVEREF(__pyx_t_7);
10055  PyTuple_SET_ITEM(__pyx_t_42, 1, __pyx_t_7);
10056  __Pyx_GIVEREF(__pyx_t_3);
10057  PyTuple_SET_ITEM(__pyx_t_42, 2, __pyx_t_3);
10058  __Pyx_GIVEREF(__pyx_t_6);
10059  PyTuple_SET_ITEM(__pyx_t_42, 3, __pyx_t_6);
10060  __Pyx_GIVEREF(__pyx_t_5);
10061  PyTuple_SET_ITEM(__pyx_t_42, 4, __pyx_t_5);
10062  __pyx_t_7 = 0;
10063  __pyx_t_3 = 0;
10064  __pyx_t_6 = 0;
10065  __pyx_t_5 = 0;
10066  if (__Pyx_PrintOne(0, __pyx_t_42) < 0) __PYX_ERR(0, 512, __pyx_L43_except_error)
10067  __Pyx_DECREF(__pyx_t_42); __pyx_t_42 = 0;
10068  }
10069 
10070  /* "mprans/cMoveMeshMonitor.pyx":518
10071  * nodeArray[elementNodesArray[nearestN, ii], 2])
10072  * print('fixed_dir: ',
10073  * fixed_dir[0], # <<<<<<<<<<<<<<
10074  * fixed_dir[1],
10075  * fixed_dir[2])
10076  */
10077  __pyx_t_36 = 0;
10078  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_fixed_dir.shape[0];
10079  __pyx_t_42 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_36 * __pyx_v_fixed_dir.strides[0]) )))); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 518, __pyx_L43_except_error)
10080  __Pyx_GOTREF(__pyx_t_42);
10081 
10082  /* "mprans/cMoveMeshMonitor.pyx":519
10083  * print('fixed_dir: ',
10084  * fixed_dir[0],
10085  * fixed_dir[1], # <<<<<<<<<<<<<<
10086  * fixed_dir[2])
10087  * print('dot: ', dot)
10088  */
10089  __pyx_t_36 = 1;
10090  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_fixed_dir.shape[0];
10091  __pyx_t_5 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_36 * __pyx_v_fixed_dir.strides[0]) )))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L43_except_error)
10092  __Pyx_GOTREF(__pyx_t_5);
10093 
10094  /* "mprans/cMoveMeshMonitor.pyx":520
10095  * fixed_dir[0],
10096  * fixed_dir[1],
10097  * fixed_dir[2]) # <<<<<<<<<<<<<<
10098  * print('dot: ', dot)
10099  * comm.Abort()
10100  */
10101  __pyx_t_36 = 2;
10102  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_fixed_dir.shape[0];
10103  __pyx_t_6 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_36 * __pyx_v_fixed_dir.strides[0]) )))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L43_except_error)
10104  __Pyx_GOTREF(__pyx_t_6);
10105 
10106  /* "mprans/cMoveMeshMonitor.pyx":517
10107  * nodeArray[elementNodesArray[nearestN, ii], 1],
10108  * nodeArray[elementNodesArray[nearestN, ii], 2])
10109  * print('fixed_dir: ', # <<<<<<<<<<<<<<
10110  * fixed_dir[0],
10111  * fixed_dir[1],
10112  */
10113  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L43_except_error)
10114  __Pyx_GOTREF(__pyx_t_3);
10115  __Pyx_INCREF(__pyx_kp_s_fixed_dir);
10116  __Pyx_GIVEREF(__pyx_kp_s_fixed_dir);
10117  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_fixed_dir);
10118  __Pyx_GIVEREF(__pyx_t_42);
10119  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_42);
10120  __Pyx_GIVEREF(__pyx_t_5);
10121  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5);
10122  __Pyx_GIVEREF(__pyx_t_6);
10123  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_6);
10124  __pyx_t_42 = 0;
10125  __pyx_t_5 = 0;
10126  __pyx_t_6 = 0;
10127  if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 517, __pyx_L43_except_error)
10128  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10129 
10130  /* "mprans/cMoveMeshMonitor.pyx":521
10131  * fixed_dir[1],
10132  * fixed_dir[2])
10133  * print('dot: ', dot) # <<<<<<<<<<<<<<
10134  * comm.Abort()
10135  * if inside_eN:
10136  */
10137  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_dot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L43_except_error)
10138  __Pyx_GOTREF(__pyx_t_3);
10139  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 521, __pyx_L43_except_error)
10140  __Pyx_GOTREF(__pyx_t_6);
10141  __Pyx_INCREF(__pyx_kp_s_dot);
10142  __Pyx_GIVEREF(__pyx_kp_s_dot);
10143  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_s_dot);
10144  __Pyx_GIVEREF(__pyx_t_3);
10145  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
10146  __pyx_t_3 = 0;
10147  if (__Pyx_PrintOne(0, __pyx_t_6) < 0) __PYX_ERR(0, 521, __pyx_L43_except_error)
10148  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10149 
10150  /* "mprans/cMoveMeshMonitor.pyx":522
10151  * fixed_dir[2])
10152  * print('dot: ', dot)
10153  * comm.Abort() # <<<<<<<<<<<<<<
10154  * if inside_eN:
10155  * xi = femSpace.elementMaps.getInverseValue(nearestN, coords)
10156  */
10157  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_Abort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 522, __pyx_L43_except_error)
10158  __Pyx_GOTREF(__pyx_t_3);
10159  __pyx_t_5 = NULL;
10160  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
10161  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
10162  if (likely(__pyx_t_5)) {
10163  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
10164  __Pyx_INCREF(__pyx_t_5);
10165  __Pyx_INCREF(function);
10166  __Pyx_DECREF_SET(__pyx_t_3, function);
10167  }
10168  }
10169  __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
10170  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10171  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L43_except_error)
10172  __Pyx_GOTREF(__pyx_t_6);
10173  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10174  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10175  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10176  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10177  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10178  goto __pyx_L42_exception_handled;
10179  }
10180  goto __pyx_L43_except_error;
10181  __pyx_L43_except_error:;
10182 
10183  /* "mprans/cMoveMeshMonitor.pyx":488
10184  * if dot < 0.:
10185  * inside_eN = False
10186  * try: # <<<<<<<<<<<<<<
10187  * raise AssertionError('did not find containing element! coords outside domain?')
10188  * except AssertionError as exc:
10189  */
10190  __Pyx_XGIVEREF(__pyx_t_37);
10191  __Pyx_XGIVEREF(__pyx_t_38);
10192  __Pyx_XGIVEREF(__pyx_t_39);
10193  __Pyx_ExceptionReset(__pyx_t_37, __pyx_t_38, __pyx_t_39);
10194  goto __pyx_L1_error;
10195  __pyx_L42_exception_handled:;
10196  __Pyx_XGIVEREF(__pyx_t_37);
10197  __Pyx_XGIVEREF(__pyx_t_38);
10198  __Pyx_XGIVEREF(__pyx_t_39);
10199  __Pyx_ExceptionReset(__pyx_t_37, __pyx_t_38, __pyx_t_39);
10200  }
10201 
10202  /* "mprans/cMoveMeshMonitor.pyx":486
10203  * bound_bar = elementBoundaryBarycentersArray[bb_i]
10204  * dot = (bound_bar[0]-coords[0])*normal[0]+(bound_bar[1]-coords[1])*normal[1]+(bound_bar[2]-coords[2])*normal[2]
10205  * if dot < 0.: # <<<<<<<<<<<<<<
10206  * inside_eN = False
10207  * try:
10208  */
10209  }
10210  }
10211 
10212  /* "mprans/cMoveMeshMonitor.pyx":523
10213  * print('dot: ', dot)
10214  * comm.Abort()
10215  * if inside_eN: # <<<<<<<<<<<<<<
10216  * xi = femSpace.elementMaps.getInverseValue(nearestN, coords)
10217  * # line below needs optimisation:
10218  */
10219  __pyx_t_19 = (__pyx_v_inside_eN != 0);
10220  if (__pyx_t_19) {
10221 
10222  /* "mprans/cMoveMeshMonitor.pyx":524
10223  * comm.Abort()
10224  * if inside_eN:
10225  * xi = femSpace.elementMaps.getInverseValue(nearestN, coords) # <<<<<<<<<<<<<<
10226  * # line below needs optimisation:
10227  * v_grad = pc.getGradientValue(nearestN, xi)
10228  */
10229  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_femSpace, __pyx_n_s_elementMaps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
10230  __Pyx_GOTREF(__pyx_t_1);
10231  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getInverseValue); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
10232  __Pyx_GOTREF(__pyx_t_4);
10233  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10234  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nearestN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
10235  __Pyx_GOTREF(__pyx_t_1);
10236  __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error)
10237  __Pyx_GOTREF(__pyx_t_6);
10238  __pyx_t_3 = NULL;
10239  __pyx_t_27 = 0;
10240  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10241  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
10242  if (likely(__pyx_t_3)) {
10243  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10244  __Pyx_INCREF(__pyx_t_3);
10245  __Pyx_INCREF(function);
10246  __Pyx_DECREF_SET(__pyx_t_4, function);
10247  __pyx_t_27 = 1;
10248  }
10249  }
10250  #if CYTHON_FAST_PYCALL
10251  if (PyFunction_Check(__pyx_t_4)) {
10252  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_1, __pyx_t_6};
10253  __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 524, __pyx_L1_error)
10254  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10255  __Pyx_GOTREF(__pyx_t_8);
10256  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10257  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10258  } else
10259  #endif
10260  #if CYTHON_FAST_PYCCALL
10261  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10262  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_1, __pyx_t_6};
10263  __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 524, __pyx_L1_error)
10264  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10265  __Pyx_GOTREF(__pyx_t_8);
10266  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10267  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10268  } else
10269  #endif
10270  {
10271  __pyx_t_5 = PyTuple_New(2+__pyx_t_27); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error)
10272  __Pyx_GOTREF(__pyx_t_5);
10273  if (__pyx_t_3) {
10274  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
10275  }
10276  __Pyx_GIVEREF(__pyx_t_1);
10277  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_27, __pyx_t_1);
10278  __Pyx_GIVEREF(__pyx_t_6);
10279  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_27, __pyx_t_6);
10280  __pyx_t_1 = 0;
10281  __pyx_t_6 = 0;
10282  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 524, __pyx_L1_error)
10283  __Pyx_GOTREF(__pyx_t_8);
10284  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10285  }
10286  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10287  __Pyx_XDECREF_SET(__pyx_v_xi, __pyx_t_8);
10288  __pyx_t_8 = 0;
10289 
10290  /* "mprans/cMoveMeshMonitor.pyx":526
10291  * xi = femSpace.elementMaps.getInverseValue(nearestN, coords)
10292  * # line below needs optimisation:
10293  * v_grad = pc.getGradientValue(nearestN, xi) # <<<<<<<<<<<<<<
10294  * area = pc.getAreaValue(nearestN, xi)
10295  * if u_phi is not None:
10296  */
10297  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_getGradientValue); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 526, __pyx_L1_error)
10298  __Pyx_GOTREF(__pyx_t_4);
10299  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nearestN); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 526, __pyx_L1_error)
10300  __Pyx_GOTREF(__pyx_t_5);
10301  __pyx_t_6 = NULL;
10302  __pyx_t_27 = 0;
10303  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10304  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
10305  if (likely(__pyx_t_6)) {
10306  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10307  __Pyx_INCREF(__pyx_t_6);
10308  __Pyx_INCREF(function);
10309  __Pyx_DECREF_SET(__pyx_t_4, function);
10310  __pyx_t_27 = 1;
10311  }
10312  }
10313  #if CYTHON_FAST_PYCALL
10314  if (PyFunction_Check(__pyx_t_4)) {
10315  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_v_xi};
10316  __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 526, __pyx_L1_error)
10317  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10318  __Pyx_GOTREF(__pyx_t_8);
10319  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10320  } else
10321  #endif
10322  #if CYTHON_FAST_PYCCALL
10323  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10324  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_v_xi};
10325  __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 526, __pyx_L1_error)
10326  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10327  __Pyx_GOTREF(__pyx_t_8);
10328  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10329  } else
10330  #endif
10331  {
10332  __pyx_t_1 = PyTuple_New(2+__pyx_t_27); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
10333  __Pyx_GOTREF(__pyx_t_1);
10334  if (__pyx_t_6) {
10335  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL;
10336  }
10337  __Pyx_GIVEREF(__pyx_t_5);
10338  PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_27, __pyx_t_5);
10339  __Pyx_INCREF(__pyx_v_xi);
10340  __Pyx_GIVEREF(__pyx_v_xi);
10341  PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_27, __pyx_v_xi);
10342  __pyx_t_5 = 0;
10343  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 526, __pyx_L1_error)
10344  __Pyx_GOTREF(__pyx_t_8);
10345  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10346  }
10347  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10348  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 526, __pyx_L1_error)
10349  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10350  __PYX_XDEC_MEMVIEW(&__pyx_v_v_grad, 1);
10351  __pyx_v_v_grad = __pyx_t_9;
10352  __pyx_t_9.memview = NULL;
10353  __pyx_t_9.data = NULL;
10354 
10355  /* "mprans/cMoveMeshMonitor.pyx":527
10356  * # line below needs optimisation:
10357  * v_grad = pc.getGradientValue(nearestN, xi)
10358  * area = pc.getAreaValue(nearestN, xi) # <<<<<<<<<<<<<<
10359  * if u_phi is not None:
10360  * # line below needs optimisation:
10361  */
10362  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_getAreaValue); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error)
10363  __Pyx_GOTREF(__pyx_t_4);
10364  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nearestN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
10365  __Pyx_GOTREF(__pyx_t_1);
10366  __pyx_t_5 = NULL;
10367  __pyx_t_27 = 0;
10368  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10369  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
10370  if (likely(__pyx_t_5)) {
10371  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10372  __Pyx_INCREF(__pyx_t_5);
10373  __Pyx_INCREF(function);
10374  __Pyx_DECREF_SET(__pyx_t_4, function);
10375  __pyx_t_27 = 1;
10376  }
10377  }
10378  #if CYTHON_FAST_PYCALL
10379  if (PyFunction_Check(__pyx_t_4)) {
10380  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_xi};
10381  __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 527, __pyx_L1_error)
10382  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10383  __Pyx_GOTREF(__pyx_t_8);
10384  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10385  } else
10386  #endif
10387  #if CYTHON_FAST_PYCCALL
10388  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10389  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_xi};
10390  __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 527, __pyx_L1_error)
10391  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10392  __Pyx_GOTREF(__pyx_t_8);
10393  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10394  } else
10395  #endif
10396  {
10397  __pyx_t_6 = PyTuple_New(2+__pyx_t_27); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error)
10398  __Pyx_GOTREF(__pyx_t_6);
10399  if (__pyx_t_5) {
10400  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
10401  }
10402  __Pyx_GIVEREF(__pyx_t_1);
10403  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_27, __pyx_t_1);
10404  __Pyx_INCREF(__pyx_v_xi);
10405  __Pyx_GIVEREF(__pyx_v_xi);
10406  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_27, __pyx_v_xi);
10407  __pyx_t_1 = 0;
10408  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 527, __pyx_L1_error)
10409  __Pyx_GOTREF(__pyx_t_8);
10410  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10411  }
10412  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10413  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 527, __pyx_L1_error)
10414  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10415  __pyx_v_area = __pyx_t_12;
10416 
10417  /* "mprans/cMoveMeshMonitor.pyx":528
10418  * v_grad = pc.getGradientValue(nearestN, xi)
10419  * area = pc.getAreaValue(nearestN, xi)
10420  * if u_phi is not None: # <<<<<<<<<<<<<<
10421  * # line below needs optimisation:
10422  * ls_phi = pc.getLevelSetValue(nearestN, coords)
10423  */
10424  __pyx_t_19 = ((((PyObject *) __pyx_v_u_phi.memview) != Py_None) != 0);
10425  if (__pyx_t_19) {
10426 
10427  /* "mprans/cMoveMeshMonitor.pyx":530
10428  * if u_phi is not None:
10429  * # line below needs optimisation:
10430  * ls_phi = pc.getLevelSetValue(nearestN, coords) # <<<<<<<<<<<<<<
10431  * else:
10432  * ls_phi = 1e12
10433  */
10434  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_getLevelSetValue); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
10435  __Pyx_GOTREF(__pyx_t_4);
10436  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nearestN); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 530, __pyx_L1_error)
10437  __Pyx_GOTREF(__pyx_t_6);
10438  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
10439  __Pyx_GOTREF(__pyx_t_1);
10440  __pyx_t_5 = NULL;
10441  __pyx_t_27 = 0;
10442  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10443  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
10444  if (likely(__pyx_t_5)) {
10445  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10446  __Pyx_INCREF(__pyx_t_5);
10447  __Pyx_INCREF(function);
10448  __Pyx_DECREF_SET(__pyx_t_4, function);
10449  __pyx_t_27 = 1;
10450  }
10451  }
10452  #if CYTHON_FAST_PYCALL
10453  if (PyFunction_Check(__pyx_t_4)) {
10454  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_1};
10455  __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 530, __pyx_L1_error)
10456  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10457  __Pyx_GOTREF(__pyx_t_8);
10458  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10459  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10460  } else
10461  #endif
10462  #if CYTHON_FAST_PYCCALL
10463  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10464  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_1};
10465  __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 530, __pyx_L1_error)
10466  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10467  __Pyx_GOTREF(__pyx_t_8);
10468  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10469  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10470  } else
10471  #endif
10472  {
10473  __pyx_t_3 = PyTuple_New(2+__pyx_t_27); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error)
10474  __Pyx_GOTREF(__pyx_t_3);
10475  if (__pyx_t_5) {
10476  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
10477  }
10478  __Pyx_GIVEREF(__pyx_t_6);
10479  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_27, __pyx_t_6);
10480  __Pyx_GIVEREF(__pyx_t_1);
10481  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_27, __pyx_t_1);
10482  __pyx_t_6 = 0;
10483  __pyx_t_1 = 0;
10484  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 530, __pyx_L1_error)
10485  __Pyx_GOTREF(__pyx_t_8);
10486  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10487  }
10488  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10489  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
10490  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10491  __pyx_v_ls_phi = __pyx_t_12;
10492 
10493  /* "mprans/cMoveMeshMonitor.pyx":528
10494  * v_grad = pc.getGradientValue(nearestN, xi)
10495  * area = pc.getAreaValue(nearestN, xi)
10496  * if u_phi is not None: # <<<<<<<<<<<<<<
10497  * # line below needs optimisation:
10498  * ls_phi = pc.getLevelSetValue(nearestN, coords)
10499  */
10500  goto __pyx_L54;
10501  }
10502 
10503  /* "mprans/cMoveMeshMonitor.pyx":532
10504  * ls_phi = pc.getLevelSetValue(nearestN, coords)
10505  * else:
10506  * ls_phi = 1e12 # <<<<<<<<<<<<<<
10507  * f = pc.evaluateFunAtX(x=coords, ls_phi=ls_phi)
10508  * for ndi in range(nd):
10509  */
10510  /*else*/ {
10511  __pyx_v_ls_phi = 1e12;
10512  }
10513  __pyx_L54:;
10514 
10515  /* "mprans/cMoveMeshMonitor.pyx":533
10516  * else:
10517  * ls_phi = 1e12
10518  * f = pc.evaluateFunAtX(x=coords, ls_phi=ls_phi) # <<<<<<<<<<<<<<
10519  * for ndi in range(nd):
10520  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
10521  */
10522  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_evaluateFunAtX); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 533, __pyx_L1_error)
10523  __Pyx_GOTREF(__pyx_t_8);
10524  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error)
10525  __Pyx_GOTREF(__pyx_t_4);
10526  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
10527  __Pyx_GOTREF(__pyx_t_3);
10528  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 533, __pyx_L1_error)
10529  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10530  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_ls_phi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
10531  __Pyx_GOTREF(__pyx_t_3);
10532  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ls_phi, __pyx_t_3) < 0) __PYX_ERR(0, 533, __pyx_L1_error)
10533  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10534  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
10535  __Pyx_GOTREF(__pyx_t_3);
10536  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10537  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10538  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 533, __pyx_L1_error)
10539  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10540  __pyx_v_f = __pyx_t_12;
10541 
10542  /* "mprans/cMoveMeshMonitor.pyx":534
10543  * ls_phi = 1e12
10544  * f = pc.evaluateFunAtX(x=coords, ls_phi=ls_phi)
10545  * for ndi in range(nd): # <<<<<<<<<<<<<<
10546  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
10547  * coords[ndi] += dphi[ndi]*dt*fixed_dir[ndi]
10548  */
10549  __pyx_t_27 = __pyx_v_nd;
10550  __pyx_t_28 = __pyx_t_27;
10551  for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
10552  __pyx_v_ndi = __pyx_t_29;
10553 
10554  /* "mprans/cMoveMeshMonitor.pyx":535
10555  * f = pc.evaluateFunAtX(x=coords, ls_phi=ls_phi)
10556  * for ndi in range(nd):
10557  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area) # <<<<<<<<<<<<<<
10558  * coords[ndi] += dphi[ndi]*dt*fixed_dir[ndi]
10559  * xx[node, ndi] = coords[ndi]
10560  */
10561  __pyx_t_36 = __pyx_v_ndi;
10562  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_v_grad.shape[0];
10563  __pyx_t_35 = __pyx_v_ndi;
10564  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_dphi.shape[0];
10565  *((double *) ( /* dim=0 */ (__pyx_v_dphi.data + __pyx_t_35 * __pyx_v_dphi.strides[0]) )) = ((*((double *) ( /* dim=0 */ (__pyx_v_v_grad.data + __pyx_t_36 * __pyx_v_v_grad.strides[0]) ))) / (((__pyx_v_t * 1.) / (__pyx_v_f * __pyx_v_Ccoeff)) + (((1.0 - __pyx_v_t) * 1.) / __pyx_v_area)));
10566 
10567  /* "mprans/cMoveMeshMonitor.pyx":536
10568  * for ndi in range(nd):
10569  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
10570  * coords[ndi] += dphi[ndi]*dt*fixed_dir[ndi] # <<<<<<<<<<<<<<
10571  * xx[node, ndi] = coords[ndi]
10572  * else: # info to send to other processor
10573  */
10574  __pyx_t_36 = __pyx_v_ndi;
10575  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_dphi.shape[0];
10576  __pyx_t_35 = __pyx_v_ndi;
10577  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
10578  __pyx_t_33 = __pyx_v_ndi;
10579  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_coords.shape[0];
10580  *((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_33 * __pyx_v_coords.strides[0]) )) += (((*((double *) ( /* dim=0 */ (__pyx_v_dphi.data + __pyx_t_36 * __pyx_v_dphi.strides[0]) ))) * __pyx_v_dt) * (*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) ))));
10581 
10582  /* "mprans/cMoveMeshMonitor.pyx":537
10583  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
10584  * coords[ndi] += dphi[ndi]*dt*fixed_dir[ndi]
10585  * xx[node, ndi] = coords[ndi] # <<<<<<<<<<<<<<
10586  * else: # info to send to other processor
10587  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank],
10588  */
10589  __pyx_t_35 = __pyx_v_ndi;
10590  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
10591  __pyx_t_36 = __pyx_v_node;
10592  __pyx_t_33 = __pyx_v_ndi;
10593  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_xx.shape[0];
10594  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_xx.shape[1];
10595  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_xx.data + __pyx_t_36 * __pyx_v_xx.strides[0]) ) + __pyx_t_33 * __pyx_v_xx.strides[1]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )));
10596  }
10597 
10598  /* "mprans/cMoveMeshMonitor.pyx":523
10599  * print('dot: ', dot)
10600  * comm.Abort()
10601  * if inside_eN: # <<<<<<<<<<<<<<
10602  * xi = femSpace.elementMaps.getInverseValue(nearestN, coords)
10603  * # line below needs optimisation:
10604  */
10605  }
10606 
10607  /* "mprans/cMoveMeshMonitor.pyx":459
10608  * typeN = result[1]
10609  * new_rank = result[2]
10610  * if new_rank == my_rank: # <<<<<<<<<<<<<<
10611  * inside_eN = True
10612  * nearestNArray[node] = nearestN
10613  */
10614  goto __pyx_L29;
10615  }
10616 
10617  /* "mprans/cMoveMeshMonitor.pyx":539
10618  * xx[node, ndi] = coords[ndi]
10619  * else: # info to send to other processor
10620  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank], # <<<<<<<<<<<<<<
10621  * [[coords[0],
10622  * coords[1],
10623  */
10624  /*else*/ {
10625  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
10626  __Pyx_GOTREF(__pyx_t_3);
10627  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_append); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
10628  __Pyx_GOTREF(__pyx_t_4);
10629  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10630  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_new_rank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
10631  __Pyx_GOTREF(__pyx_t_3);
10632  __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 539, __pyx_L1_error)
10633  __Pyx_GOTREF(__pyx_t_8);
10634  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10635 
10636  /* "mprans/cMoveMeshMonitor.pyx":540
10637  * else: # info to send to other processor
10638  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank],
10639  * [[coords[0], # <<<<<<<<<<<<<<
10640  * coords[1],
10641  * coords[2],
10642  */
10643  __pyx_t_35 = 0;
10644  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
10645  __pyx_t_3 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error)
10646  __Pyx_GOTREF(__pyx_t_3);
10647 
10648  /* "mprans/cMoveMeshMonitor.pyx":541
10649  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank],
10650  * [[coords[0],
10651  * coords[1], # <<<<<<<<<<<<<<
10652  * coords[2],
10653  * nearestN,
10654  */
10655  __pyx_t_35 = 1;
10656  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
10657  __pyx_t_1 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
10658  __Pyx_GOTREF(__pyx_t_1);
10659 
10660  /* "mprans/cMoveMeshMonitor.pyx":542
10661  * [[coords[0],
10662  * coords[1],
10663  * coords[2], # <<<<<<<<<<<<<<
10664  * nearestN,
10665  * typeN,
10666  */
10667  __pyx_t_35 = 2;
10668  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
10669  __pyx_t_6 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 542, __pyx_L1_error)
10670  __Pyx_GOTREF(__pyx_t_6);
10671 
10672  /* "mprans/cMoveMeshMonitor.pyx":543
10673  * coords[1],
10674  * coords[2],
10675  * nearestN, # <<<<<<<<<<<<<<
10676  * typeN,
10677  * 0,
10678  */
10679  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nearestN); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
10680  __Pyx_GOTREF(__pyx_t_5);
10681 
10682  /* "mprans/cMoveMeshMonitor.pyx":544
10683  * coords[2],
10684  * nearestN,
10685  * typeN, # <<<<<<<<<<<<<<
10686  * 0,
10687  * 0,
10688  */
10689  __pyx_t_42 = __Pyx_PyInt_From_int(__pyx_v_typeN); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 544, __pyx_L1_error)
10690  __Pyx_GOTREF(__pyx_t_42);
10691 
10692  /* "mprans/cMoveMeshMonitor.pyx":550
10693  * 0,
10694  * 0,
10695  * node, # <<<<<<<<<<<<<<
10696  * my_rank,
10697  * fixed_dir[0],
10698  */
10699  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_node); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 550, __pyx_L1_error)
10700  __Pyx_GOTREF(__pyx_t_7);
10701 
10702  /* "mprans/cMoveMeshMonitor.pyx":551
10703  * 0,
10704  * node,
10705  * my_rank, # <<<<<<<<<<<<<<
10706  * fixed_dir[0],
10707  * fixed_dir[1],
10708  */
10709  __pyx_t_43 = __Pyx_PyInt_From_int(__pyx_v_my_rank); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 551, __pyx_L1_error)
10710  __Pyx_GOTREF(__pyx_t_43);
10711 
10712  /* "mprans/cMoveMeshMonitor.pyx":552
10713  * node,
10714  * my_rank,
10715  * fixed_dir[0], # <<<<<<<<<<<<<<
10716  * fixed_dir[1],
10717  * fixed_dir[2]]],
10718  */
10719  __pyx_t_35 = 0;
10720  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
10721  __pyx_t_44 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) )))); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 552, __pyx_L1_error)
10722  __Pyx_GOTREF(__pyx_t_44);
10723 
10724  /* "mprans/cMoveMeshMonitor.pyx":553
10725  * my_rank,
10726  * fixed_dir[0],
10727  * fixed_dir[1], # <<<<<<<<<<<<<<
10728  * fixed_dir[2]]],
10729  * axis=0)
10730  */
10731  __pyx_t_35 = 1;
10732  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
10733  __pyx_t_45 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) )))); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 553, __pyx_L1_error)
10734  __Pyx_GOTREF(__pyx_t_45);
10735 
10736  /* "mprans/cMoveMeshMonitor.pyx":554
10737  * fixed_dir[0],
10738  * fixed_dir[1],
10739  * fixed_dir[2]]], # <<<<<<<<<<<<<<
10740  * axis=0)
10741  * nodesSentBoolArray[node] = 1
10742  */
10743  __pyx_t_35 = 2;
10744  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
10745  __pyx_t_46 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) )))); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 554, __pyx_L1_error)
10746  __Pyx_GOTREF(__pyx_t_46);
10747 
10748  /* "mprans/cMoveMeshMonitor.pyx":540
10749  * else: # info to send to other processor
10750  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank],
10751  * [[coords[0], # <<<<<<<<<<<<<<
10752  * coords[1],
10753  * coords[2],
10754  */
10755  __pyx_t_47 = PyList_New(15); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 540, __pyx_L1_error)
10756  __Pyx_GOTREF(__pyx_t_47);
10757  __Pyx_GIVEREF(__pyx_t_3);
10758  PyList_SET_ITEM(__pyx_t_47, 0, __pyx_t_3);
10759  __Pyx_GIVEREF(__pyx_t_1);
10760  PyList_SET_ITEM(__pyx_t_47, 1, __pyx_t_1);
10761  __Pyx_GIVEREF(__pyx_t_6);
10762  PyList_SET_ITEM(__pyx_t_47, 2, __pyx_t_6);
10763  __Pyx_GIVEREF(__pyx_t_5);
10764  PyList_SET_ITEM(__pyx_t_47, 3, __pyx_t_5);
10765  __Pyx_GIVEREF(__pyx_t_42);
10766  PyList_SET_ITEM(__pyx_t_47, 4, __pyx_t_42);
10767  __Pyx_INCREF(__pyx_int_0);
10768  __Pyx_GIVEREF(__pyx_int_0);
10769  PyList_SET_ITEM(__pyx_t_47, 5, __pyx_int_0);
10770  __Pyx_INCREF(__pyx_int_0);
10771  __Pyx_GIVEREF(__pyx_int_0);
10772  PyList_SET_ITEM(__pyx_t_47, 6, __pyx_int_0);
10773  __Pyx_INCREF(__pyx_int_0);
10774  __Pyx_GIVEREF(__pyx_int_0);
10775  PyList_SET_ITEM(__pyx_t_47, 7, __pyx_int_0);
10776  __Pyx_INCREF(__pyx_int_0);
10777  __Pyx_GIVEREF(__pyx_int_0);
10778  PyList_SET_ITEM(__pyx_t_47, 8, __pyx_int_0);
10779  __Pyx_INCREF(__pyx_int_0);
10780  __Pyx_GIVEREF(__pyx_int_0);
10781  PyList_SET_ITEM(__pyx_t_47, 9, __pyx_int_0);
10782  __Pyx_GIVEREF(__pyx_t_7);
10783  PyList_SET_ITEM(__pyx_t_47, 10, __pyx_t_7);
10784  __Pyx_GIVEREF(__pyx_t_43);
10785  PyList_SET_ITEM(__pyx_t_47, 11, __pyx_t_43);
10786  __Pyx_GIVEREF(__pyx_t_44);
10787  PyList_SET_ITEM(__pyx_t_47, 12, __pyx_t_44);
10788  __Pyx_GIVEREF(__pyx_t_45);
10789  PyList_SET_ITEM(__pyx_t_47, 13, __pyx_t_45);
10790  __Pyx_GIVEREF(__pyx_t_46);
10791  PyList_SET_ITEM(__pyx_t_47, 14, __pyx_t_46);
10792  __pyx_t_3 = 0;
10793  __pyx_t_1 = 0;
10794  __pyx_t_6 = 0;
10795  __pyx_t_5 = 0;
10796  __pyx_t_42 = 0;
10797  __pyx_t_7 = 0;
10798  __pyx_t_43 = 0;
10799  __pyx_t_44 = 0;
10800  __pyx_t_45 = 0;
10801  __pyx_t_46 = 0;
10802  __pyx_t_46 = PyList_New(1); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 540, __pyx_L1_error)
10803  __Pyx_GOTREF(__pyx_t_46);
10804  __Pyx_GIVEREF(__pyx_t_47);
10805  PyList_SET_ITEM(__pyx_t_46, 0, __pyx_t_47);
10806  __pyx_t_47 = 0;
10807 
10808  /* "mprans/cMoveMeshMonitor.pyx":539
10809  * xx[node, ndi] = coords[ndi]
10810  * else: # info to send to other processor
10811  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank], # <<<<<<<<<<<<<<
10812  * [[coords[0],
10813  * coords[1],
10814  */
10815  __pyx_t_47 = PyTuple_New(2); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 539, __pyx_L1_error)
10816  __Pyx_GOTREF(__pyx_t_47);
10817  __Pyx_GIVEREF(__pyx_t_8);
10818  PyTuple_SET_ITEM(__pyx_t_47, 0, __pyx_t_8);
10819  __Pyx_GIVEREF(__pyx_t_46);
10820  PyTuple_SET_ITEM(__pyx_t_47, 1, __pyx_t_46);
10821  __pyx_t_8 = 0;
10822  __pyx_t_46 = 0;
10823 
10824  /* "mprans/cMoveMeshMonitor.pyx":555
10825  * fixed_dir[1],
10826  * fixed_dir[2]]],
10827  * axis=0) # <<<<<<<<<<<<<<
10828  * nodesSentBoolArray[node] = 1
10829  * nPending_disp += 1
10830  */
10831  __pyx_t_46 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 555, __pyx_L1_error)
10832  __Pyx_GOTREF(__pyx_t_46);
10833  if (PyDict_SetItem(__pyx_t_46, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 555, __pyx_L1_error)
10834 
10835  /* "mprans/cMoveMeshMonitor.pyx":539
10836  * xx[node, ndi] = coords[ndi]
10837  * else: # info to send to other processor
10838  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank], # <<<<<<<<<<<<<<
10839  * [[coords[0],
10840  * coords[1],
10841  */
10842  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_47, __pyx_t_46); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 539, __pyx_L1_error)
10843  __Pyx_GOTREF(__pyx_t_8);
10844  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10845  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
10846  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
10847  __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_new_rank); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 539, __pyx_L1_error)
10848  __Pyx_GOTREF(__pyx_t_46);
10849  if (unlikely(PyDict_SetItem(__pyx_v_coords_2rank, __pyx_t_46, __pyx_t_8) < 0)) __PYX_ERR(0, 539, __pyx_L1_error)
10850  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
10851  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10852 
10853  /* "mprans/cMoveMeshMonitor.pyx":556
10854  * fixed_dir[2]]],
10855  * axis=0)
10856  * nodesSentBoolArray[node] = 1 # <<<<<<<<<<<<<<
10857  * nPending_disp += 1
10858  * # parallel comm
10859  */
10860  __pyx_t_35 = __pyx_v_node;
10861  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_nodesSentBoolArray.shape[0];
10862  *((double *) ( /* dim=0 */ (__pyx_v_nodesSentBoolArray.data + __pyx_t_35 * __pyx_v_nodesSentBoolArray.strides[0]) )) = 1.0;
10863 
10864  /* "mprans/cMoveMeshMonitor.pyx":557
10865  * axis=0)
10866  * nodesSentBoolArray[node] = 1
10867  * nPending_disp += 1 # <<<<<<<<<<<<<<
10868  * # parallel comm
10869  * comm.barrier()
10870  */
10871  __pyx_v_nPending_disp = (__pyx_v_nPending_disp + 1);
10872  }
10873  __pyx_L29:;
10874  }
10875  __pyx_L20:;
10876 
10877  /* "mprans/cMoveMeshMonitor.pyx":411
10878  * nodeMaterialTypes=nodeMaterialTypes,
10879  * )
10880  * if not fixed: # either flag==0 or not fixed # <<<<<<<<<<<<<<
10881  * if coords[0] == nodeArray[node, 0] and coords[1] == nodeArray[node, 1] and coords[2] == nodeArray[node, 2]: # nodes are at original position (no search)
10882  * # if i_time == 0:
10883  */
10884  }
10885 
10886  /* "mprans/cMoveMeshMonitor.pyx":398
10887  * pending = True
10888  * nPending_disp += 1
10889  * elif nodesSentBoolArray[node] == 0: # <<<<<<<<<<<<<<
10890  * if flag != 0:
10891  * if fixedNodesBoolArray[node] == 1:
10892  */
10893  }
10894  __pyx_L16:;
10895  }
10896 
10897  /* "mprans/cMoveMeshMonitor.pyx":559
10898  * nPending_disp += 1
10899  * # parallel comm
10900  * comm.barrier() # <<<<<<<<<<<<<<
10901  * if comm_size > 1:
10902  * # number of pending solutions to send to other processors
10903  */
10904  __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 559, __pyx_L1_error)
10905  __Pyx_GOTREF(__pyx_t_46);
10906  __pyx_t_47 = NULL;
10907  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_46))) {
10908  __pyx_t_47 = PyMethod_GET_SELF(__pyx_t_46);
10909  if (likely(__pyx_t_47)) {
10910  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_46);
10911  __Pyx_INCREF(__pyx_t_47);
10912  __Pyx_INCREF(function);
10913  __Pyx_DECREF_SET(__pyx_t_46, function);
10914  }
10915  }
10916  __pyx_t_8 = (__pyx_t_47) ? __Pyx_PyObject_CallOneArg(__pyx_t_46, __pyx_t_47) : __Pyx_PyObject_CallNoArg(__pyx_t_46);
10917  __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
10918  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 559, __pyx_L1_error)
10919  __Pyx_GOTREF(__pyx_t_8);
10920  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
10921  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10922 
10923  /* "mprans/cMoveMeshMonitor.pyx":560
10924  * # parallel comm
10925  * comm.barrier()
10926  * if comm_size > 1: # <<<<<<<<<<<<<<
10927  * # number of pending solutions to send to other processors
10928  * nPending_disp_total = comm.allreduce(nPending_disp)
10929  */
10930  __pyx_t_19 = ((__pyx_cur_scope->__pyx_v_comm_size > 1) != 0);
10931  if (__pyx_t_19) {
10932 
10933  /* "mprans/cMoveMeshMonitor.pyx":562
10934  * if comm_size > 1:
10935  * # number of pending solutions to send to other processors
10936  * nPending_disp_total = comm.allreduce(nPending_disp) # <<<<<<<<<<<<<<
10937  * parallel_steps = -1
10938  * while nPending_disp_total > 0:
10939  */
10940  __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_allreduce); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 562, __pyx_L1_error)
10941  __Pyx_GOTREF(__pyx_t_46);
10942  __pyx_t_47 = __Pyx_PyInt_From_int(__pyx_v_nPending_disp); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 562, __pyx_L1_error)
10943  __Pyx_GOTREF(__pyx_t_47);
10944  __pyx_t_4 = NULL;
10945  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_46))) {
10946  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_46);
10947  if (likely(__pyx_t_4)) {
10948  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_46);
10949  __Pyx_INCREF(__pyx_t_4);
10950  __Pyx_INCREF(function);
10951  __Pyx_DECREF_SET(__pyx_t_46, function);
10952  }
10953  }
10954  __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_46, __pyx_t_4, __pyx_t_47) : __Pyx_PyObject_CallOneArg(__pyx_t_46, __pyx_t_47);
10955  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10956  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
10957  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __pyx_L1_error)
10958  __Pyx_GOTREF(__pyx_t_8);
10959  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
10960  __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L1_error)
10961  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10962  __pyx_v_nPending_disp_total = __pyx_t_22;
10963 
10964  /* "mprans/cMoveMeshMonitor.pyx":563
10965  * # number of pending solutions to send to other processors
10966  * nPending_disp_total = comm.allreduce(nPending_disp)
10967  * parallel_steps = -1 # <<<<<<<<<<<<<<
10968  * while nPending_disp_total > 0:
10969  * parallel_steps += 1
10970  */
10971  __pyx_v_parallel_steps = -1;
10972 
10973  /* "mprans/cMoveMeshMonitor.pyx":564
10974  * nPending_disp_total = comm.allreduce(nPending_disp)
10975  * parallel_steps = -1
10976  * while nPending_disp_total > 0: # <<<<<<<<<<<<<<
10977  * parallel_steps += 1
10978  * nPending_disp = 0
10979  */
10980  while (1) {
10981  __pyx_t_19 = ((__pyx_v_nPending_disp_total > 0) != 0);
10982  if (!__pyx_t_19) break;
10983 
10984  /* "mprans/cMoveMeshMonitor.pyx":565
10985  * parallel_steps = -1
10986  * while nPending_disp_total > 0:
10987  * parallel_steps += 1 # <<<<<<<<<<<<<<
10988  * nPending_disp = 0
10989  * sendBack = True
10990  */
10991  __pyx_v_parallel_steps = (__pyx_v_parallel_steps + 1);
10992 
10993  /* "mprans/cMoveMeshMonitor.pyx":566
10994  * while nPending_disp_total > 0:
10995  * parallel_steps += 1
10996  * nPending_disp = 0 # <<<<<<<<<<<<<<
10997  * sendBack = True
10998  * # initialize solution from previously found solutions
10999  */
11000  __pyx_v_nPending_disp = 0;
11001 
11002  /* "mprans/cMoveMeshMonitor.pyx":567
11003  * parallel_steps += 1
11004  * nPending_disp = 0
11005  * sendBack = True # <<<<<<<<<<<<<<
11006  * # initialize solution from previously found solutions
11007  * # coords_2doArray = coords_2rank[my_rank]
11008  */
11009  __pyx_v_sendBack = 1;
11010 
11011  /* "mprans/cMoveMeshMonitor.pyx":571
11012  * # coords_2doArray = coords_2rank[my_rank]
11013  * # gather counts info from all processors
11014  * for rank in range(comm_size): # <<<<<<<<<<<<<<
11015  * counts_local[rank] = len(coords_2rank[rank])
11016  * comm.Allgatherv([counts_local, MPI.INT],
11017  */
11018  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 571, __pyx_L1_error)
11019  __Pyx_GOTREF(__pyx_t_8);
11020  __pyx_t_46 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 571, __pyx_L1_error)
11021  __Pyx_GOTREF(__pyx_t_46);
11022  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11023  if (likely(PyList_CheckExact(__pyx_t_46)) || PyTuple_CheckExact(__pyx_t_46)) {
11024  __pyx_t_8 = __pyx_t_46; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
11025  __pyx_t_16 = NULL;
11026  } else {
11027  __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_46); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 571, __pyx_L1_error)
11028  __Pyx_GOTREF(__pyx_t_8);
11029  __pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 571, __pyx_L1_error)
11030  }
11031  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11032  for (;;) {
11033  if (likely(!__pyx_t_16)) {
11034  if (likely(PyList_CheckExact(__pyx_t_8))) {
11035  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break;
11036  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11037  __pyx_t_46 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_46); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 571, __pyx_L1_error)
11038  #else
11039  __pyx_t_46 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 571, __pyx_L1_error)
11040  __Pyx_GOTREF(__pyx_t_46);
11041  #endif
11042  } else {
11043  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
11044  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11045  __pyx_t_46 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_46); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 571, __pyx_L1_error)
11046  #else
11047  __pyx_t_46 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 571, __pyx_L1_error)
11048  __Pyx_GOTREF(__pyx_t_46);
11049  #endif
11050  }
11051  } else {
11052  __pyx_t_46 = __pyx_t_16(__pyx_t_8);
11053  if (unlikely(!__pyx_t_46)) {
11054  PyObject* exc_type = PyErr_Occurred();
11055  if (exc_type) {
11056  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11057  else __PYX_ERR(0, 571, __pyx_L1_error)
11058  }
11059  break;
11060  }
11061  __Pyx_GOTREF(__pyx_t_46);
11062  }
11063  __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_46);
11064  __pyx_t_46 = 0;
11065 
11066  /* "mprans/cMoveMeshMonitor.pyx":572
11067  * # gather counts info from all processors
11068  * for rank in range(comm_size):
11069  * counts_local[rank] = len(coords_2rank[rank]) # <<<<<<<<<<<<<<
11070  * comm.Allgatherv([counts_local, MPI.INT],
11071  * [counts_total,
11072  */
11073  __pyx_t_46 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_v_rank); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 572, __pyx_L1_error)
11074  __Pyx_GOTREF(__pyx_t_46);
11075  __pyx_t_41 = PyObject_Length(__pyx_t_46); if (unlikely(__pyx_t_41 == ((Py_ssize_t)-1))) __PYX_ERR(0, 572, __pyx_L1_error)
11076  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11077  __pyx_t_48 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank); if (unlikely((__pyx_t_48 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 572, __pyx_L1_error)
11078  __pyx_t_35 = __pyx_t_48;
11079  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_counts_local.shape[0];
11080  *((int *) ( /* dim=0 */ (__pyx_v_counts_local.data + __pyx_t_35 * __pyx_v_counts_local.strides[0]) )) = __pyx_t_41;
11081 
11082  /* "mprans/cMoveMeshMonitor.pyx":571
11083  * # coords_2doArray = coords_2rank[my_rank]
11084  * # gather counts info from all processors
11085  * for rank in range(comm_size): # <<<<<<<<<<<<<<
11086  * counts_local[rank] = len(coords_2rank[rank])
11087  * comm.Allgatherv([counts_local, MPI.INT],
11088  */
11089  }
11090  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11091 
11092  /* "mprans/cMoveMeshMonitor.pyx":573
11093  * for rank in range(comm_size):
11094  * counts_local[rank] = len(coords_2rank[rank])
11095  * comm.Allgatherv([counts_local, MPI.INT], # <<<<<<<<<<<<<<
11096  * [counts_total,
11097  * [comm_size for i in range(comm_size)],
11098  */
11099  __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_Allgatherv); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 573, __pyx_L1_error)
11100  __Pyx_GOTREF(__pyx_t_46);
11101  __pyx_t_47 = __pyx_memoryview_fromslice(__pyx_v_counts_local, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 573, __pyx_L1_error)
11102  __Pyx_GOTREF(__pyx_t_47);
11103  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MPI); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 573, __pyx_L1_error)
11104  __Pyx_GOTREF(__pyx_t_4);
11105  __pyx_t_45 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_INT); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 573, __pyx_L1_error)
11106  __Pyx_GOTREF(__pyx_t_45);
11107  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11108  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 573, __pyx_L1_error)
11109  __Pyx_GOTREF(__pyx_t_4);
11110  __Pyx_GIVEREF(__pyx_t_47);
11111  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_47);
11112  __Pyx_GIVEREF(__pyx_t_45);
11113  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_45);
11114  __pyx_t_47 = 0;
11115  __pyx_t_45 = 0;
11116 
11117  /* "mprans/cMoveMeshMonitor.pyx":574
11118  * counts_local[rank] = len(coords_2rank[rank])
11119  * comm.Allgatherv([counts_local, MPI.INT],
11120  * [counts_total, # <<<<<<<<<<<<<<
11121  * [comm_size for i in range(comm_size)],
11122  * [comm_size*i for i in range(comm_size)],
11123  */
11124  __pyx_t_45 = __pyx_memoryview_fromslice(__pyx_v_counts_total, 2, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 574, __pyx_L1_error)
11125  __Pyx_GOTREF(__pyx_t_45);
11126 
11127  /* "mprans/cMoveMeshMonitor.pyx":575
11128  * comm.Allgatherv([counts_local, MPI.INT],
11129  * [counts_total,
11130  * [comm_size for i in range(comm_size)], # <<<<<<<<<<<<<<
11131  * [comm_size*i for i in range(comm_size)],
11132  * MPI.INT])
11133  */
11134  __pyx_t_47 = PyList_New(0); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 575, __pyx_L1_error)
11135  __Pyx_GOTREF(__pyx_t_47);
11136  __pyx_t_22 = __pyx_cur_scope->__pyx_v_comm_size;
11137  __pyx_t_23 = __pyx_t_22;
11138  for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
11139  __pyx_v_i = __pyx_t_24;
11140  __pyx_t_44 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 575, __pyx_L1_error)
11141  __Pyx_GOTREF(__pyx_t_44);
11142  if (unlikely(__Pyx_ListComp_Append(__pyx_t_47, (PyObject*)__pyx_t_44))) __PYX_ERR(0, 575, __pyx_L1_error)
11143  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11144  }
11145 
11146  /* "mprans/cMoveMeshMonitor.pyx":576
11147  * [counts_total,
11148  * [comm_size for i in range(comm_size)],
11149  * [comm_size*i for i in range(comm_size)], # <<<<<<<<<<<<<<
11150  * MPI.INT])
11151  * comm.barrier()
11152  */
11153  __pyx_t_44 = PyList_New(0); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 576, __pyx_L1_error)
11154  __Pyx_GOTREF(__pyx_t_44);
11155  __pyx_t_22 = __pyx_cur_scope->__pyx_v_comm_size;
11156  __pyx_t_23 = __pyx_t_22;
11157  for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
11158  __pyx_v_i = __pyx_t_24;
11159  __pyx_t_43 = __Pyx_PyInt_From_int((__pyx_cur_scope->__pyx_v_comm_size * __pyx_v_i)); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 576, __pyx_L1_error)
11160  __Pyx_GOTREF(__pyx_t_43);
11161  if (unlikely(__Pyx_ListComp_Append(__pyx_t_44, (PyObject*)__pyx_t_43))) __PYX_ERR(0, 576, __pyx_L1_error)
11162  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11163  }
11164 
11165  /* "mprans/cMoveMeshMonitor.pyx":577
11166  * [comm_size for i in range(comm_size)],
11167  * [comm_size*i for i in range(comm_size)],
11168  * MPI.INT]) # <<<<<<<<<<<<<<
11169  * comm.barrier()
11170  * # calculate array_size for current rank
11171  */
11172  __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_MPI); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 577, __pyx_L1_error)
11173  __Pyx_GOTREF(__pyx_t_43);
11174  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_INT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __pyx_L1_error)
11175  __Pyx_GOTREF(__pyx_t_7);
11176  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11177 
11178  /* "mprans/cMoveMeshMonitor.pyx":574
11179  * counts_local[rank] = len(coords_2rank[rank])
11180  * comm.Allgatherv([counts_local, MPI.INT],
11181  * [counts_total, # <<<<<<<<<<<<<<
11182  * [comm_size for i in range(comm_size)],
11183  * [comm_size*i for i in range(comm_size)],
11184  */
11185  __pyx_t_43 = PyList_New(4); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 574, __pyx_L1_error)
11186  __Pyx_GOTREF(__pyx_t_43);
11187  __Pyx_GIVEREF(__pyx_t_45);
11188  PyList_SET_ITEM(__pyx_t_43, 0, __pyx_t_45);
11189  __Pyx_GIVEREF(__pyx_t_47);
11190  PyList_SET_ITEM(__pyx_t_43, 1, __pyx_t_47);
11191  __Pyx_GIVEREF(__pyx_t_44);
11192  PyList_SET_ITEM(__pyx_t_43, 2, __pyx_t_44);
11193  __Pyx_GIVEREF(__pyx_t_7);
11194  PyList_SET_ITEM(__pyx_t_43, 3, __pyx_t_7);
11195  __pyx_t_45 = 0;
11196  __pyx_t_47 = 0;
11197  __pyx_t_44 = 0;
11198  __pyx_t_7 = 0;
11199  __pyx_t_7 = NULL;
11200  __pyx_t_22 = 0;
11201  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_46))) {
11202  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_46);
11203  if (likely(__pyx_t_7)) {
11204  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_46);
11205  __Pyx_INCREF(__pyx_t_7);
11206  __Pyx_INCREF(function);
11207  __Pyx_DECREF_SET(__pyx_t_46, function);
11208  __pyx_t_22 = 1;
11209  }
11210  }
11211  #if CYTHON_FAST_PYCALL
11212  if (PyFunction_Check(__pyx_t_46)) {
11213  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_t_43};
11214  __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_46, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error)
11215  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11216  __Pyx_GOTREF(__pyx_t_8);
11217  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11218  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11219  } else
11220  #endif
11221  #if CYTHON_FAST_PYCCALL
11222  if (__Pyx_PyFastCFunction_Check(__pyx_t_46)) {
11223  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_t_43};
11224  __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_46, __pyx_temp+1-__pyx_t_22, 2+__pyx_t_22); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error)
11225  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11226  __Pyx_GOTREF(__pyx_t_8);
11227  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11228  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11229  } else
11230  #endif
11231  {
11232  __pyx_t_44 = PyTuple_New(2+__pyx_t_22); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 573, __pyx_L1_error)
11233  __Pyx_GOTREF(__pyx_t_44);
11234  if (__pyx_t_7) {
11235  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_t_7); __pyx_t_7 = NULL;
11236  }
11237  __Pyx_GIVEREF(__pyx_t_4);
11238  PyTuple_SET_ITEM(__pyx_t_44, 0+__pyx_t_22, __pyx_t_4);
11239  __Pyx_GIVEREF(__pyx_t_43);
11240  PyTuple_SET_ITEM(__pyx_t_44, 1+__pyx_t_22, __pyx_t_43);
11241  __pyx_t_4 = 0;
11242  __pyx_t_43 = 0;
11243  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_46, __pyx_t_44, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error)
11244  __Pyx_GOTREF(__pyx_t_8);
11245  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11246  }
11247  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11248  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11249 
11250  /* "mprans/cMoveMeshMonitor.pyx":578
11251  * [comm_size*i for i in range(comm_size)],
11252  * MPI.INT])
11253  * comm.barrier() # <<<<<<<<<<<<<<
11254  * # calculate array_size for current rank
11255  * for rank_recv in range(comm_size):
11256  */
11257  __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 578, __pyx_L1_error)
11258  __Pyx_GOTREF(__pyx_t_46);
11259  __pyx_t_44 = NULL;
11260  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_46))) {
11261  __pyx_t_44 = PyMethod_GET_SELF(__pyx_t_46);
11262  if (likely(__pyx_t_44)) {
11263  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_46);
11264  __Pyx_INCREF(__pyx_t_44);
11265  __Pyx_INCREF(function);
11266  __Pyx_DECREF_SET(__pyx_t_46, function);
11267  }
11268  }
11269  __pyx_t_8 = (__pyx_t_44) ? __Pyx_PyObject_CallOneArg(__pyx_t_46, __pyx_t_44) : __Pyx_PyObject_CallNoArg(__pyx_t_46);
11270  __Pyx_XDECREF(__pyx_t_44); __pyx_t_44 = 0;
11271  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 578, __pyx_L1_error)
11272  __Pyx_GOTREF(__pyx_t_8);
11273  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11274  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11275 
11276  /* "mprans/cMoveMeshMonitor.pyx":580
11277  * comm.barrier()
11278  * # calculate array_size for current rank
11279  * for rank_recv in range(comm_size): # <<<<<<<<<<<<<<
11280  * array_size = 0
11281  * for rank in range(comm_size):
11282  */
11283  __pyx_t_22 = __pyx_cur_scope->__pyx_v_comm_size;
11284  __pyx_t_23 = __pyx_t_22;
11285  for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
11286  __pyx_v_rank_recv = __pyx_t_24;
11287 
11288  /* "mprans/cMoveMeshMonitor.pyx":581
11289  * # calculate array_size for current rank
11290  * for rank_recv in range(comm_size):
11291  * array_size = 0 # <<<<<<<<<<<<<<
11292  * for rank in range(comm_size):
11293  * array_size += counts_total[rank, rank_recv]
11294  */
11295  __Pyx_INCREF(__pyx_int_0);
11296  __Pyx_XDECREF_SET(__pyx_v_array_size, __pyx_int_0);
11297 
11298  /* "mprans/cMoveMeshMonitor.pyx":582
11299  * for rank_recv in range(comm_size):
11300  * array_size = 0
11301  * for rank in range(comm_size): # <<<<<<<<<<<<<<
11302  * array_size += counts_total[rank, rank_recv]
11303  * counts_in[rank] = counts_total[rank, rank_recv]
11304  */
11305  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 582, __pyx_L1_error)
11306  __Pyx_GOTREF(__pyx_t_8);
11307  __pyx_t_46 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 582, __pyx_L1_error)
11308  __Pyx_GOTREF(__pyx_t_46);
11309  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11310  if (likely(PyList_CheckExact(__pyx_t_46)) || PyTuple_CheckExact(__pyx_t_46)) {
11311  __pyx_t_8 = __pyx_t_46; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
11312  __pyx_t_16 = NULL;
11313  } else {
11314  __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_46); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 582, __pyx_L1_error)
11315  __Pyx_GOTREF(__pyx_t_8);
11316  __pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 582, __pyx_L1_error)
11317  }
11318  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11319  for (;;) {
11320  if (likely(!__pyx_t_16)) {
11321  if (likely(PyList_CheckExact(__pyx_t_8))) {
11322  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break;
11323  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11324  __pyx_t_46 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_46); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 582, __pyx_L1_error)
11325  #else
11326  __pyx_t_46 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 582, __pyx_L1_error)
11327  __Pyx_GOTREF(__pyx_t_46);
11328  #endif
11329  } else {
11330  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
11331  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11332  __pyx_t_46 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_46); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 582, __pyx_L1_error)
11333  #else
11334  __pyx_t_46 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 582, __pyx_L1_error)
11335  __Pyx_GOTREF(__pyx_t_46);
11336  #endif
11337  }
11338  } else {
11339  __pyx_t_46 = __pyx_t_16(__pyx_t_8);
11340  if (unlikely(!__pyx_t_46)) {
11341  PyObject* exc_type = PyErr_Occurred();
11342  if (exc_type) {
11343  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11344  else __PYX_ERR(0, 582, __pyx_L1_error)
11345  }
11346  break;
11347  }
11348  __Pyx_GOTREF(__pyx_t_46);
11349  }
11350  __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_46);
11351  __pyx_t_46 = 0;
11352 
11353  /* "mprans/cMoveMeshMonitor.pyx":583
11354  * array_size = 0
11355  * for rank in range(comm_size):
11356  * array_size += counts_total[rank, rank_recv] # <<<<<<<<<<<<<<
11357  * counts_in[rank] = counts_total[rank, rank_recv]
11358  * if rank > 0:
11359  */
11360  __pyx_t_41 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank); if (unlikely((__pyx_t_41 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 583, __pyx_L1_error)
11361  __pyx_t_35 = __pyx_t_41;
11362  __pyx_t_33 = __pyx_v_rank_recv;
11363  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_counts_total.shape[0];
11364  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_counts_total.shape[1];
11365  __pyx_t_46 = __Pyx_PyInt_From_int((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_counts_total.data + __pyx_t_35 * __pyx_v_counts_total.strides[0]) ) + __pyx_t_33 * __pyx_v_counts_total.strides[1]) )))); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 583, __pyx_L1_error)
11366  __Pyx_GOTREF(__pyx_t_46);
11367  __pyx_t_44 = PyNumber_InPlaceAdd(__pyx_v_array_size, __pyx_t_46); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 583, __pyx_L1_error)
11368  __Pyx_GOTREF(__pyx_t_44);
11369  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11370  __Pyx_DECREF_SET(__pyx_v_array_size, __pyx_t_44);
11371  __pyx_t_44 = 0;
11372 
11373  /* "mprans/cMoveMeshMonitor.pyx":584
11374  * for rank in range(comm_size):
11375  * array_size += counts_total[rank, rank_recv]
11376  * counts_in[rank] = counts_total[rank, rank_recv] # <<<<<<<<<<<<<<
11377  * if rank > 0:
11378  * displacements_in[rank] = displacements_in[rank-1]+counts_in[rank-1]
11379  */
11380  __pyx_t_41 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank); if (unlikely((__pyx_t_41 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error)
11381  __pyx_t_33 = __pyx_t_41;
11382  __pyx_t_35 = __pyx_v_rank_recv;
11383  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_counts_total.shape[0];
11384  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_counts_total.shape[1];
11385  __pyx_t_48 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank); if (unlikely((__pyx_t_48 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error)
11386  __pyx_t_36 = __pyx_t_48;
11387  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_counts_in.shape[0];
11388  *((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_counts_in.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_counts_in.strides[0]) )) = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_counts_total.data + __pyx_t_33 * __pyx_v_counts_total.strides[0]) ) + __pyx_t_35 * __pyx_v_counts_total.strides[1]) )));
11389 
11390  /* "mprans/cMoveMeshMonitor.pyx":585
11391  * array_size += counts_total[rank, rank_recv]
11392  * counts_in[rank] = counts_total[rank, rank_recv]
11393  * if rank > 0: # <<<<<<<<<<<<<<
11394  * displacements_in[rank] = displacements_in[rank-1]+counts_in[rank-1]
11395  * # check if another parallel comm is needed
11396  */
11397  __pyx_t_44 = PyObject_RichCompare(__pyx_v_rank, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_44); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 585, __pyx_L1_error)
11398  __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_44); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 585, __pyx_L1_error)
11399  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11400  if (__pyx_t_19) {
11401 
11402  /* "mprans/cMoveMeshMonitor.pyx":586
11403  * counts_in[rank] = counts_total[rank, rank_recv]
11404  * if rank > 0:
11405  * displacements_in[rank] = displacements_in[rank-1]+counts_in[rank-1] # <<<<<<<<<<<<<<
11406  * # check if another parallel comm is needed
11407  * if array_size-counts_total[rank_recv, rank_recv] > 0:
11408  */
11409  __pyx_t_44 = __Pyx_PyInt_SubtractObjC(__pyx_v_rank, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 586, __pyx_L1_error)
11410  __Pyx_GOTREF(__pyx_t_44);
11411  __pyx_t_41 = __Pyx_PyIndex_AsSsize_t(__pyx_t_44); if (unlikely((__pyx_t_41 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error)
11412  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11413  __pyx_t_35 = __pyx_t_41;
11414  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_cur_scope->__pyx_v_displacements_in.shape[0];
11415  __pyx_t_44 = __Pyx_PyInt_SubtractObjC(__pyx_v_rank, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 586, __pyx_L1_error)
11416  __Pyx_GOTREF(__pyx_t_44);
11417  __pyx_t_48 = __Pyx_PyIndex_AsSsize_t(__pyx_t_44); if (unlikely((__pyx_t_48 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error)
11418  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11419  __pyx_t_33 = __pyx_t_48;
11420  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_counts_in.shape[0];
11421  __pyx_t_49 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank); if (unlikely((__pyx_t_49 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error)
11422  __pyx_t_36 = __pyx_t_49;
11423  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_displacements_in.shape[0];
11424  *((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_displacements_in.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_displacements_in.strides[0]) )) = ((*((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_displacements_in.data + __pyx_t_35 * __pyx_cur_scope->__pyx_v_displacements_in.strides[0]) ))) + (*((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_counts_in.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_counts_in.strides[0]) ))));
11425 
11426  /* "mprans/cMoveMeshMonitor.pyx":585
11427  * array_size += counts_total[rank, rank_recv]
11428  * counts_in[rank] = counts_total[rank, rank_recv]
11429  * if rank > 0: # <<<<<<<<<<<<<<
11430  * displacements_in[rank] = displacements_in[rank-1]+counts_in[rank-1]
11431  * # check if another parallel comm is needed
11432  */
11433  }
11434 
11435  /* "mprans/cMoveMeshMonitor.pyx":582
11436  * for rank_recv in range(comm_size):
11437  * array_size = 0
11438  * for rank in range(comm_size): # <<<<<<<<<<<<<<
11439  * array_size += counts_total[rank, rank_recv]
11440  * counts_in[rank] = counts_total[rank, rank_recv]
11441  */
11442  }
11443  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11444 
11445  /* "mprans/cMoveMeshMonitor.pyx":588
11446  * displacements_in[rank] = displacements_in[rank-1]+counts_in[rank-1]
11447  * # check if another parallel comm is needed
11448  * if array_size-counts_total[rank_recv, rank_recv] > 0: # <<<<<<<<<<<<<<
11449  * if my_rank == rank_recv:
11450  * # initialise coords_2doArray only on receiving processor
11451  */
11452  __pyx_t_33 = __pyx_v_rank_recv;
11453  __pyx_t_35 = __pyx_v_rank_recv;
11454  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_counts_total.shape[0];
11455  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_counts_total.shape[1];
11456  __pyx_t_8 = __Pyx_PyInt_From_int((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_counts_total.data + __pyx_t_33 * __pyx_v_counts_total.strides[0]) ) + __pyx_t_35 * __pyx_v_counts_total.strides[1]) )))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 588, __pyx_L1_error)
11457  __Pyx_GOTREF(__pyx_t_8);
11458  __pyx_t_44 = PyNumber_Subtract(__pyx_v_array_size, __pyx_t_8); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 588, __pyx_L1_error)
11459  __Pyx_GOTREF(__pyx_t_44);
11460  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11461  __pyx_t_8 = PyObject_RichCompare(__pyx_t_44, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 588, __pyx_L1_error)
11462  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11463  __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 588, __pyx_L1_error)
11464  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11465  if (__pyx_t_19) {
11466 
11467  /* "mprans/cMoveMeshMonitor.pyx":589
11468  * # check if another parallel comm is needed
11469  * if array_size-counts_total[rank_recv, rank_recv] > 0:
11470  * if my_rank == rank_recv: # <<<<<<<<<<<<<<
11471  * # initialise coords_2doArray only on receiving processor
11472  * coords_2doArray = np.zeros((array_size, 15))
11473  */
11474  __pyx_t_19 = ((__pyx_v_my_rank == __pyx_v_rank_recv) != 0);
11475  if (__pyx_t_19) {
11476 
11477  /* "mprans/cMoveMeshMonitor.pyx":591
11478  * if my_rank == rank_recv:
11479  * # initialise coords_2doArray only on receiving processor
11480  * coords_2doArray = np.zeros((array_size, 15)) # <<<<<<<<<<<<<<
11481  * # -----
11482  * # get the coords_2doArray (nodes where to retrieve values for arg)
11483  */
11484  __Pyx_GetModuleGlobalName(__pyx_t_44, __pyx_n_s_np); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 591, __pyx_L1_error)
11485  __Pyx_GOTREF(__pyx_t_44);
11486  __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_t_44, __pyx_n_s_zeros); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 591, __pyx_L1_error)
11487  __Pyx_GOTREF(__pyx_t_46);
11488  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11489  __pyx_t_44 = PyTuple_New(2); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 591, __pyx_L1_error)
11490  __Pyx_GOTREF(__pyx_t_44);
11491  __Pyx_INCREF(__pyx_v_array_size);
11492  __Pyx_GIVEREF(__pyx_v_array_size);
11493  PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_v_array_size);
11494  __Pyx_INCREF(__pyx_int_15);
11495  __Pyx_GIVEREF(__pyx_int_15);
11496  PyTuple_SET_ITEM(__pyx_t_44, 1, __pyx_int_15);
11497  __pyx_t_43 = NULL;
11498  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_46))) {
11499  __pyx_t_43 = PyMethod_GET_SELF(__pyx_t_46);
11500  if (likely(__pyx_t_43)) {
11501  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_46);
11502  __Pyx_INCREF(__pyx_t_43);
11503  __Pyx_INCREF(function);
11504  __Pyx_DECREF_SET(__pyx_t_46, function);
11505  }
11506  }
11507  __pyx_t_8 = (__pyx_t_43) ? __Pyx_PyObject_Call2Args(__pyx_t_46, __pyx_t_43, __pyx_t_44) : __Pyx_PyObject_CallOneArg(__pyx_t_46, __pyx_t_44);
11508  __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
11509  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11510  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 591, __pyx_L1_error)
11511  __Pyx_GOTREF(__pyx_t_8);
11512  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11513  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 591, __pyx_L1_error)
11514  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11515  __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_coords_2doArray, 1);
11516  __pyx_cur_scope->__pyx_v_coords_2doArray = __pyx_t_13;
11517  __pyx_t_13.memview = NULL;
11518  __pyx_t_13.data = NULL;
11519 
11520  /* "mprans/cMoveMeshMonitor.pyx":589
11521  * # check if another parallel comm is needed
11522  * if array_size-counts_total[rank_recv, rank_recv] > 0:
11523  * if my_rank == rank_recv: # <<<<<<<<<<<<<<
11524  * # initialise coords_2doArray only on receiving processor
11525  * coords_2doArray = np.zeros((array_size, 15))
11526  */
11527  }
11528 
11529  /* "mprans/cMoveMeshMonitor.pyx":594
11530  * # -----
11531  * # get the coords_2doArray (nodes where to retrieve values for arg)
11532  * datatype = MPI.DOUBLE.Create_contiguous(15).Commit() # <<<<<<<<<<<<<<
11533  * comm.Gatherv(coords_2rank[rank_recv],
11534  * [coords_2doArray,
11535  */
11536  __Pyx_GetModuleGlobalName(__pyx_t_44, __pyx_n_s_MPI); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 594, __pyx_L1_error)
11537  __Pyx_GOTREF(__pyx_t_44);
11538  __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_44, __pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 594, __pyx_L1_error)
11539  __Pyx_GOTREF(__pyx_t_43);
11540  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11541  __pyx_t_44 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_Create_contiguous); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 594, __pyx_L1_error)
11542  __Pyx_GOTREF(__pyx_t_44);
11543  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11544  __pyx_t_43 = NULL;
11545  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_44))) {
11546  __pyx_t_43 = PyMethod_GET_SELF(__pyx_t_44);
11547  if (likely(__pyx_t_43)) {
11548  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_44);
11549  __Pyx_INCREF(__pyx_t_43);
11550  __Pyx_INCREF(function);
11551  __Pyx_DECREF_SET(__pyx_t_44, function);
11552  }
11553  }
11554  __pyx_t_46 = (__pyx_t_43) ? __Pyx_PyObject_Call2Args(__pyx_t_44, __pyx_t_43, __pyx_int_15) : __Pyx_PyObject_CallOneArg(__pyx_t_44, __pyx_int_15);
11555  __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
11556  if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 594, __pyx_L1_error)
11557  __Pyx_GOTREF(__pyx_t_46);
11558  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11559  __pyx_t_44 = __Pyx_PyObject_GetAttrStr(__pyx_t_46, __pyx_n_s_Commit); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 594, __pyx_L1_error)
11560  __Pyx_GOTREF(__pyx_t_44);
11561  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11562  __pyx_t_46 = NULL;
11563  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_44))) {
11564  __pyx_t_46 = PyMethod_GET_SELF(__pyx_t_44);
11565  if (likely(__pyx_t_46)) {
11566  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_44);
11567  __Pyx_INCREF(__pyx_t_46);
11568  __Pyx_INCREF(function);
11569  __Pyx_DECREF_SET(__pyx_t_44, function);
11570  }
11571  }
11572  __pyx_t_8 = (__pyx_t_46) ? __Pyx_PyObject_CallOneArg(__pyx_t_44, __pyx_t_46) : __Pyx_PyObject_CallNoArg(__pyx_t_44);
11573  __Pyx_XDECREF(__pyx_t_46); __pyx_t_46 = 0;
11574  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 594, __pyx_L1_error)
11575  __Pyx_GOTREF(__pyx_t_8);
11576  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11577  __Pyx_XDECREF_SET(__pyx_v_datatype, __pyx_t_8);
11578  __pyx_t_8 = 0;
11579 
11580  /* "mprans/cMoveMeshMonitor.pyx":595
11581  * # get the coords_2doArray (nodes where to retrieve values for arg)
11582  * datatype = MPI.DOUBLE.Create_contiguous(15).Commit()
11583  * comm.Gatherv(coords_2rank[rank_recv], # <<<<<<<<<<<<<<
11584  * [coords_2doArray,
11585  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
11586  */
11587  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_Gatherv); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 595, __pyx_L1_error)
11588  __Pyx_GOTREF(__pyx_t_8);
11589  __pyx_t_44 = __Pyx_PyInt_From_int(__pyx_v_rank_recv); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 595, __pyx_L1_error)
11590  __Pyx_GOTREF(__pyx_t_44);
11591  __pyx_t_46 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_44); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 595, __pyx_L1_error)
11592  __Pyx_GOTREF(__pyx_t_46);
11593  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
11594 
11595  /* "mprans/cMoveMeshMonitor.pyx":596
11596  * datatype = MPI.DOUBLE.Create_contiguous(15).Commit()
11597  * comm.Gatherv(coords_2rank[rank_recv],
11598  * [coords_2doArray, # <<<<<<<<<<<<<<
11599  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
11600  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
11601  */
11602  __pyx_t_44 = __pyx_memoryview_fromslice(__pyx_cur_scope->__pyx_v_coords_2doArray, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 596, __pyx_L1_error)
11603  __Pyx_GOTREF(__pyx_t_44);
11604 
11605  /* "mprans/cMoveMeshMonitor.pyx":597
11606  * comm.Gatherv(coords_2rank[rank_recv],
11607  * [coords_2doArray,
11608  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)), # <<<<<<<<<<<<<<
11609  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
11610  * MPI.DOUBLE],
11611  */
11612  __pyx_t_43 = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 597, __pyx_L1_error)
11613  __Pyx_GOTREF(__pyx_t_43);
11614  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_43); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 597, __pyx_L1_error)
11615  __Pyx_GOTREF(__pyx_t_4);
11616  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11617 
11618  /* "mprans/cMoveMeshMonitor.pyx":598
11619  * [coords_2doArray,
11620  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
11621  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)), # <<<<<<<<<<<<<<
11622  * MPI.DOUBLE],
11623  * root=rank_recv)
11624  */
11625  __pyx_t_43 = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 598, __pyx_L1_error)
11626  __Pyx_GOTREF(__pyx_t_43);
11627  __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_43); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error)
11628  __Pyx_GOTREF(__pyx_t_7);
11629  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11630 
11631  /* "mprans/cMoveMeshMonitor.pyx":599
11632  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
11633  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
11634  * MPI.DOUBLE], # <<<<<<<<<<<<<<
11635  * root=rank_recv)
11636  * ncomm += 1
11637  */
11638  __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_MPI); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 599, __pyx_L1_error)
11639  __Pyx_GOTREF(__pyx_t_43);
11640  __pyx_t_47 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 599, __pyx_L1_error)
11641  __Pyx_GOTREF(__pyx_t_47);
11642  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11643 
11644  /* "mprans/cMoveMeshMonitor.pyx":596
11645  * datatype = MPI.DOUBLE.Create_contiguous(15).Commit()
11646  * comm.Gatherv(coords_2rank[rank_recv],
11647  * [coords_2doArray, # <<<<<<<<<<<<<<
11648  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
11649  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
11650  */
11651  __pyx_t_43 = PyList_New(4); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 596, __pyx_L1_error)
11652  __Pyx_GOTREF(__pyx_t_43);
11653  __Pyx_GIVEREF(__pyx_t_44);
11654  PyList_SET_ITEM(__pyx_t_43, 0, __pyx_t_44);
11655  __Pyx_GIVEREF(__pyx_t_4);
11656  PyList_SET_ITEM(__pyx_t_43, 1, __pyx_t_4);
11657  __Pyx_GIVEREF(__pyx_t_7);
11658  PyList_SET_ITEM(__pyx_t_43, 2, __pyx_t_7);
11659  __Pyx_GIVEREF(__pyx_t_47);
11660  PyList_SET_ITEM(__pyx_t_43, 3, __pyx_t_47);
11661  __pyx_t_44 = 0;
11662  __pyx_t_4 = 0;
11663  __pyx_t_7 = 0;
11664  __pyx_t_47 = 0;
11665 
11666  /* "mprans/cMoveMeshMonitor.pyx":595
11667  * # get the coords_2doArray (nodes where to retrieve values for arg)
11668  * datatype = MPI.DOUBLE.Create_contiguous(15).Commit()
11669  * comm.Gatherv(coords_2rank[rank_recv], # <<<<<<<<<<<<<<
11670  * [coords_2doArray,
11671  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
11672  */
11673  __pyx_t_47 = PyTuple_New(2); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 595, __pyx_L1_error)
11674  __Pyx_GOTREF(__pyx_t_47);
11675  __Pyx_GIVEREF(__pyx_t_46);
11676  PyTuple_SET_ITEM(__pyx_t_47, 0, __pyx_t_46);
11677  __Pyx_GIVEREF(__pyx_t_43);
11678  PyTuple_SET_ITEM(__pyx_t_47, 1, __pyx_t_43);
11679  __pyx_t_46 = 0;
11680  __pyx_t_43 = 0;
11681 
11682  /* "mprans/cMoveMeshMonitor.pyx":600
11683  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
11684  * MPI.DOUBLE],
11685  * root=rank_recv) # <<<<<<<<<<<<<<
11686  * ncomm += 1
11687  * comm.barrier()
11688  */
11689  __pyx_t_43 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 600, __pyx_L1_error)
11690  __Pyx_GOTREF(__pyx_t_43);
11691  __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_rank_recv); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 600, __pyx_L1_error)
11692  __Pyx_GOTREF(__pyx_t_46);
11693  if (PyDict_SetItem(__pyx_t_43, __pyx_n_s_root, __pyx_t_46) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
11694  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11695 
11696  /* "mprans/cMoveMeshMonitor.pyx":595
11697  * # get the coords_2doArray (nodes where to retrieve values for arg)
11698  * datatype = MPI.DOUBLE.Create_contiguous(15).Commit()
11699  * comm.Gatherv(coords_2rank[rank_recv], # <<<<<<<<<<<<<<
11700  * [coords_2doArray,
11701  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
11702  */
11703  __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_47, __pyx_t_43); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 595, __pyx_L1_error)
11704  __Pyx_GOTREF(__pyx_t_46);
11705  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11706  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
11707  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11708  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11709 
11710  /* "mprans/cMoveMeshMonitor.pyx":601
11711  * MPI.DOUBLE],
11712  * root=rank_recv)
11713  * ncomm += 1 # <<<<<<<<<<<<<<
11714  * comm.barrier()
11715  * else:
11716  */
11717  __pyx_v_ncomm = (__pyx_v_ncomm + 1);
11718 
11719  /* "mprans/cMoveMeshMonitor.pyx":602
11720  * root=rank_recv)
11721  * ncomm += 1
11722  * comm.barrier() # <<<<<<<<<<<<<<
11723  * else:
11724  * comm.barrier()
11725  */
11726  __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 602, __pyx_L1_error)
11727  __Pyx_GOTREF(__pyx_t_43);
11728  __pyx_t_47 = NULL;
11729  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_43))) {
11730  __pyx_t_47 = PyMethod_GET_SELF(__pyx_t_43);
11731  if (likely(__pyx_t_47)) {
11732  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_43);
11733  __Pyx_INCREF(__pyx_t_47);
11734  __Pyx_INCREF(function);
11735  __Pyx_DECREF_SET(__pyx_t_43, function);
11736  }
11737  }
11738  __pyx_t_46 = (__pyx_t_47) ? __Pyx_PyObject_CallOneArg(__pyx_t_43, __pyx_t_47) : __Pyx_PyObject_CallNoArg(__pyx_t_43);
11739  __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
11740  if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 602, __pyx_L1_error)
11741  __Pyx_GOTREF(__pyx_t_46);
11742  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11743  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11744 
11745  /* "mprans/cMoveMeshMonitor.pyx":588
11746  * displacements_in[rank] = displacements_in[rank-1]+counts_in[rank-1]
11747  * # check if another parallel comm is needed
11748  * if array_size-counts_total[rank_recv, rank_recv] > 0: # <<<<<<<<<<<<<<
11749  * if my_rank == rank_recv:
11750  * # initialise coords_2doArray only on receiving processor
11751  */
11752  goto __pyx_L71;
11753  }
11754 
11755  /* "mprans/cMoveMeshMonitor.pyx":604
11756  * comm.barrier()
11757  * else:
11758  * comm.barrier() # <<<<<<<<<<<<<<
11759  * if rank_recv == my_rank:
11760  * coords_2doArray = coords_2rank[my_rank]
11761  */
11762  /*else*/ {
11763  __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 604, __pyx_L1_error)
11764  __Pyx_GOTREF(__pyx_t_43);
11765  __pyx_t_47 = NULL;
11766  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_43))) {
11767  __pyx_t_47 = PyMethod_GET_SELF(__pyx_t_43);
11768  if (likely(__pyx_t_47)) {
11769  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_43);
11770  __Pyx_INCREF(__pyx_t_47);
11771  __Pyx_INCREF(function);
11772  __Pyx_DECREF_SET(__pyx_t_43, function);
11773  }
11774  }
11775  __pyx_t_46 = (__pyx_t_47) ? __Pyx_PyObject_CallOneArg(__pyx_t_43, __pyx_t_47) : __Pyx_PyObject_CallNoArg(__pyx_t_43);
11776  __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
11777  if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 604, __pyx_L1_error)
11778  __Pyx_GOTREF(__pyx_t_46);
11779  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11780  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11781 
11782  /* "mprans/cMoveMeshMonitor.pyx":605
11783  * else:
11784  * comm.barrier()
11785  * if rank_recv == my_rank: # <<<<<<<<<<<<<<
11786  * coords_2doArray = coords_2rank[my_rank]
11787  * comm.barrier()
11788  */
11789  __pyx_t_19 = ((__pyx_v_rank_recv == __pyx_v_my_rank) != 0);
11790  if (__pyx_t_19) {
11791 
11792  /* "mprans/cMoveMeshMonitor.pyx":606
11793  * comm.barrier()
11794  * if rank_recv == my_rank:
11795  * coords_2doArray = coords_2rank[my_rank] # <<<<<<<<<<<<<<
11796  * comm.barrier()
11797  * if my_rank == rank_recv:
11798  */
11799  __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_my_rank); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 606, __pyx_L1_error)
11800  __Pyx_GOTREF(__pyx_t_46);
11801  __pyx_t_43 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_46); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 606, __pyx_L1_error)
11802  __Pyx_GOTREF(__pyx_t_43);
11803  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11804  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_43, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 606, __pyx_L1_error)
11805  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11806  __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_coords_2doArray, 1);
11807  __pyx_cur_scope->__pyx_v_coords_2doArray = __pyx_t_13;
11808  __pyx_t_13.memview = NULL;
11809  __pyx_t_13.data = NULL;
11810 
11811  /* "mprans/cMoveMeshMonitor.pyx":605
11812  * else:
11813  * comm.barrier()
11814  * if rank_recv == my_rank: # <<<<<<<<<<<<<<
11815  * coords_2doArray = coords_2rank[my_rank]
11816  * comm.barrier()
11817  */
11818  }
11819 
11820  /* "mprans/cMoveMeshMonitor.pyx":607
11821  * if rank_recv == my_rank:
11822  * coords_2doArray = coords_2rank[my_rank]
11823  * comm.barrier() # <<<<<<<<<<<<<<
11824  * if my_rank == rank_recv:
11825  * solFound_2doArray = np.zeros(array_size, dtype=np.int32)
11826  */
11827  __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 607, __pyx_L1_error)
11828  __Pyx_GOTREF(__pyx_t_46);
11829  __pyx_t_47 = NULL;
11830  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_46))) {
11831  __pyx_t_47 = PyMethod_GET_SELF(__pyx_t_46);
11832  if (likely(__pyx_t_47)) {
11833  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_46);
11834  __Pyx_INCREF(__pyx_t_47);
11835  __Pyx_INCREF(function);
11836  __Pyx_DECREF_SET(__pyx_t_46, function);
11837  }
11838  }
11839  __pyx_t_43 = (__pyx_t_47) ? __Pyx_PyObject_CallOneArg(__pyx_t_46, __pyx_t_47) : __Pyx_PyObject_CallNoArg(__pyx_t_46);
11840  __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
11841  if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 607, __pyx_L1_error)
11842  __Pyx_GOTREF(__pyx_t_43);
11843  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11844  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11845  }
11846  __pyx_L71:;
11847 
11848  /* "mprans/cMoveMeshMonitor.pyx":608
11849  * coords_2doArray = coords_2rank[my_rank]
11850  * comm.barrier()
11851  * if my_rank == rank_recv: # <<<<<<<<<<<<<<
11852  * solFound_2doArray = np.zeros(array_size, dtype=np.int32)
11853  * if parallel_steps > 0:
11854  */
11855  __pyx_t_19 = ((__pyx_v_my_rank == __pyx_v_rank_recv) != 0);
11856  if (__pyx_t_19) {
11857 
11858  /* "mprans/cMoveMeshMonitor.pyx":609
11859  * comm.barrier()
11860  * if my_rank == rank_recv:
11861  * solFound_2doArray = np.zeros(array_size, dtype=np.int32) # <<<<<<<<<<<<<<
11862  * if parallel_steps > 0:
11863  * # if coming from this rank, solution was already found
11864  */
11865  __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_np); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 609, __pyx_L1_error)
11866  __Pyx_GOTREF(__pyx_t_43);
11867  __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_zeros); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 609, __pyx_L1_error)
11868  __Pyx_GOTREF(__pyx_t_46);
11869  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11870  __pyx_t_43 = PyTuple_New(1); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 609, __pyx_L1_error)
11871  __Pyx_GOTREF(__pyx_t_43);
11872  __Pyx_INCREF(__pyx_v_array_size);
11873  __Pyx_GIVEREF(__pyx_v_array_size);
11874  PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_v_array_size);
11875  __pyx_t_47 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 609, __pyx_L1_error)
11876  __Pyx_GOTREF(__pyx_t_47);
11877  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __pyx_L1_error)
11878  __Pyx_GOTREF(__pyx_t_8);
11879  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error)
11880  __Pyx_GOTREF(__pyx_t_7);
11881  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11882  if (PyDict_SetItem(__pyx_t_47, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
11883  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11884  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_46, __pyx_t_43, __pyx_t_47); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error)
11885  __Pyx_GOTREF(__pyx_t_7);
11886  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
11887  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
11888  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
11889  __Pyx_XDECREF_SET(__pyx_v_solFound_2doArray, __pyx_t_7);
11890  __pyx_t_7 = 0;
11891 
11892  /* "mprans/cMoveMeshMonitor.pyx":610
11893  * if my_rank == rank_recv:
11894  * solFound_2doArray = np.zeros(array_size, dtype=np.int32)
11895  * if parallel_steps > 0: # <<<<<<<<<<<<<<
11896  * # if coming from this rank, solution was already found
11897  * solFound_2doArray[displacements_in[my_rank]:displacements_in[my_rank]+counts_in[my_rank]] = 1
11898  */
11899  __pyx_t_19 = ((__pyx_v_parallel_steps > 0) != 0);
11900  if (__pyx_t_19) {
11901 
11902  /* "mprans/cMoveMeshMonitor.pyx":612
11903  * if parallel_steps > 0:
11904  * # if coming from this rank, solution was already found
11905  * solFound_2doArray[displacements_in[my_rank]:displacements_in[my_rank]+counts_in[my_rank]] = 1 # <<<<<<<<<<<<<<
11906  * # COMMUNICATION FINISHED
11907  * # wipe dicts out
11908  */
11909  __pyx_t_35 = __pyx_v_my_rank;
11910  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_cur_scope->__pyx_v_displacements_in.shape[0];
11911  __pyx_t_33 = __pyx_v_my_rank;
11912  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_displacements_in.shape[0];
11913  __pyx_t_36 = __pyx_v_my_rank;
11914  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_counts_in.shape[0];
11915  if (__Pyx_PyObject_SetSlice(__pyx_v_solFound_2doArray, __pyx_int_1, (*((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_displacements_in.data + __pyx_t_35 * __pyx_cur_scope->__pyx_v_displacements_in.strides[0]) ))), ((*((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_displacements_in.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_displacements_in.strides[0]) ))) + (*((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_counts_in.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_counts_in.strides[0]) )))), NULL, NULL, NULL, 1, 1, 1) < 0) __PYX_ERR(0, 612, __pyx_L1_error)
11916 
11917  /* "mprans/cMoveMeshMonitor.pyx":610
11918  * if my_rank == rank_recv:
11919  * solFound_2doArray = np.zeros(array_size, dtype=np.int32)
11920  * if parallel_steps > 0: # <<<<<<<<<<<<<<
11921  * # if coming from this rank, solution was already found
11922  * solFound_2doArray[displacements_in[my_rank]:displacements_in[my_rank]+counts_in[my_rank]] = 1
11923  */
11924  }
11925 
11926  /* "mprans/cMoveMeshMonitor.pyx":608
11927  * coords_2doArray = coords_2rank[my_rank]
11928  * comm.barrier()
11929  * if my_rank == rank_recv: # <<<<<<<<<<<<<<
11930  * solFound_2doArray = np.zeros(array_size, dtype=np.int32)
11931  * if parallel_steps > 0:
11932  */
11933  }
11934  }
11935 
11936  /* "mprans/cMoveMeshMonitor.pyx":615
11937  * # COMMUNICATION FINISHED
11938  * # wipe dicts out
11939  * for rank in range(comm_size): # <<<<<<<<<<<<<<
11940  * coords_2rank[rank] = np.zeros((0, 15))
11941  * nNodes = len(coords_2doArray)
11942  */
11943  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
11944  __Pyx_GOTREF(__pyx_t_7);
11945  __pyx_t_47 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_7); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 615, __pyx_L1_error)
11946  __Pyx_GOTREF(__pyx_t_47);
11947  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11948  if (likely(PyList_CheckExact(__pyx_t_47)) || PyTuple_CheckExact(__pyx_t_47)) {
11949  __pyx_t_7 = __pyx_t_47; __Pyx_INCREF(__pyx_t_7); __pyx_t_15 = 0;
11950  __pyx_t_16 = NULL;
11951  } else {
11952  __pyx_t_15 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_47); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
11953  __Pyx_GOTREF(__pyx_t_7);
11954  __pyx_t_16 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 615, __pyx_L1_error)
11955  }
11956  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
11957  for (;;) {
11958  if (likely(!__pyx_t_16)) {
11959  if (likely(PyList_CheckExact(__pyx_t_7))) {
11960  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_7)) break;
11961  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11962  __pyx_t_47 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_47); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 615, __pyx_L1_error)
11963  #else
11964  __pyx_t_47 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 615, __pyx_L1_error)
11965  __Pyx_GOTREF(__pyx_t_47);
11966  #endif
11967  } else {
11968  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
11969  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11970  __pyx_t_47 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_47); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 615, __pyx_L1_error)
11971  #else
11972  __pyx_t_47 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 615, __pyx_L1_error)
11973  __Pyx_GOTREF(__pyx_t_47);
11974  #endif
11975  }
11976  } else {
11977  __pyx_t_47 = __pyx_t_16(__pyx_t_7);
11978  if (unlikely(!__pyx_t_47)) {
11979  PyObject* exc_type = PyErr_Occurred();
11980  if (exc_type) {
11981  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11982  else __PYX_ERR(0, 615, __pyx_L1_error)
11983  }
11984  break;
11985  }
11986  __Pyx_GOTREF(__pyx_t_47);
11987  }
11988  __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_47);
11989  __pyx_t_47 = 0;
11990 
11991  /* "mprans/cMoveMeshMonitor.pyx":616
11992  * # wipe dicts out
11993  * for rank in range(comm_size):
11994  * coords_2rank[rank] = np.zeros((0, 15)) # <<<<<<<<<<<<<<
11995  * nNodes = len(coords_2doArray)
11996  * for iN in range(nNodes):
11997  */
11998  __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_np); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 616, __pyx_L1_error)
11999  __Pyx_GOTREF(__pyx_t_43);
12000  __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_zeros); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 616, __pyx_L1_error)
12001  __Pyx_GOTREF(__pyx_t_46);
12002  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
12003  __pyx_t_43 = NULL;
12004  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_46))) {
12005  __pyx_t_43 = PyMethod_GET_SELF(__pyx_t_46);
12006  if (likely(__pyx_t_43)) {
12007  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_46);
12008  __Pyx_INCREF(__pyx_t_43);
12009  __Pyx_INCREF(function);
12010  __Pyx_DECREF_SET(__pyx_t_46, function);
12011  }
12012  }
12013  __pyx_t_47 = (__pyx_t_43) ? __Pyx_PyObject_Call2Args(__pyx_t_46, __pyx_t_43, __pyx_tuple__5) : __Pyx_PyObject_CallOneArg(__pyx_t_46, __pyx_tuple__5);
12014  __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
12015  if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 616, __pyx_L1_error)
12016  __Pyx_GOTREF(__pyx_t_47);
12017  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
12018  if (unlikely(PyDict_SetItem(__pyx_v_coords_2rank, __pyx_v_rank, __pyx_t_47) < 0)) __PYX_ERR(0, 616, __pyx_L1_error)
12019  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
12020 
12021  /* "mprans/cMoveMeshMonitor.pyx":615
12022  * # COMMUNICATION FINISHED
12023  * # wipe dicts out
12024  * for rank in range(comm_size): # <<<<<<<<<<<<<<
12025  * coords_2rank[rank] = np.zeros((0, 15))
12026  * nNodes = len(coords_2doArray)
12027  */
12028  }
12029  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12030 
12031  /* "mprans/cMoveMeshMonitor.pyx":617
12032  * for rank in range(comm_size):
12033  * coords_2rank[rank] = np.zeros((0, 15))
12034  * nNodes = len(coords_2doArray) # <<<<<<<<<<<<<<
12035  * for iN in range(nNodes):
12036  * coords[0] = coords_2doArray[iN, 0]
12037  */
12038  __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_cur_scope->__pyx_v_coords_2doArray);
12039  __pyx_v_nNodes = __pyx_t_10;
12040 
12041  /* "mprans/cMoveMeshMonitor.pyx":618
12042  * coords_2rank[rank] = np.zeros((0, 15))
12043  * nNodes = len(coords_2doArray)
12044  * for iN in range(nNodes): # <<<<<<<<<<<<<<
12045  * coords[0] = coords_2doArray[iN, 0]
12046  * coords[1] = coords_2doArray[iN, 1]
12047  */
12048  __pyx_t_22 = __pyx_v_nNodes;
12049  __pyx_t_23 = __pyx_t_22;
12050  for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
12051  __pyx_v_iN = __pyx_t_24;
12052 
12053  /* "mprans/cMoveMeshMonitor.pyx":619
12054  * nNodes = len(coords_2doArray)
12055  * for iN in range(nNodes):
12056  * coords[0] = coords_2doArray[iN, 0] # <<<<<<<<<<<<<<
12057  * coords[1] = coords_2doArray[iN, 1]
12058  * coords[2] = coords_2doArray[iN, 2]
12059  */
12060  __pyx_t_36 = __pyx_v_iN;
12061  __pyx_t_33 = 0;
12062  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12063  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12064  __pyx_t_35 = 0;
12065  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
12066  *((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12067 
12068  /* "mprans/cMoveMeshMonitor.pyx":620
12069  * for iN in range(nNodes):
12070  * coords[0] = coords_2doArray[iN, 0]
12071  * coords[1] = coords_2doArray[iN, 1] # <<<<<<<<<<<<<<
12072  * coords[2] = coords_2doArray[iN, 2]
12073  * nearestN = int(coords_2doArray[iN, 3])
12074  */
12075  __pyx_t_33 = __pyx_v_iN;
12076  __pyx_t_36 = 1;
12077  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12078  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12079  __pyx_t_35 = 1;
12080  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
12081  *((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12082 
12083  /* "mprans/cMoveMeshMonitor.pyx":621
12084  * coords[0] = coords_2doArray[iN, 0]
12085  * coords[1] = coords_2doArray[iN, 1]
12086  * coords[2] = coords_2doArray[iN, 2] # <<<<<<<<<<<<<<
12087  * nearestN = int(coords_2doArray[iN, 3])
12088  * typeN = int(coords_2doArray[iN, 4])
12089  */
12090  __pyx_t_36 = __pyx_v_iN;
12091  __pyx_t_33 = 2;
12092  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12093  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12094  __pyx_t_35 = 2;
12095  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_coords.shape[0];
12096  *((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_35 * __pyx_v_coords.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12097 
12098  /* "mprans/cMoveMeshMonitor.pyx":622
12099  * coords[1] = coords_2doArray[iN, 1]
12100  * coords[2] = coords_2doArray[iN, 2]
12101  * nearestN = int(coords_2doArray[iN, 3]) # <<<<<<<<<<<<<<
12102  * typeN = int(coords_2doArray[iN, 4])
12103  * v_grad[0] = coords_2doArray[iN, 5]
12104  */
12105  __pyx_t_33 = __pyx_v_iN;
12106  __pyx_t_36 = 3;
12107  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12108  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12109  __pyx_v_nearestN = ((int)(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) ))));
12110 
12111  /* "mprans/cMoveMeshMonitor.pyx":623
12112  * coords[2] = coords_2doArray[iN, 2]
12113  * nearestN = int(coords_2doArray[iN, 3])
12114  * typeN = int(coords_2doArray[iN, 4]) # <<<<<<<<<<<<<<
12115  * v_grad[0] = coords_2doArray[iN, 5]
12116  * v_grad[1] = coords_2doArray[iN, 6]
12117  */
12118  __pyx_t_36 = __pyx_v_iN;
12119  __pyx_t_33 = 4;
12120  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12121  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12122  __pyx_v_typeN = ((int)(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) ))));
12123 
12124  /* "mprans/cMoveMeshMonitor.pyx":624
12125  * nearestN = int(coords_2doArray[iN, 3])
12126  * typeN = int(coords_2doArray[iN, 4])
12127  * v_grad[0] = coords_2doArray[iN, 5] # <<<<<<<<<<<<<<
12128  * v_grad[1] = coords_2doArray[iN, 6]
12129  * v_grad[2] = coords_2doArray[iN, 7]
12130  */
12131  __pyx_t_33 = __pyx_v_iN;
12132  __pyx_t_36 = 5;
12133  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12134  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12135  __pyx_t_35 = 0;
12136  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_v_grad.shape[0];
12137  *((double *) ( /* dim=0 */ (__pyx_v_v_grad.data + __pyx_t_35 * __pyx_v_v_grad.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12138 
12139  /* "mprans/cMoveMeshMonitor.pyx":625
12140  * typeN = int(coords_2doArray[iN, 4])
12141  * v_grad[0] = coords_2doArray[iN, 5]
12142  * v_grad[1] = coords_2doArray[iN, 6] # <<<<<<<<<<<<<<
12143  * v_grad[2] = coords_2doArray[iN, 7]
12144  * area = coords_2doArray[iN, 8]
12145  */
12146  __pyx_t_36 = __pyx_v_iN;
12147  __pyx_t_33 = 6;
12148  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12149  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12150  __pyx_t_35 = 1;
12151  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_v_grad.shape[0];
12152  *((double *) ( /* dim=0 */ (__pyx_v_v_grad.data + __pyx_t_35 * __pyx_v_v_grad.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12153 
12154  /* "mprans/cMoveMeshMonitor.pyx":626
12155  * v_grad[0] = coords_2doArray[iN, 5]
12156  * v_grad[1] = coords_2doArray[iN, 6]
12157  * v_grad[2] = coords_2doArray[iN, 7] # <<<<<<<<<<<<<<
12158  * area = coords_2doArray[iN, 8]
12159  * ls_phi = coords_2doArray[iN, 9]
12160  */
12161  __pyx_t_33 = __pyx_v_iN;
12162  __pyx_t_36 = 7;
12163  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12164  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12165  __pyx_t_35 = 2;
12166  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_v_grad.shape[0];
12167  *((double *) ( /* dim=0 */ (__pyx_v_v_grad.data + __pyx_t_35 * __pyx_v_v_grad.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12168 
12169  /* "mprans/cMoveMeshMonitor.pyx":627
12170  * v_grad[1] = coords_2doArray[iN, 6]
12171  * v_grad[2] = coords_2doArray[iN, 7]
12172  * area = coords_2doArray[iN, 8] # <<<<<<<<<<<<<<
12173  * ls_phi = coords_2doArray[iN, 9]
12174  * node0 = int(coords_2doArray[iN, 10])
12175  */
12176  __pyx_t_36 = __pyx_v_iN;
12177  __pyx_t_33 = 8;
12178  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12179  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12180  __pyx_v_area = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12181 
12182  /* "mprans/cMoveMeshMonitor.pyx":628
12183  * v_grad[2] = coords_2doArray[iN, 7]
12184  * area = coords_2doArray[iN, 8]
12185  * ls_phi = coords_2doArray[iN, 9] # <<<<<<<<<<<<<<
12186  * node0 = int(coords_2doArray[iN, 10])
12187  * rank0 = int(coords_2doArray[iN, 11])
12188  */
12189  __pyx_t_33 = __pyx_v_iN;
12190  __pyx_t_36 = 9;
12191  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12192  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12193  __pyx_v_ls_phi = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12194 
12195  /* "mprans/cMoveMeshMonitor.pyx":629
12196  * area = coords_2doArray[iN, 8]
12197  * ls_phi = coords_2doArray[iN, 9]
12198  * node0 = int(coords_2doArray[iN, 10]) # <<<<<<<<<<<<<<
12199  * rank0 = int(coords_2doArray[iN, 11])
12200  * new_rank = my_rank
12201  */
12202  __pyx_t_36 = __pyx_v_iN;
12203  __pyx_t_33 = 10;
12204  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12205  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12206  __pyx_v_node0 = ((int)(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) ))));
12207 
12208  /* "mprans/cMoveMeshMonitor.pyx":630
12209  * ls_phi = coords_2doArray[iN, 9]
12210  * node0 = int(coords_2doArray[iN, 10])
12211  * rank0 = int(coords_2doArray[iN, 11]) # <<<<<<<<<<<<<<
12212  * new_rank = my_rank
12213  * fixed_dir[0] = coords_2doArray[iN, 12]
12214  */
12215  __pyx_t_33 = __pyx_v_iN;
12216  __pyx_t_36 = 11;
12217  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12218  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12219  __pyx_t_7 = __Pyx_PyInt_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L1_error)
12220  __Pyx_GOTREF(__pyx_t_7);
12221  __Pyx_XDECREF_SET(__pyx_v_rank0, __pyx_t_7);
12222  __pyx_t_7 = 0;
12223 
12224  /* "mprans/cMoveMeshMonitor.pyx":631
12225  * node0 = int(coords_2doArray[iN, 10])
12226  * rank0 = int(coords_2doArray[iN, 11])
12227  * new_rank = my_rank # <<<<<<<<<<<<<<
12228  * fixed_dir[0] = coords_2doArray[iN, 12]
12229  * fixed_dir[1] = coords_2doArray[iN, 13]
12230  */
12231  __pyx_v_new_rank = __pyx_v_my_rank;
12232 
12233  /* "mprans/cMoveMeshMonitor.pyx":632
12234  * rank0 = int(coords_2doArray[iN, 11])
12235  * new_rank = my_rank
12236  * fixed_dir[0] = coords_2doArray[iN, 12] # <<<<<<<<<<<<<<
12237  * fixed_dir[1] = coords_2doArray[iN, 13]
12238  * fixed_dir[2] = coords_2doArray[iN, 14]
12239  */
12240  __pyx_t_36 = __pyx_v_iN;
12241  __pyx_t_33 = 12;
12242  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12243  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12244  __pyx_t_35 = 0;
12245  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
12246  *((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12247 
12248  /* "mprans/cMoveMeshMonitor.pyx":633
12249  * new_rank = my_rank
12250  * fixed_dir[0] = coords_2doArray[iN, 12]
12251  * fixed_dir[1] = coords_2doArray[iN, 13] # <<<<<<<<<<<<<<
12252  * fixed_dir[2] = coords_2doArray[iN, 14]
12253  * if solFound_2doArray[iN] == 0:
12254  */
12255  __pyx_t_33 = __pyx_v_iN;
12256  __pyx_t_36 = 13;
12257  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12258  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12259  __pyx_t_35 = 1;
12260  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
12261  *((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12262 
12263  /* "mprans/cMoveMeshMonitor.pyx":634
12264  * fixed_dir[0] = coords_2doArray[iN, 12]
12265  * fixed_dir[1] = coords_2doArray[iN, 13]
12266  * fixed_dir[2] = coords_2doArray[iN, 14] # <<<<<<<<<<<<<<
12267  * if solFound_2doArray[iN] == 0:
12268  * result = findN(coords=coords,
12269  */
12270  __pyx_t_36 = __pyx_v_iN;
12271  __pyx_t_33 = 14;
12272  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
12273  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
12274  __pyx_t_35 = 2;
12275  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_fixed_dir.shape[0];
12276  *((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_35 * __pyx_v_fixed_dir.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_36 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_33 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
12277 
12278  /* "mprans/cMoveMeshMonitor.pyx":635
12279  * fixed_dir[1] = coords_2doArray[iN, 13]
12280  * fixed_dir[2] = coords_2doArray[iN, 14]
12281  * if solFound_2doArray[iN] == 0: # <<<<<<<<<<<<<<
12282  * result = findN(coords=coords,
12283  * nodeArray=nodeArray,
12284  */
12285  if (unlikely(!__pyx_v_solFound_2doArray)) { __Pyx_RaiseUnboundLocalError("solFound_2doArray"); __PYX_ERR(0, 635, __pyx_L1_error) }
12286  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_solFound_2doArray, __pyx_v_iN, int, 1, __Pyx_PyInt_From_int, 0, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 635, __pyx_L1_error)
12287  __Pyx_GOTREF(__pyx_t_7);
12288  __pyx_t_47 = __Pyx_PyInt_EqObjC(__pyx_t_7, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 635, __pyx_L1_error)
12289  __Pyx_GOTREF(__pyx_t_47);
12290  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12291  __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_47); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
12292  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
12293  if (__pyx_t_19) {
12294 
12295  /* "mprans/cMoveMeshMonitor.pyx":636
12296  * fixed_dir[2] = coords_2doArray[iN, 14]
12297  * if solFound_2doArray[iN] == 0:
12298  * result = findN(coords=coords, # <<<<<<<<<<<<<<
12299  * nodeArray=nodeArray,
12300  * nodeStarOffsets=nodeStarOffsets,
12301  */
12302  __pyx_t_11 = __pyx_f_6mprans_16cMoveMeshMonitor_findN(__pyx_v_coords, __pyx_v_nodeArray, __pyx_v_nodeStarOffsets, __pyx_v_nodeStarArray, __pyx_v_nearestN, __pyx_v_typeN, __pyx_v_my_rank, __pyx_v_nNodes_owned, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementBoundaryNormalsArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_exteriorElementBoundariesBoolArray, __pyx_v_nElements_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nElementBoundaries_owned, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_elementNodesArray, __pyx_v_nodeMaterialTypes, __pyx_v_nNel); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 636, __pyx_L1_error)
12303  __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1);
12304  __pyx_v_result = __pyx_t_11;
12305  __pyx_t_11.memview = NULL;
12306  __pyx_t_11.data = NULL;
12307 
12308  /* "mprans/cMoveMeshMonitor.pyx":663
12309  * elementNodesArray=elementNodesArray,
12310  * nNel=nNel)
12311  * nearestN = result[0] # <<<<<<<<<<<<<<
12312  * typeN = result[1]
12313  * new_rank = result[2]
12314  */
12315  __pyx_t_33 = 0;
12316  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_result.shape[0];
12317  __pyx_v_nearestN = (*((int *) ( /* dim=0 */ (__pyx_v_result.data + __pyx_t_33 * __pyx_v_result.strides[0]) )));
12318 
12319  /* "mprans/cMoveMeshMonitor.pyx":664
12320  * nNel=nNel)
12321  * nearestN = result[0]
12322  * typeN = result[1] # <<<<<<<<<<<<<<
12323  * new_rank = result[2]
12324  * if my_rank != new_rank:
12325  */
12326  __pyx_t_33 = 1;
12327  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_result.shape[0];
12328  __pyx_v_typeN = (*((int *) ( /* dim=0 */ (__pyx_v_result.data + __pyx_t_33 * __pyx_v_result.strides[0]) )));
12329 
12330  /* "mprans/cMoveMeshMonitor.pyx":665
12331  * nearestN = result[0]
12332  * typeN = result[1]
12333  * new_rank = result[2] # <<<<<<<<<<<<<<
12334  * if my_rank != new_rank:
12335  * nPending_disp += 1
12336  */
12337  __pyx_t_33 = 2;
12338  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_result.shape[0];
12339  __pyx_v_new_rank = (*((int *) ( /* dim=0 */ (__pyx_v_result.data + __pyx_t_33 * __pyx_v_result.strides[0]) )));
12340 
12341  /* "mprans/cMoveMeshMonitor.pyx":666
12342  * typeN = result[1]
12343  * new_rank = result[2]
12344  * if my_rank != new_rank: # <<<<<<<<<<<<<<
12345  * nPending_disp += 1
12346  * else:
12347  */
12348  __pyx_t_19 = ((__pyx_v_my_rank != __pyx_v_new_rank) != 0);
12349  if (__pyx_t_19) {
12350 
12351  /* "mprans/cMoveMeshMonitor.pyx":667
12352  * new_rank = result[2]
12353  * if my_rank != new_rank:
12354  * nPending_disp += 1 # <<<<<<<<<<<<<<
12355  * else:
12356  * solFound_2doArray[iN] += 1
12357  */
12358  __pyx_v_nPending_disp = (__pyx_v_nPending_disp + 1);
12359 
12360  /* "mprans/cMoveMeshMonitor.pyx":666
12361  * typeN = result[1]
12362  * new_rank = result[2]
12363  * if my_rank != new_rank: # <<<<<<<<<<<<<<
12364  * nPending_disp += 1
12365  * else:
12366  */
12367  goto __pyx_L81;
12368  }
12369 
12370  /* "mprans/cMoveMeshMonitor.pyx":669
12371  * nPending_disp += 1
12372  * else:
12373  * solFound_2doArray[iN] += 1 # <<<<<<<<<<<<<<
12374  * inside_eN = True # checking if actually true
12375  * if typeN == 2:
12376  */
12377  /*else*/ {
12378  __pyx_t_27 = __pyx_v_iN;
12379  if (unlikely(!__pyx_v_solFound_2doArray)) { __Pyx_RaiseUnboundLocalError("solFound_2doArray"); __PYX_ERR(0, 669, __pyx_L1_error) }
12380  __pyx_t_47 = __Pyx_GetItemInt(__pyx_v_solFound_2doArray, __pyx_t_27, int, 1, __Pyx_PyInt_From_int, 0, 1, 0); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 669, __pyx_L1_error)
12381  __Pyx_GOTREF(__pyx_t_47);
12382  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_47, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 669, __pyx_L1_error)
12383  __Pyx_GOTREF(__pyx_t_7);
12384  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
12385  if (unlikely(!__pyx_v_solFound_2doArray)) { __Pyx_RaiseUnboundLocalError("solFound_2doArray"); __PYX_ERR(0, 669, __pyx_L1_error) }
12386  if (unlikely(__Pyx_SetItemInt(__pyx_v_solFound_2doArray, __pyx_t_27, __pyx_t_7, int, 1, __Pyx_PyInt_From_int, 0, 1, 0) < 0)) __PYX_ERR(0, 669, __pyx_L1_error)
12387  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12388 
12389  /* "mprans/cMoveMeshMonitor.pyx":670
12390  * else:
12391  * solFound_2doArray[iN] += 1
12392  * inside_eN = True # checking if actually true # <<<<<<<<<<<<<<
12393  * if typeN == 2:
12394  * # get an element from there
12395  */
12396  __pyx_v_inside_eN = 1;
12397 
12398  /* "mprans/cMoveMeshMonitor.pyx":671
12399  * solFound_2doArray[iN] += 1
12400  * inside_eN = True # checking if actually true
12401  * if typeN == 2: # <<<<<<<<<<<<<<
12402  * # get an element from there
12403  * if elementBoundaryElementsArray[nearestN, 0] == -1:
12404  */
12405  __pyx_t_19 = ((__pyx_v_typeN == 2) != 0);
12406  if (__pyx_t_19) {
12407 
12408  /* "mprans/cMoveMeshMonitor.pyx":673
12409  * if typeN == 2:
12410  * # get an element from there
12411  * if elementBoundaryElementsArray[nearestN, 0] == -1: # <<<<<<<<<<<<<<
12412  * nearestN = elementBoundaryElementsArray[nearestN, 1]
12413  * typeN = 1
12414  */
12415  __pyx_t_33 = __pyx_v_nearestN;
12416  __pyx_t_36 = 0;
12417  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryElementsArray.shape[0];
12418  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryElementsArray.shape[1];
12419  __pyx_t_19 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_33 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) == -1L) != 0);
12420  if (__pyx_t_19) {
12421 
12422  /* "mprans/cMoveMeshMonitor.pyx":674
12423  * # get an element from there
12424  * if elementBoundaryElementsArray[nearestN, 0] == -1:
12425  * nearestN = elementBoundaryElementsArray[nearestN, 1] # <<<<<<<<<<<<<<
12426  * typeN = 1
12427  * elif elementBoundaryElementsArray[nearestN, 1] == -1:
12428  */
12429  __pyx_t_36 = __pyx_v_nearestN;
12430  __pyx_t_33 = 1;
12431  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryElementsArray.shape[0];
12432  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryElementsArray.shape[1];
12433  __pyx_v_nearestN = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_36 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_33 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
12434 
12435  /* "mprans/cMoveMeshMonitor.pyx":675
12436  * if elementBoundaryElementsArray[nearestN, 0] == -1:
12437  * nearestN = elementBoundaryElementsArray[nearestN, 1]
12438  * typeN = 1 # <<<<<<<<<<<<<<
12439  * elif elementBoundaryElementsArray[nearestN, 1] == -1:
12440  * nearestN = elementBoundaryElementsArray[nearestN, 0]
12441  */
12442  __pyx_v_typeN = 1;
12443 
12444  /* "mprans/cMoveMeshMonitor.pyx":673
12445  * if typeN == 2:
12446  * # get an element from there
12447  * if elementBoundaryElementsArray[nearestN, 0] == -1: # <<<<<<<<<<<<<<
12448  * nearestN = elementBoundaryElementsArray[nearestN, 1]
12449  * typeN = 1
12450  */
12451  goto __pyx_L83;
12452  }
12453 
12454  /* "mprans/cMoveMeshMonitor.pyx":676
12455  * nearestN = elementBoundaryElementsArray[nearestN, 1]
12456  * typeN = 1
12457  * elif elementBoundaryElementsArray[nearestN, 1] == -1: # <<<<<<<<<<<<<<
12458  * nearestN = elementBoundaryElementsArray[nearestN, 0]
12459  * typeN = 1
12460  */
12461  __pyx_t_33 = __pyx_v_nearestN;
12462  __pyx_t_36 = 1;
12463  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryElementsArray.shape[0];
12464  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryElementsArray.shape[1];
12465  __pyx_t_19 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_33 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) == -1L) != 0);
12466  if (__pyx_t_19) {
12467 
12468  /* "mprans/cMoveMeshMonitor.pyx":677
12469  * typeN = 1
12470  * elif elementBoundaryElementsArray[nearestN, 1] == -1:
12471  * nearestN = elementBoundaryElementsArray[nearestN, 0] # <<<<<<<<<<<<<<
12472  * typeN = 1
12473  * for ii in range(nEbn):
12474  */
12475  __pyx_t_36 = __pyx_v_nearestN;
12476  __pyx_t_33 = 0;
12477  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryElementsArray.shape[0];
12478  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryElementsArray.shape[1];
12479  __pyx_v_nearestN = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_36 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_33 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
12480 
12481  /* "mprans/cMoveMeshMonitor.pyx":678
12482  * elif elementBoundaryElementsArray[nearestN, 1] == -1:
12483  * nearestN = elementBoundaryElementsArray[nearestN, 0]
12484  * typeN = 1 # <<<<<<<<<<<<<<
12485  * for ii in range(nEbn):
12486  * bb_i = elementBoundariesArray[nearestN, ii]
12487  */
12488  __pyx_v_typeN = 1;
12489 
12490  /* "mprans/cMoveMeshMonitor.pyx":676
12491  * nearestN = elementBoundaryElementsArray[nearestN, 1]
12492  * typeN = 1
12493  * elif elementBoundaryElementsArray[nearestN, 1] == -1: # <<<<<<<<<<<<<<
12494  * nearestN = elementBoundaryElementsArray[nearestN, 0]
12495  * typeN = 1
12496  */
12497  }
12498  __pyx_L83:;
12499 
12500  /* "mprans/cMoveMeshMonitor.pyx":671
12501  * solFound_2doArray[iN] += 1
12502  * inside_eN = True # checking if actually true
12503  * if typeN == 2: # <<<<<<<<<<<<<<
12504  * # get an element from there
12505  * if elementBoundaryElementsArray[nearestN, 0] == -1:
12506  */
12507  }
12508 
12509  /* "mprans/cMoveMeshMonitor.pyx":679
12510  * nearestN = elementBoundaryElementsArray[nearestN, 0]
12511  * typeN = 1
12512  * for ii in range(nEbn): # <<<<<<<<<<<<<<
12513  * bb_i = elementBoundariesArray[nearestN, ii]
12514  * normal[0] = elementBoundaryNormalsArray[nearestN, ii, 0]
12515  */
12516  __pyx_t_27 = __pyx_v_nEbn;
12517  __pyx_t_28 = __pyx_t_27;
12518  for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
12519  __pyx_v_ii = __pyx_t_29;
12520 
12521  /* "mprans/cMoveMeshMonitor.pyx":680
12522  * typeN = 1
12523  * for ii in range(nEbn):
12524  * bb_i = elementBoundariesArray[nearestN, ii] # <<<<<<<<<<<<<<
12525  * normal[0] = elementBoundaryNormalsArray[nearestN, ii, 0]
12526  * normal[1] = elementBoundaryNormalsArray[nearestN, ii, 1]
12527  */
12528  __pyx_t_33 = __pyx_v_nearestN;
12529  __pyx_t_36 = __pyx_v_ii;
12530  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundariesArray.shape[0];
12531  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundariesArray.shape[1];
12532  __pyx_v_bb_i = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundariesArray.data + __pyx_t_33 * __pyx_v_elementBoundariesArray.strides[0]) ) + __pyx_t_36 * __pyx_v_elementBoundariesArray.strides[1]) )));
12533 
12534  /* "mprans/cMoveMeshMonitor.pyx":681
12535  * for ii in range(nEbn):
12536  * bb_i = elementBoundariesArray[nearestN, ii]
12537  * normal[0] = elementBoundaryNormalsArray[nearestN, ii, 0] # <<<<<<<<<<<<<<
12538  * normal[1] = elementBoundaryNormalsArray[nearestN, ii, 1]
12539  * normal[2] = elementBoundaryNormalsArray[nearestN, ii, 2]
12540  */
12541  __pyx_t_36 = __pyx_v_nearestN;
12542  __pyx_t_33 = __pyx_v_ii;
12543  __pyx_t_35 = 0;
12544  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryNormalsArray.shape[0];
12545  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryNormalsArray.shape[1];
12546  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementBoundaryNormalsArray.shape[2];
12547  __pyx_t_34 = 0;
12548  if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_normal.shape[0];
12549  *((double *) ( /* dim=0 */ (__pyx_v_normal.data + __pyx_t_34 * __pyx_v_normal.strides[0]) )) = (*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryNormalsArray.data + __pyx_t_36 * __pyx_v_elementBoundaryNormalsArray.strides[0]) ) + __pyx_t_33 * __pyx_v_elementBoundaryNormalsArray.strides[1]) ) + __pyx_t_35 * __pyx_v_elementBoundaryNormalsArray.strides[2]) )));
12550 
12551  /* "mprans/cMoveMeshMonitor.pyx":682
12552  * bb_i = elementBoundariesArray[nearestN, ii]
12553  * normal[0] = elementBoundaryNormalsArray[nearestN, ii, 0]
12554  * normal[1] = elementBoundaryNormalsArray[nearestN, ii, 1] # <<<<<<<<<<<<<<
12555  * normal[2] = elementBoundaryNormalsArray[nearestN, ii, 2]
12556  * bound_bar = elementBoundaryBarycentersArray[bb_i]
12557  */
12558  __pyx_t_35 = __pyx_v_nearestN;
12559  __pyx_t_33 = __pyx_v_ii;
12560  __pyx_t_36 = 1;
12561  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementBoundaryNormalsArray.shape[0];
12562  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryNormalsArray.shape[1];
12563  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryNormalsArray.shape[2];
12564  __pyx_t_34 = 1;
12565  if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_normal.shape[0];
12566  *((double *) ( /* dim=0 */ (__pyx_v_normal.data + __pyx_t_34 * __pyx_v_normal.strides[0]) )) = (*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryNormalsArray.data + __pyx_t_35 * __pyx_v_elementBoundaryNormalsArray.strides[0]) ) + __pyx_t_33 * __pyx_v_elementBoundaryNormalsArray.strides[1]) ) + __pyx_t_36 * __pyx_v_elementBoundaryNormalsArray.strides[2]) )));
12567 
12568  /* "mprans/cMoveMeshMonitor.pyx":683
12569  * normal[0] = elementBoundaryNormalsArray[nearestN, ii, 0]
12570  * normal[1] = elementBoundaryNormalsArray[nearestN, ii, 1]
12571  * normal[2] = elementBoundaryNormalsArray[nearestN, ii, 2] # <<<<<<<<<<<<<<
12572  * bound_bar = elementBoundaryBarycentersArray[bb_i]
12573  * dot = (bound_bar[0]-coords[0])*normal[0]+(bound_bar[1]-coords[1])*normal[1]+(bound_bar[2]-coords[2])*normal[2]
12574  */
12575  __pyx_t_36 = __pyx_v_nearestN;
12576  __pyx_t_33 = __pyx_v_ii;
12577  __pyx_t_35 = 2;
12578  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_elementBoundaryNormalsArray.shape[0];
12579  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_elementBoundaryNormalsArray.shape[1];
12580  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_elementBoundaryNormalsArray.shape[2];
12581  __pyx_t_34 = 2;
12582  if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_normal.shape[0];
12583  *((double *) ( /* dim=0 */ (__pyx_v_normal.data + __pyx_t_34 * __pyx_v_normal.strides[0]) )) = (*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryNormalsArray.data + __pyx_t_36 * __pyx_v_elementBoundaryNormalsArray.strides[0]) ) + __pyx_t_33 * __pyx_v_elementBoundaryNormalsArray.strides[1]) ) + __pyx_t_35 * __pyx_v_elementBoundaryNormalsArray.strides[2]) )));
12584 
12585  /* "mprans/cMoveMeshMonitor.pyx":684
12586  * normal[1] = elementBoundaryNormalsArray[nearestN, ii, 1]
12587  * normal[2] = elementBoundaryNormalsArray[nearestN, ii, 2]
12588  * bound_bar = elementBoundaryBarycentersArray[bb_i] # <<<<<<<<<<<<<<
12589  * dot = (bound_bar[0]-coords[0])*normal[0]+(bound_bar[1]-coords[1])*normal[1]+(bound_bar[2]-coords[2])*normal[2]
12590  * if dot < 0.:
12591  */
12592  __pyx_t_9.data = __pyx_v_elementBoundaryBarycentersArray.data;
12593  __pyx_t_9.memview = __pyx_v_elementBoundaryBarycentersArray.memview;
12594  __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
12595  {
12596  Py_ssize_t __pyx_tmp_idx = __pyx_v_bb_i;
12597  Py_ssize_t __pyx_tmp_shape = __pyx_v_elementBoundaryBarycentersArray.shape[0];
12598  Py_ssize_t __pyx_tmp_stride = __pyx_v_elementBoundaryBarycentersArray.strides[0];
12599  if (__pyx_tmp_idx < 0)
12600  __pyx_tmp_idx += __pyx_tmp_shape;
12601  __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
12602 }
12603 
12604 __pyx_t_9.shape[0] = __pyx_v_elementBoundaryBarycentersArray.shape[1];
12605 __pyx_t_9.strides[0] = __pyx_v_elementBoundaryBarycentersArray.strides[1];
12606  __pyx_t_9.suboffsets[0] = -1;
12607 
12608 __PYX_XDEC_MEMVIEW(&__pyx_v_bound_bar, 1);
12609  __pyx_v_bound_bar = __pyx_t_9;
12610  __pyx_t_9.memview = NULL;
12611  __pyx_t_9.data = NULL;
12612 
12613  /* "mprans/cMoveMeshMonitor.pyx":685
12614  * normal[2] = elementBoundaryNormalsArray[nearestN, ii, 2]
12615  * bound_bar = elementBoundaryBarycentersArray[bb_i]
12616  * dot = (bound_bar[0]-coords[0])*normal[0]+(bound_bar[1]-coords[1])*normal[1]+(bound_bar[2]-coords[2])*normal[2] # <<<<<<<<<<<<<<
12617  * if dot < 0.:
12618  * inside_eN = False
12619  */
12620  __pyx_t_35 = 0;
12621  if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_v_bound_bar.shape[0];
12622  __pyx_t_33 = 0;
12623  if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_coords.shape[0];
12624  __pyx_t_36 = 0;
12625  if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_v_normal.shape[0];
12626  __pyx_t_34 = 1;
12627  if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_v_bound_bar.shape[0];
12628  __pyx_t_32 = 1;
12629  if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_v_coords.shape[0];
12630  __pyx_t_31 = 1;
12631  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_normal.shape[0];
12632  __pyx_t_25 = 2;
12633  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_bound_bar.shape[0];
12634  __pyx_t_26 = 2;
12635  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
12636  __pyx_t_17 = 2;
12637  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_normal.shape[0];
12638  __pyx_v_dot = (((((*((double *) ( /* dim=0 */ (__pyx_v_bound_bar.data + __pyx_t_35 * __pyx_v_bound_bar.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_33 * __pyx_v_coords.strides[0]) )))) * (*((double *) ( /* dim=0 */ (__pyx_v_normal.data + __pyx_t_36 * __pyx_v_normal.strides[0]) )))) + (((*((double *) ( /* dim=0 */ (__pyx_v_bound_bar.data + __pyx_t_34 * __pyx_v_bound_bar.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_32 * __pyx_v_coords.strides[0]) )))) * (*((double *) ( /* dim=0 */ (__pyx_v_normal.data + __pyx_t_31 * __pyx_v_normal.strides[0]) ))))) + (((*((double *) ( /* dim=0 */ (__pyx_v_bound_bar.data + __pyx_t_25 * __pyx_v_bound_bar.strides[0]) ))) - (*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )))) * (*((double *) ( /* dim=0 */ (__pyx_v_normal.data + __pyx_t_17 * __pyx_v_normal.strides[0]) )))));
12639 
12640  /* "mprans/cMoveMeshMonitor.pyx":686
12641  * bound_bar = elementBoundaryBarycentersArray[bb_i]
12642  * dot = (bound_bar[0]-coords[0])*normal[0]+(bound_bar[1]-coords[1])*normal[1]+(bound_bar[2]-coords[2])*normal[2]
12643  * if dot < 0.: # <<<<<<<<<<<<<<
12644  * inside_eN = False
12645  * try:
12646  */
12647  __pyx_t_19 = ((__pyx_v_dot < 0.) != 0);
12648  if (__pyx_t_19) {
12649 
12650  /* "mprans/cMoveMeshMonitor.pyx":687
12651  * dot = (bound_bar[0]-coords[0])*normal[0]+(bound_bar[1]-coords[1])*normal[1]+(bound_bar[2]-coords[2])*normal[2]
12652  * if dot < 0.:
12653  * inside_eN = False # <<<<<<<<<<<<<<
12654  * try:
12655  * raise AssertionError('did not find containing element! coords outside domain??')
12656  */
12657  __pyx_v_inside_eN = 0;
12658 
12659  /* "mprans/cMoveMeshMonitor.pyx":688
12660  * if dot < 0.:
12661  * inside_eN = False
12662  * try: # <<<<<<<<<<<<<<
12663  * raise AssertionError('did not find containing element! coords outside domain??')
12664  * except AssertionError as exc:
12665  */
12666  {
12667  __Pyx_PyThreadState_declare
12668  __Pyx_PyThreadState_assign
12669  __Pyx_ExceptionSave(&__pyx_t_39, &__pyx_t_38, &__pyx_t_37);
12670  __Pyx_XGOTREF(__pyx_t_39);
12671  __Pyx_XGOTREF(__pyx_t_38);
12672  __Pyx_XGOTREF(__pyx_t_37);
12673  /*try:*/ {
12674 
12675  /* "mprans/cMoveMeshMonitor.pyx":689
12676  * inside_eN = False
12677  * try:
12678  * raise AssertionError('did not find containing element! coords outside domain??') # <<<<<<<<<<<<<<
12679  * except AssertionError as exc:
12680  * print('Error: ', exc)
12681  */
12682  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L87_error)
12683  __Pyx_GOTREF(__pyx_t_7);
12684  __Pyx_Raise(__pyx_t_7, 0, 0, 0);
12685  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12686  __PYX_ERR(0, 689, __pyx_L87_error)
12687 
12688  /* "mprans/cMoveMeshMonitor.pyx":688
12689  * if dot < 0.:
12690  * inside_eN = False
12691  * try: # <<<<<<<<<<<<<<
12692  * raise AssertionError('did not find containing element! coords outside domain??')
12693  * except AssertionError as exc:
12694  */
12695  }
12696  __pyx_L87_error:;
12697  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12698  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
12699  __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
12700  __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
12701  __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
12702  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12703  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12704  __Pyx_XDECREF(__pyx_t_42); __pyx_t_42 = 0;
12705  __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
12706  __Pyx_XDECREF(__pyx_t_44); __pyx_t_44 = 0;
12707  __Pyx_XDECREF(__pyx_t_45); __pyx_t_45 = 0;
12708  __Pyx_XDECREF(__pyx_t_46); __pyx_t_46 = 0;
12709  __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
12710  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12711  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12712  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12713  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12714  __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
12715 
12716  /* "mprans/cMoveMeshMonitor.pyx":690
12717  * try:
12718  * raise AssertionError('did not find containing element! coords outside domain??')
12719  * except AssertionError as exc: # <<<<<<<<<<<<<<
12720  * print('Error: ', exc)
12721  * print('node number', node)
12722  */
12723  __pyx_t_40 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AssertionError);
12724  if (__pyx_t_40) {
12725  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel", __pyx_clineno, __pyx_lineno, __pyx_filename);
12726  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_47, &__pyx_t_46) < 0) __PYX_ERR(0, 690, __pyx_L89_except_error)
12727  __Pyx_GOTREF(__pyx_t_7);
12728  __Pyx_GOTREF(__pyx_t_47);
12729  __Pyx_GOTREF(__pyx_t_46);
12730  __Pyx_INCREF(__pyx_t_47);
12731  __Pyx_XDECREF_SET(__pyx_v_exc, __pyx_t_47);
12732 
12733  /* "mprans/cMoveMeshMonitor.pyx":691
12734  * raise AssertionError('did not find containing element! coords outside domain??')
12735  * except AssertionError as exc:
12736  * print('Error: ', exc) # <<<<<<<<<<<<<<
12737  * print('node number', node)
12738  * print('node materialType: ',
12739  */
12740  __pyx_t_43 = PyTuple_New(2); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 691, __pyx_L89_except_error)
12741  __Pyx_GOTREF(__pyx_t_43);
12742  __Pyx_INCREF(__pyx_kp_s_Error);
12743  __Pyx_GIVEREF(__pyx_kp_s_Error);
12744  PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_kp_s_Error);
12745  __Pyx_INCREF(__pyx_v_exc);
12746  __Pyx_GIVEREF(__pyx_v_exc);
12747  PyTuple_SET_ITEM(__pyx_t_43, 1, __pyx_v_exc);
12748  if (__Pyx_PrintOne(0, __pyx_t_43) < 0) __PYX_ERR(0, 691, __pyx_L89_except_error)
12749  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
12750 
12751  /* "mprans/cMoveMeshMonitor.pyx":692
12752  * except AssertionError as exc:
12753  * print('Error: ', exc)
12754  * print('node number', node) # <<<<<<<<<<<<<<
12755  * print('node materialType: ',
12756  * nodeMaterialTypes[node])
12757  */
12758  __pyx_t_43 = __Pyx_PyInt_From_int(__pyx_v_node); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 692, __pyx_L89_except_error)
12759  __Pyx_GOTREF(__pyx_t_43);
12760  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 692, __pyx_L89_except_error)
12761  __Pyx_GOTREF(__pyx_t_8);
12762  __Pyx_INCREF(__pyx_kp_s_node_number);
12763  __Pyx_GIVEREF(__pyx_kp_s_node_number);
12764  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_kp_s_node_number);
12765  __Pyx_GIVEREF(__pyx_t_43);
12766  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_43);
12767  __pyx_t_43 = 0;
12768  if (__Pyx_PrintOne(0, __pyx_t_8) < 0) __PYX_ERR(0, 692, __pyx_L89_except_error)
12769  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12770 
12771  /* "mprans/cMoveMeshMonitor.pyx":694
12772  * print('node number', node)
12773  * print('node materialType: ',
12774  * nodeMaterialTypes[node]) # <<<<<<<<<<<<<<
12775  * print('node old coordinates: ',
12776  * nodeArray[node, 0],
12777  */
12778  __pyx_t_17 = __pyx_v_node;
12779  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeMaterialTypes.shape[0];
12780  __pyx_t_8 = __Pyx_PyInt_From_int((*((int *) ( /* dim=0 */ (__pyx_v_nodeMaterialTypes.data + __pyx_t_17 * __pyx_v_nodeMaterialTypes.strides[0]) )))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 694, __pyx_L89_except_error)
12781  __Pyx_GOTREF(__pyx_t_8);
12782 
12783  /* "mprans/cMoveMeshMonitor.pyx":693
12784  * print('Error: ', exc)
12785  * print('node number', node)
12786  * print('node materialType: ', # <<<<<<<<<<<<<<
12787  * nodeMaterialTypes[node])
12788  * print('node old coordinates: ',
12789  */
12790  __pyx_t_43 = PyTuple_New(2); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 693, __pyx_L89_except_error)
12791  __Pyx_GOTREF(__pyx_t_43);
12792  __Pyx_INCREF(__pyx_kp_s_node_materialType);
12793  __Pyx_GIVEREF(__pyx_kp_s_node_materialType);
12794  PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_kp_s_node_materialType);
12795  __Pyx_GIVEREF(__pyx_t_8);
12796  PyTuple_SET_ITEM(__pyx_t_43, 1, __pyx_t_8);
12797  __pyx_t_8 = 0;
12798  if (__Pyx_PrintOne(0, __pyx_t_43) < 0) __PYX_ERR(0, 693, __pyx_L89_except_error)
12799  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
12800 
12801  /* "mprans/cMoveMeshMonitor.pyx":696
12802  * nodeMaterialTypes[node])
12803  * print('node old coordinates: ',
12804  * nodeArray[node, 0], # <<<<<<<<<<<<<<
12805  * nodeArray[node, 1],
12806  * nodeArray[node, 2])
12807  */
12808  __pyx_t_17 = __pyx_v_node;
12809  __pyx_t_26 = 0;
12810  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeArray.shape[0];
12811  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_nodeArray.shape[1];
12812  __pyx_t_43 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_17 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_26 * __pyx_v_nodeArray.strides[1]) )))); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 696, __pyx_L89_except_error)
12813  __Pyx_GOTREF(__pyx_t_43);
12814 
12815  /* "mprans/cMoveMeshMonitor.pyx":697
12816  * print('node old coordinates: ',
12817  * nodeArray[node, 0],
12818  * nodeArray[node, 1], # <<<<<<<<<<<<<<
12819  * nodeArray[node, 2])
12820  * print('node new coordinates: ',
12821  */
12822  __pyx_t_26 = __pyx_v_node;
12823  __pyx_t_17 = 1;
12824  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_nodeArray.shape[0];
12825  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeArray.shape[1];
12826  __pyx_t_8 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_26 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_17 * __pyx_v_nodeArray.strides[1]) )))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L89_except_error)
12827  __Pyx_GOTREF(__pyx_t_8);
12828 
12829  /* "mprans/cMoveMeshMonitor.pyx":698
12830  * nodeArray[node, 0],
12831  * nodeArray[node, 1],
12832  * nodeArray[node, 2]) # <<<<<<<<<<<<<<
12833  * print('node new coordinates: ',
12834  * coords[0],
12835  */
12836  __pyx_t_17 = __pyx_v_node;
12837  __pyx_t_26 = 2;
12838  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_nodeArray.shape[0];
12839  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_nodeArray.shape[1];
12840  __pyx_t_4 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_17 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_26 * __pyx_v_nodeArray.strides[1]) )))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L89_except_error)
12841  __Pyx_GOTREF(__pyx_t_4);
12842 
12843  /* "mprans/cMoveMeshMonitor.pyx":695
12844  * print('node materialType: ',
12845  * nodeMaterialTypes[node])
12846  * print('node old coordinates: ', # <<<<<<<<<<<<<<
12847  * nodeArray[node, 0],
12848  * nodeArray[node, 1],
12849  */
12850  __pyx_t_44 = PyTuple_New(4); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 695, __pyx_L89_except_error)
12851  __Pyx_GOTREF(__pyx_t_44);
12852  __Pyx_INCREF(__pyx_kp_s_node_old_coordinates);
12853  __Pyx_GIVEREF(__pyx_kp_s_node_old_coordinates);
12854  PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_kp_s_node_old_coordinates);
12855  __Pyx_GIVEREF(__pyx_t_43);
12856  PyTuple_SET_ITEM(__pyx_t_44, 1, __pyx_t_43);
12857  __Pyx_GIVEREF(__pyx_t_8);
12858  PyTuple_SET_ITEM(__pyx_t_44, 2, __pyx_t_8);
12859  __Pyx_GIVEREF(__pyx_t_4);
12860  PyTuple_SET_ITEM(__pyx_t_44, 3, __pyx_t_4);
12861  __pyx_t_43 = 0;
12862  __pyx_t_8 = 0;
12863  __pyx_t_4 = 0;
12864  if (__Pyx_PrintOne(0, __pyx_t_44) < 0) __PYX_ERR(0, 695, __pyx_L89_except_error)
12865  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
12866 
12867  /* "mprans/cMoveMeshMonitor.pyx":700
12868  * nodeArray[node, 2])
12869  * print('node new coordinates: ',
12870  * coords[0], # <<<<<<<<<<<<<<
12871  * coords[1],
12872  * coords[2])
12873  */
12874  __pyx_t_26 = 0;
12875  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
12876  __pyx_t_44 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )))); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 700, __pyx_L89_except_error)
12877  __Pyx_GOTREF(__pyx_t_44);
12878 
12879  /* "mprans/cMoveMeshMonitor.pyx":701
12880  * print('node new coordinates: ',
12881  * coords[0],
12882  * coords[1], # <<<<<<<<<<<<<<
12883  * coords[2])
12884  * print('nearestN (element): ',
12885  */
12886  __pyx_t_26 = 1;
12887  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
12888  __pyx_t_4 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L89_except_error)
12889  __Pyx_GOTREF(__pyx_t_4);
12890 
12891  /* "mprans/cMoveMeshMonitor.pyx":702
12892  * coords[0],
12893  * coords[1],
12894  * coords[2]) # <<<<<<<<<<<<<<
12895  * print('nearestN (element): ',
12896  * nearestN,
12897  */
12898  __pyx_t_26 = 2;
12899  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
12900  __pyx_t_8 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 702, __pyx_L89_except_error)
12901  __Pyx_GOTREF(__pyx_t_8);
12902 
12903  /* "mprans/cMoveMeshMonitor.pyx":699
12904  * nodeArray[node, 1],
12905  * nodeArray[node, 2])
12906  * print('node new coordinates: ', # <<<<<<<<<<<<<<
12907  * coords[0],
12908  * coords[1],
12909  */
12910  __pyx_t_43 = PyTuple_New(4); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 699, __pyx_L89_except_error)
12911  __Pyx_GOTREF(__pyx_t_43);
12912  __Pyx_INCREF(__pyx_kp_s_node_new_coordinates);
12913  __Pyx_GIVEREF(__pyx_kp_s_node_new_coordinates);
12914  PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_kp_s_node_new_coordinates);
12915  __Pyx_GIVEREF(__pyx_t_44);
12916  PyTuple_SET_ITEM(__pyx_t_43, 1, __pyx_t_44);
12917  __Pyx_GIVEREF(__pyx_t_4);
12918  PyTuple_SET_ITEM(__pyx_t_43, 2, __pyx_t_4);
12919  __Pyx_GIVEREF(__pyx_t_8);
12920  PyTuple_SET_ITEM(__pyx_t_43, 3, __pyx_t_8);
12921  __pyx_t_44 = 0;
12922  __pyx_t_4 = 0;
12923  __pyx_t_8 = 0;
12924  if (__Pyx_PrintOne(0, __pyx_t_43) < 0) __PYX_ERR(0, 699, __pyx_L89_except_error)
12925  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
12926 
12927  /* "mprans/cMoveMeshMonitor.pyx":704
12928  * coords[2])
12929  * print('nearestN (element): ',
12930  * nearestN, # <<<<<<<<<<<<<<
12931  * 'type (should be 1): ',
12932  * typeN)
12933  */
12934  __pyx_t_43 = __Pyx_PyInt_From_int(__pyx_v_nearestN); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 704, __pyx_L89_except_error)
12935  __Pyx_GOTREF(__pyx_t_43);
12936 
12937  /* "mprans/cMoveMeshMonitor.pyx":706
12938  * nearestN,
12939  * 'type (should be 1): ',
12940  * typeN) # <<<<<<<<<<<<<<
12941  * print('element barycenter: ',
12942  * elementBarycentersArray[nearestN,0],
12943  */
12944  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_typeN); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 706, __pyx_L89_except_error)
12945  __Pyx_GOTREF(__pyx_t_8);
12946 
12947  /* "mprans/cMoveMeshMonitor.pyx":703
12948  * coords[1],
12949  * coords[2])
12950  * print('nearestN (element): ', # <<<<<<<<<<<<<<
12951  * nearestN,
12952  * 'type (should be 1): ',
12953  */
12954  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L89_except_error)
12955  __Pyx_GOTREF(__pyx_t_4);
12956  __Pyx_INCREF(__pyx_kp_s_nearestN_element);
12957  __Pyx_GIVEREF(__pyx_kp_s_nearestN_element);
12958  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_nearestN_element);
12959  __Pyx_GIVEREF(__pyx_t_43);
12960  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_43);
12961  __Pyx_INCREF(__pyx_kp_s_type_should_be_1);
12962  __Pyx_GIVEREF(__pyx_kp_s_type_should_be_1);
12963  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_s_type_should_be_1);
12964  __Pyx_GIVEREF(__pyx_t_8);
12965  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_8);
12966  __pyx_t_43 = 0;
12967  __pyx_t_8 = 0;
12968  if (__Pyx_PrintOne(0, __pyx_t_4) < 0) __PYX_ERR(0, 703, __pyx_L89_except_error)
12969  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12970 
12971  /* "mprans/cMoveMeshMonitor.pyx":708
12972  * typeN)
12973  * print('element barycenter: ',
12974  * elementBarycentersArray[nearestN,0], # <<<<<<<<<<<<<<
12975  * elementBarycentersArray[nearestN,1],
12976  * elementBarycentersArray[nearestN,2])
12977  */
12978  __pyx_t_26 = __pyx_v_nearestN;
12979  __pyx_t_17 = 0;
12980  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBarycentersArray.shape[0];
12981  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBarycentersArray.shape[1];
12982  __pyx_t_4 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_26 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementBarycentersArray.strides[1]) )))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 708, __pyx_L89_except_error)
12983  __Pyx_GOTREF(__pyx_t_4);
12984 
12985  /* "mprans/cMoveMeshMonitor.pyx":709
12986  * print('element barycenter: ',
12987  * elementBarycentersArray[nearestN,0],
12988  * elementBarycentersArray[nearestN,1], # <<<<<<<<<<<<<<
12989  * elementBarycentersArray[nearestN,2])
12990  * for ii in range(elementNodesArray.shape[1]):
12991  */
12992  __pyx_t_17 = __pyx_v_nearestN;
12993  __pyx_t_26 = 1;
12994  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBarycentersArray.shape[0];
12995  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBarycentersArray.shape[1];
12996  __pyx_t_8 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_17 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementBarycentersArray.strides[1]) )))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 709, __pyx_L89_except_error)
12997  __Pyx_GOTREF(__pyx_t_8);
12998 
12999  /* "mprans/cMoveMeshMonitor.pyx":710
13000  * elementBarycentersArray[nearestN,0],
13001  * elementBarycentersArray[nearestN,1],
13002  * elementBarycentersArray[nearestN,2]) # <<<<<<<<<<<<<<
13003  * for ii in range(elementNodesArray.shape[1]):
13004  * print('element node: ',
13005  */
13006  __pyx_t_26 = __pyx_v_nearestN;
13007  __pyx_t_17 = 2;
13008  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementBarycentersArray.shape[0];
13009  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementBarycentersArray.shape[1];
13010  __pyx_t_43 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_26 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementBarycentersArray.strides[1]) )))); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 710, __pyx_L89_except_error)
13011  __Pyx_GOTREF(__pyx_t_43);
13012 
13013  /* "mprans/cMoveMeshMonitor.pyx":707
13014  * 'type (should be 1): ',
13015  * typeN)
13016  * print('element barycenter: ', # <<<<<<<<<<<<<<
13017  * elementBarycentersArray[nearestN,0],
13018  * elementBarycentersArray[nearestN,1],
13019  */
13020  __pyx_t_44 = PyTuple_New(4); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 707, __pyx_L89_except_error)
13021  __Pyx_GOTREF(__pyx_t_44);
13022  __Pyx_INCREF(__pyx_kp_s_element_barycenter);
13023  __Pyx_GIVEREF(__pyx_kp_s_element_barycenter);
13024  PyTuple_SET_ITEM(__pyx_t_44, 0, __pyx_kp_s_element_barycenter);
13025  __Pyx_GIVEREF(__pyx_t_4);
13026  PyTuple_SET_ITEM(__pyx_t_44, 1, __pyx_t_4);
13027  __Pyx_GIVEREF(__pyx_t_8);
13028  PyTuple_SET_ITEM(__pyx_t_44, 2, __pyx_t_8);
13029  __Pyx_GIVEREF(__pyx_t_43);
13030  PyTuple_SET_ITEM(__pyx_t_44, 3, __pyx_t_43);
13031  __pyx_t_4 = 0;
13032  __pyx_t_8 = 0;
13033  __pyx_t_43 = 0;
13034  if (__Pyx_PrintOne(0, __pyx_t_44) < 0) __PYX_ERR(0, 707, __pyx_L89_except_error)
13035  __Pyx_DECREF(__pyx_t_44); __pyx_t_44 = 0;
13036 
13037  /* "mprans/cMoveMeshMonitor.pyx":711
13038  * elementBarycentersArray[nearestN,1],
13039  * elementBarycentersArray[nearestN,2])
13040  * for ii in range(elementNodesArray.shape[1]): # <<<<<<<<<<<<<<
13041  * print('element node: ',
13042  * elementNodesArray[nearestN, ii],
13043  */
13044  __pyx_t_15 = (__pyx_v_elementNodesArray.shape[1]);
13045  __pyx_t_48 = __pyx_t_15;
13046  for (__pyx_t_40 = 0; __pyx_t_40 < __pyx_t_48; __pyx_t_40+=1) {
13047  __pyx_v_ii = __pyx_t_40;
13048 
13049  /* "mprans/cMoveMeshMonitor.pyx":713
13050  * for ii in range(elementNodesArray.shape[1]):
13051  * print('element node: ',
13052  * elementNodesArray[nearestN, ii], # <<<<<<<<<<<<<<
13053  * nodeArray[elementNodesArray[nearestN, ii], 0],
13054  * nodeArray[elementNodesArray[nearestN, ii], 1],
13055  */
13056  __pyx_t_17 = __pyx_v_nearestN;
13057  __pyx_t_26 = __pyx_v_ii;
13058  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementNodesArray.shape[0];
13059  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementNodesArray.shape[1];
13060  __pyx_t_44 = __Pyx_PyInt_From_int((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_17 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementNodesArray.strides[1]) )))); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 713, __pyx_L89_except_error)
13061  __Pyx_GOTREF(__pyx_t_44);
13062 
13063  /* "mprans/cMoveMeshMonitor.pyx":714
13064  * print('element node: ',
13065  * elementNodesArray[nearestN, ii],
13066  * nodeArray[elementNodesArray[nearestN, ii], 0], # <<<<<<<<<<<<<<
13067  * nodeArray[elementNodesArray[nearestN, ii], 1],
13068  * nodeArray[elementNodesArray[nearestN, ii], 2])
13069  */
13070  __pyx_t_26 = __pyx_v_nearestN;
13071  __pyx_t_17 = __pyx_v_ii;
13072  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementNodesArray.shape[0];
13073  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementNodesArray.shape[1];
13074  __pyx_t_25 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_26 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementNodesArray.strides[1]) )));
13075  __pyx_t_31 = 0;
13076  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodeArray.shape[0];
13077  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_nodeArray.shape[1];
13078  __pyx_t_43 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_25 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_31 * __pyx_v_nodeArray.strides[1]) )))); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 714, __pyx_L89_except_error)
13079  __Pyx_GOTREF(__pyx_t_43);
13080 
13081  /* "mprans/cMoveMeshMonitor.pyx":715
13082  * elementNodesArray[nearestN, ii],
13083  * nodeArray[elementNodesArray[nearestN, ii], 0],
13084  * nodeArray[elementNodesArray[nearestN, ii], 1], # <<<<<<<<<<<<<<
13085  * nodeArray[elementNodesArray[nearestN, ii], 2])
13086  * print('fixed_dir: ',
13087  */
13088  __pyx_t_17 = __pyx_v_nearestN;
13089  __pyx_t_26 = __pyx_v_ii;
13090  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementNodesArray.shape[0];
13091  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementNodesArray.shape[1];
13092  __pyx_t_31 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_17 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_26 * __pyx_v_elementNodesArray.strides[1]) )));
13093  __pyx_t_25 = 1;
13094  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_nodeArray.shape[0];
13095  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodeArray.shape[1];
13096  __pyx_t_8 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_31 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_25 * __pyx_v_nodeArray.strides[1]) )))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 715, __pyx_L89_except_error)
13097  __Pyx_GOTREF(__pyx_t_8);
13098 
13099  /* "mprans/cMoveMeshMonitor.pyx":716
13100  * nodeArray[elementNodesArray[nearestN, ii], 0],
13101  * nodeArray[elementNodesArray[nearestN, ii], 1],
13102  * nodeArray[elementNodesArray[nearestN, ii], 2]) # <<<<<<<<<<<<<<
13103  * print('fixed_dir: ',
13104  * fixed_dir[0],
13105  */
13106  __pyx_t_26 = __pyx_v_nearestN;
13107  __pyx_t_17 = __pyx_v_ii;
13108  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_elementNodesArray.shape[0];
13109  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_elementNodesArray.shape[1];
13110  __pyx_t_25 = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementNodesArray.data + __pyx_t_26 * __pyx_v_elementNodesArray.strides[0]) ) + __pyx_t_17 * __pyx_v_elementNodesArray.strides[1]) )));
13111  __pyx_t_31 = 2;
13112  if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_nodeArray.shape[0];
13113  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_nodeArray.shape[1];
13114  __pyx_t_4 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_nodeArray.data + __pyx_t_25 * __pyx_v_nodeArray.strides[0]) ) + __pyx_t_31 * __pyx_v_nodeArray.strides[1]) )))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L89_except_error)
13115  __Pyx_GOTREF(__pyx_t_4);
13116 
13117  /* "mprans/cMoveMeshMonitor.pyx":712
13118  * elementBarycentersArray[nearestN,2])
13119  * for ii in range(elementNodesArray.shape[1]):
13120  * print('element node: ', # <<<<<<<<<<<<<<
13121  * elementNodesArray[nearestN, ii],
13122  * nodeArray[elementNodesArray[nearestN, ii], 0],
13123  */
13124  __pyx_t_45 = PyTuple_New(5); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 712, __pyx_L89_except_error)
13125  __Pyx_GOTREF(__pyx_t_45);
13126  __Pyx_INCREF(__pyx_kp_s_element_node);
13127  __Pyx_GIVEREF(__pyx_kp_s_element_node);
13128  PyTuple_SET_ITEM(__pyx_t_45, 0, __pyx_kp_s_element_node);
13129  __Pyx_GIVEREF(__pyx_t_44);
13130  PyTuple_SET_ITEM(__pyx_t_45, 1, __pyx_t_44);
13131  __Pyx_GIVEREF(__pyx_t_43);
13132  PyTuple_SET_ITEM(__pyx_t_45, 2, __pyx_t_43);
13133  __Pyx_GIVEREF(__pyx_t_8);
13134  PyTuple_SET_ITEM(__pyx_t_45, 3, __pyx_t_8);
13135  __Pyx_GIVEREF(__pyx_t_4);
13136  PyTuple_SET_ITEM(__pyx_t_45, 4, __pyx_t_4);
13137  __pyx_t_44 = 0;
13138  __pyx_t_43 = 0;
13139  __pyx_t_8 = 0;
13140  __pyx_t_4 = 0;
13141  if (__Pyx_PrintOne(0, __pyx_t_45) < 0) __PYX_ERR(0, 712, __pyx_L89_except_error)
13142  __Pyx_DECREF(__pyx_t_45); __pyx_t_45 = 0;
13143  }
13144 
13145  /* "mprans/cMoveMeshMonitor.pyx":718
13146  * nodeArray[elementNodesArray[nearestN, ii], 2])
13147  * print('fixed_dir: ',
13148  * fixed_dir[0], # <<<<<<<<<<<<<<
13149  * fixed_dir[1],
13150  * fixed_dir[2])
13151  */
13152  __pyx_t_17 = 0;
13153  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_fixed_dir.shape[0];
13154  __pyx_t_45 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_17 * __pyx_v_fixed_dir.strides[0]) )))); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 718, __pyx_L89_except_error)
13155  __Pyx_GOTREF(__pyx_t_45);
13156 
13157  /* "mprans/cMoveMeshMonitor.pyx":719
13158  * print('fixed_dir: ',
13159  * fixed_dir[0],
13160  * fixed_dir[1], # <<<<<<<<<<<<<<
13161  * fixed_dir[2])
13162  * print('dot: ', dot)
13163  */
13164  __pyx_t_17 = 1;
13165  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_fixed_dir.shape[0];
13166  __pyx_t_4 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_17 * __pyx_v_fixed_dir.strides[0]) )))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L89_except_error)
13167  __Pyx_GOTREF(__pyx_t_4);
13168 
13169  /* "mprans/cMoveMeshMonitor.pyx":720
13170  * fixed_dir[0],
13171  * fixed_dir[1],
13172  * fixed_dir[2]) # <<<<<<<<<<<<<<
13173  * print('dot: ', dot)
13174  * comm.Abort()
13175  */
13176  __pyx_t_17 = 2;
13177  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_fixed_dir.shape[0];
13178  __pyx_t_8 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_17 * __pyx_v_fixed_dir.strides[0]) )))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 720, __pyx_L89_except_error)
13179  __Pyx_GOTREF(__pyx_t_8);
13180 
13181  /* "mprans/cMoveMeshMonitor.pyx":717
13182  * nodeArray[elementNodesArray[nearestN, ii], 1],
13183  * nodeArray[elementNodesArray[nearestN, ii], 2])
13184  * print('fixed_dir: ', # <<<<<<<<<<<<<<
13185  * fixed_dir[0],
13186  * fixed_dir[1],
13187  */
13188  __pyx_t_43 = PyTuple_New(4); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 717, __pyx_L89_except_error)
13189  __Pyx_GOTREF(__pyx_t_43);
13190  __Pyx_INCREF(__pyx_kp_s_fixed_dir);
13191  __Pyx_GIVEREF(__pyx_kp_s_fixed_dir);
13192  PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_kp_s_fixed_dir);
13193  __Pyx_GIVEREF(__pyx_t_45);
13194  PyTuple_SET_ITEM(__pyx_t_43, 1, __pyx_t_45);
13195  __Pyx_GIVEREF(__pyx_t_4);
13196  PyTuple_SET_ITEM(__pyx_t_43, 2, __pyx_t_4);
13197  __Pyx_GIVEREF(__pyx_t_8);
13198  PyTuple_SET_ITEM(__pyx_t_43, 3, __pyx_t_8);
13199  __pyx_t_45 = 0;
13200  __pyx_t_4 = 0;
13201  __pyx_t_8 = 0;
13202  if (__Pyx_PrintOne(0, __pyx_t_43) < 0) __PYX_ERR(0, 717, __pyx_L89_except_error)
13203  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13204 
13205  /* "mprans/cMoveMeshMonitor.pyx":721
13206  * fixed_dir[1],
13207  * fixed_dir[2])
13208  * print('dot: ', dot) # <<<<<<<<<<<<<<
13209  * comm.Abort()
13210  * if inside_eN:
13211  */
13212  __pyx_t_43 = PyFloat_FromDouble(__pyx_v_dot); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 721, __pyx_L89_except_error)
13213  __Pyx_GOTREF(__pyx_t_43);
13214  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 721, __pyx_L89_except_error)
13215  __Pyx_GOTREF(__pyx_t_8);
13216  __Pyx_INCREF(__pyx_kp_s_dot);
13217  __Pyx_GIVEREF(__pyx_kp_s_dot);
13218  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_kp_s_dot);
13219  __Pyx_GIVEREF(__pyx_t_43);
13220  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_43);
13221  __pyx_t_43 = 0;
13222  if (__Pyx_PrintOne(0, __pyx_t_8) < 0) __PYX_ERR(0, 721, __pyx_L89_except_error)
13223  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13224 
13225  /* "mprans/cMoveMeshMonitor.pyx":722
13226  * fixed_dir[2])
13227  * print('dot: ', dot)
13228  * comm.Abort() # <<<<<<<<<<<<<<
13229  * if inside_eN:
13230  * xi = femSpace.elementMaps.getInverseValue(nearestN, coords)
13231  */
13232  __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_Abort); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 722, __pyx_L89_except_error)
13233  __Pyx_GOTREF(__pyx_t_43);
13234  __pyx_t_4 = NULL;
13235  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_43))) {
13236  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_43);
13237  if (likely(__pyx_t_4)) {
13238  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_43);
13239  __Pyx_INCREF(__pyx_t_4);
13240  __Pyx_INCREF(function);
13241  __Pyx_DECREF_SET(__pyx_t_43, function);
13242  }
13243  }
13244  __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_43, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_43);
13245  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13246  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 722, __pyx_L89_except_error)
13247  __Pyx_GOTREF(__pyx_t_8);
13248  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13249  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13250  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13251  __Pyx_XDECREF(__pyx_t_47); __pyx_t_47 = 0;
13252  __Pyx_XDECREF(__pyx_t_46); __pyx_t_46 = 0;
13253  goto __pyx_L88_exception_handled;
13254  }
13255  goto __pyx_L89_except_error;
13256  __pyx_L89_except_error:;
13257 
13258  /* "mprans/cMoveMeshMonitor.pyx":688
13259  * if dot < 0.:
13260  * inside_eN = False
13261  * try: # <<<<<<<<<<<<<<
13262  * raise AssertionError('did not find containing element! coords outside domain??')
13263  * except AssertionError as exc:
13264  */
13265  __Pyx_XGIVEREF(__pyx_t_39);
13266  __Pyx_XGIVEREF(__pyx_t_38);
13267  __Pyx_XGIVEREF(__pyx_t_37);
13268  __Pyx_ExceptionReset(__pyx_t_39, __pyx_t_38, __pyx_t_37);
13269  goto __pyx_L1_error;
13270  __pyx_L88_exception_handled:;
13271  __Pyx_XGIVEREF(__pyx_t_39);
13272  __Pyx_XGIVEREF(__pyx_t_38);
13273  __Pyx_XGIVEREF(__pyx_t_37);
13274  __Pyx_ExceptionReset(__pyx_t_39, __pyx_t_38, __pyx_t_37);
13275  }
13276 
13277  /* "mprans/cMoveMeshMonitor.pyx":686
13278  * bound_bar = elementBoundaryBarycentersArray[bb_i]
13279  * dot = (bound_bar[0]-coords[0])*normal[0]+(bound_bar[1]-coords[1])*normal[1]+(bound_bar[2]-coords[2])*normal[2]
13280  * if dot < 0.: # <<<<<<<<<<<<<<
13281  * inside_eN = False
13282  * try:
13283  */
13284  }
13285  }
13286 
13287  /* "mprans/cMoveMeshMonitor.pyx":723
13288  * print('dot: ', dot)
13289  * comm.Abort()
13290  * if inside_eN: # <<<<<<<<<<<<<<
13291  * xi = femSpace.elementMaps.getInverseValue(nearestN, coords)
13292  * # line below needs optimisation:
13293  */
13294  __pyx_t_19 = (__pyx_v_inside_eN != 0);
13295  if (__pyx_t_19) {
13296 
13297  /* "mprans/cMoveMeshMonitor.pyx":724
13298  * comm.Abort()
13299  * if inside_eN:
13300  * xi = femSpace.elementMaps.getInverseValue(nearestN, coords) # <<<<<<<<<<<<<<
13301  * # line below needs optimisation:
13302  * v_grad = pc.getGradientValue(nearestN, xi)
13303  */
13304  __pyx_t_47 = __Pyx_PyObject_GetAttrStr(__pyx_v_femSpace, __pyx_n_s_elementMaps); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 724, __pyx_L1_error)
13305  __Pyx_GOTREF(__pyx_t_47);
13306  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_47, __pyx_n_s_getInverseValue); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 724, __pyx_L1_error)
13307  __Pyx_GOTREF(__pyx_t_7);
13308  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13309  __pyx_t_47 = __Pyx_PyInt_From_int(__pyx_v_nearestN); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 724, __pyx_L1_error)
13310  __Pyx_GOTREF(__pyx_t_47);
13311  __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 724, __pyx_L1_error)
13312  __Pyx_GOTREF(__pyx_t_8);
13313  __pyx_t_43 = NULL;
13314  __pyx_t_27 = 0;
13315  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
13316  __pyx_t_43 = PyMethod_GET_SELF(__pyx_t_7);
13317  if (likely(__pyx_t_43)) {
13318  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
13319  __Pyx_INCREF(__pyx_t_43);
13320  __Pyx_INCREF(function);
13321  __Pyx_DECREF_SET(__pyx_t_7, function);
13322  __pyx_t_27 = 1;
13323  }
13324  }
13325  #if CYTHON_FAST_PYCALL
13326  if (PyFunction_Check(__pyx_t_7)) {
13327  PyObject *__pyx_temp[3] = {__pyx_t_43, __pyx_t_47, __pyx_t_8};
13328  __pyx_t_46 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 724, __pyx_L1_error)
13329  __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
13330  __Pyx_GOTREF(__pyx_t_46);
13331  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13332  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13333  } else
13334  #endif
13335  #if CYTHON_FAST_PYCCALL
13336  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
13337  PyObject *__pyx_temp[3] = {__pyx_t_43, __pyx_t_47, __pyx_t_8};
13338  __pyx_t_46 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 724, __pyx_L1_error)
13339  __Pyx_XDECREF(__pyx_t_43); __pyx_t_43 = 0;
13340  __Pyx_GOTREF(__pyx_t_46);
13341  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13342  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13343  } else
13344  #endif
13345  {
13346  __pyx_t_4 = PyTuple_New(2+__pyx_t_27); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __pyx_L1_error)
13347  __Pyx_GOTREF(__pyx_t_4);
13348  if (__pyx_t_43) {
13349  __Pyx_GIVEREF(__pyx_t_43); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_43); __pyx_t_43 = NULL;
13350  }
13351  __Pyx_GIVEREF(__pyx_t_47);
13352  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_27, __pyx_t_47);
13353  __Pyx_GIVEREF(__pyx_t_8);
13354  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_27, __pyx_t_8);
13355  __pyx_t_47 = 0;
13356  __pyx_t_8 = 0;
13357  __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 724, __pyx_L1_error)
13358  __Pyx_GOTREF(__pyx_t_46);
13359  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13360  }
13361  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13362  __Pyx_XDECREF_SET(__pyx_v_xi, __pyx_t_46);
13363  __pyx_t_46 = 0;
13364 
13365  /* "mprans/cMoveMeshMonitor.pyx":726
13366  * xi = femSpace.elementMaps.getInverseValue(nearestN, coords)
13367  * # line below needs optimisation:
13368  * v_grad = pc.getGradientValue(nearestN, xi) # <<<<<<<<<<<<<<
13369  * area = pc.getAreaValue(nearestN, xi)
13370  * if u_phi is not None:
13371  */
13372  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_getGradientValue); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L1_error)
13373  __Pyx_GOTREF(__pyx_t_7);
13374  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nearestN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error)
13375  __Pyx_GOTREF(__pyx_t_4);
13376  __pyx_t_8 = NULL;
13377  __pyx_t_27 = 0;
13378  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
13379  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
13380  if (likely(__pyx_t_8)) {
13381  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
13382  __Pyx_INCREF(__pyx_t_8);
13383  __Pyx_INCREF(function);
13384  __Pyx_DECREF_SET(__pyx_t_7, function);
13385  __pyx_t_27 = 1;
13386  }
13387  }
13388  #if CYTHON_FAST_PYCALL
13389  if (PyFunction_Check(__pyx_t_7)) {
13390  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_4, __pyx_v_xi};
13391  __pyx_t_46 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 726, __pyx_L1_error)
13392  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
13393  __Pyx_GOTREF(__pyx_t_46);
13394  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13395  } else
13396  #endif
13397  #if CYTHON_FAST_PYCCALL
13398  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
13399  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_4, __pyx_v_xi};
13400  __pyx_t_46 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 726, __pyx_L1_error)
13401  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
13402  __Pyx_GOTREF(__pyx_t_46);
13403  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13404  } else
13405  #endif
13406  {
13407  __pyx_t_47 = PyTuple_New(2+__pyx_t_27); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 726, __pyx_L1_error)
13408  __Pyx_GOTREF(__pyx_t_47);
13409  if (__pyx_t_8) {
13410  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_47, 0, __pyx_t_8); __pyx_t_8 = NULL;
13411  }
13412  __Pyx_GIVEREF(__pyx_t_4);
13413  PyTuple_SET_ITEM(__pyx_t_47, 0+__pyx_t_27, __pyx_t_4);
13414  __Pyx_INCREF(__pyx_v_xi);
13415  __Pyx_GIVEREF(__pyx_v_xi);
13416  PyTuple_SET_ITEM(__pyx_t_47, 1+__pyx_t_27, __pyx_v_xi);
13417  __pyx_t_4 = 0;
13418  __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_47, NULL); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 726, __pyx_L1_error)
13419  __Pyx_GOTREF(__pyx_t_46);
13420  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13421  }
13422  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13423  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_46, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 726, __pyx_L1_error)
13424  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
13425  __PYX_XDEC_MEMVIEW(&__pyx_v_v_grad, 1);
13426  __pyx_v_v_grad = __pyx_t_9;
13427  __pyx_t_9.memview = NULL;
13428  __pyx_t_9.data = NULL;
13429 
13430  /* "mprans/cMoveMeshMonitor.pyx":727
13431  * # line below needs optimisation:
13432  * v_grad = pc.getGradientValue(nearestN, xi)
13433  * area = pc.getAreaValue(nearestN, xi) # <<<<<<<<<<<<<<
13434  * if u_phi is not None:
13435  * # line below needs optimisation:
13436  */
13437  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_getAreaValue); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L1_error)
13438  __Pyx_GOTREF(__pyx_t_7);
13439  __pyx_t_47 = __Pyx_PyInt_From_int(__pyx_v_nearestN); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 727, __pyx_L1_error)
13440  __Pyx_GOTREF(__pyx_t_47);
13441  __pyx_t_4 = NULL;
13442  __pyx_t_27 = 0;
13443  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
13444  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
13445  if (likely(__pyx_t_4)) {
13446  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
13447  __Pyx_INCREF(__pyx_t_4);
13448  __Pyx_INCREF(function);
13449  __Pyx_DECREF_SET(__pyx_t_7, function);
13450  __pyx_t_27 = 1;
13451  }
13452  }
13453  #if CYTHON_FAST_PYCALL
13454  if (PyFunction_Check(__pyx_t_7)) {
13455  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_47, __pyx_v_xi};
13456  __pyx_t_46 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 727, __pyx_L1_error)
13457  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13458  __Pyx_GOTREF(__pyx_t_46);
13459  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13460  } else
13461  #endif
13462  #if CYTHON_FAST_PYCCALL
13463  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
13464  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_47, __pyx_v_xi};
13465  __pyx_t_46 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 727, __pyx_L1_error)
13466  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13467  __Pyx_GOTREF(__pyx_t_46);
13468  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13469  } else
13470  #endif
13471  {
13472  __pyx_t_8 = PyTuple_New(2+__pyx_t_27); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 727, __pyx_L1_error)
13473  __Pyx_GOTREF(__pyx_t_8);
13474  if (__pyx_t_4) {
13475  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
13476  }
13477  __Pyx_GIVEREF(__pyx_t_47);
13478  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_27, __pyx_t_47);
13479  __Pyx_INCREF(__pyx_v_xi);
13480  __Pyx_GIVEREF(__pyx_v_xi);
13481  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_27, __pyx_v_xi);
13482  __pyx_t_47 = 0;
13483  __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 727, __pyx_L1_error)
13484  __Pyx_GOTREF(__pyx_t_46);
13485  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13486  }
13487  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13488  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_46); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
13489  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
13490  __pyx_v_area = __pyx_t_12;
13491 
13492  /* "mprans/cMoveMeshMonitor.pyx":728
13493  * v_grad = pc.getGradientValue(nearestN, xi)
13494  * area = pc.getAreaValue(nearestN, xi)
13495  * if u_phi is not None: # <<<<<<<<<<<<<<
13496  * # line below needs optimisation:
13497  * ls_phi = pc.getLevelSetValue(nearestN, coords)
13498  */
13499  __pyx_t_19 = ((((PyObject *) __pyx_v_u_phi.memview) != Py_None) != 0);
13500  if (__pyx_t_19) {
13501 
13502  /* "mprans/cMoveMeshMonitor.pyx":730
13503  * if u_phi is not None:
13504  * # line below needs optimisation:
13505  * ls_phi = pc.getLevelSetValue(nearestN, coords) # <<<<<<<<<<<<<<
13506  * else:
13507  * ls_phi = 1e12
13508  */
13509  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_getLevelSetValue); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 730, __pyx_L1_error)
13510  __Pyx_GOTREF(__pyx_t_7);
13511  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nearestN); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 730, __pyx_L1_error)
13512  __Pyx_GOTREF(__pyx_t_8);
13513  __pyx_t_47 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 730, __pyx_L1_error)
13514  __Pyx_GOTREF(__pyx_t_47);
13515  __pyx_t_4 = NULL;
13516  __pyx_t_27 = 0;
13517  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
13518  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
13519  if (likely(__pyx_t_4)) {
13520  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
13521  __Pyx_INCREF(__pyx_t_4);
13522  __Pyx_INCREF(function);
13523  __Pyx_DECREF_SET(__pyx_t_7, function);
13524  __pyx_t_27 = 1;
13525  }
13526  }
13527  #if CYTHON_FAST_PYCALL
13528  if (PyFunction_Check(__pyx_t_7)) {
13529  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_8, __pyx_t_47};
13530  __pyx_t_46 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 730, __pyx_L1_error)
13531  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13532  __Pyx_GOTREF(__pyx_t_46);
13533  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13534  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13535  } else
13536  #endif
13537  #if CYTHON_FAST_PYCCALL
13538  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
13539  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_8, __pyx_t_47};
13540  __pyx_t_46 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_27, 2+__pyx_t_27); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 730, __pyx_L1_error)
13541  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13542  __Pyx_GOTREF(__pyx_t_46);
13543  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13544  __Pyx_DECREF(__pyx_t_47); __pyx_t_47 = 0;
13545  } else
13546  #endif
13547  {
13548  __pyx_t_43 = PyTuple_New(2+__pyx_t_27); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 730, __pyx_L1_error)
13549  __Pyx_GOTREF(__pyx_t_43);
13550  if (__pyx_t_4) {
13551  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_43, 0, __pyx_t_4); __pyx_t_4 = NULL;
13552  }
13553  __Pyx_GIVEREF(__pyx_t_8);
13554  PyTuple_SET_ITEM(__pyx_t_43, 0+__pyx_t_27, __pyx_t_8);
13555  __Pyx_GIVEREF(__pyx_t_47);
13556  PyTuple_SET_ITEM(__pyx_t_43, 1+__pyx_t_27, __pyx_t_47);
13557  __pyx_t_8 = 0;
13558  __pyx_t_47 = 0;
13559  __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_43, NULL); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 730, __pyx_L1_error)
13560  __Pyx_GOTREF(__pyx_t_46);
13561  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13562  }
13563  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13564  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_46); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 730, __pyx_L1_error)
13565  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
13566  __pyx_v_ls_phi = __pyx_t_12;
13567 
13568  /* "mprans/cMoveMeshMonitor.pyx":728
13569  * v_grad = pc.getGradientValue(nearestN, xi)
13570  * area = pc.getAreaValue(nearestN, xi)
13571  * if u_phi is not None: # <<<<<<<<<<<<<<
13572  * # line below needs optimisation:
13573  * ls_phi = pc.getLevelSetValue(nearestN, coords)
13574  */
13575  goto __pyx_L100;
13576  }
13577 
13578  /* "mprans/cMoveMeshMonitor.pyx":732
13579  * ls_phi = pc.getLevelSetValue(nearestN, coords)
13580  * else:
13581  * ls_phi = 1e12 # <<<<<<<<<<<<<<
13582  * f = pc.evaluateFunAtX(x=coords, ls_phi=ls_phi)
13583  * for ndi in range(nd):
13584  */
13585  /*else*/ {
13586  __pyx_v_ls_phi = 1e12;
13587  }
13588  __pyx_L100:;
13589 
13590  /* "mprans/cMoveMeshMonitor.pyx":733
13591  * else:
13592  * ls_phi = 1e12
13593  * f = pc.evaluateFunAtX(x=coords, ls_phi=ls_phi) # <<<<<<<<<<<<<<
13594  * for ndi in range(nd):
13595  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
13596  */
13597  __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_evaluateFunAtX); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 733, __pyx_L1_error)
13598  __Pyx_GOTREF(__pyx_t_46);
13599  __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 733, __pyx_L1_error)
13600  __Pyx_GOTREF(__pyx_t_7);
13601  __pyx_t_43 = __pyx_memoryview_fromslice(__pyx_v_coords, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 733, __pyx_L1_error)
13602  __Pyx_GOTREF(__pyx_t_43);
13603  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_x, __pyx_t_43) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
13604  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13605  __pyx_t_43 = PyFloat_FromDouble(__pyx_v_ls_phi); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 733, __pyx_L1_error)
13606  __Pyx_GOTREF(__pyx_t_43);
13607  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ls_phi, __pyx_t_43) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
13608  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13609  __pyx_t_43 = __Pyx_PyObject_Call(__pyx_t_46, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 733, __pyx_L1_error)
13610  __Pyx_GOTREF(__pyx_t_43);
13611  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
13612  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13613  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_43); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L1_error)
13614  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13615  __pyx_v_f = __pyx_t_12;
13616 
13617  /* "mprans/cMoveMeshMonitor.pyx":734
13618  * ls_phi = 1e12
13619  * f = pc.evaluateFunAtX(x=coords, ls_phi=ls_phi)
13620  * for ndi in range(nd): # <<<<<<<<<<<<<<
13621  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
13622  * coords[ndi] += dphi[ndi]*fixed_dir[ndi]*dt
13623  */
13624  __pyx_t_27 = __pyx_v_nd;
13625  __pyx_t_28 = __pyx_t_27;
13626  for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
13627  __pyx_v_ndi = __pyx_t_29;
13628 
13629  /* "mprans/cMoveMeshMonitor.pyx":735
13630  * f = pc.evaluateFunAtX(x=coords, ls_phi=ls_phi)
13631  * for ndi in range(nd):
13632  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area) # <<<<<<<<<<<<<<
13633  * coords[ndi] += dphi[ndi]*fixed_dir[ndi]*dt
13634  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank],
13635  */
13636  __pyx_t_17 = __pyx_v_ndi;
13637  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_v_grad.shape[0];
13638  __pyx_t_26 = __pyx_v_ndi;
13639  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_dphi.shape[0];
13640  *((double *) ( /* dim=0 */ (__pyx_v_dphi.data + __pyx_t_26 * __pyx_v_dphi.strides[0]) )) = ((*((double *) ( /* dim=0 */ (__pyx_v_v_grad.data + __pyx_t_17 * __pyx_v_v_grad.strides[0]) ))) / (((__pyx_v_t * 1.) / (__pyx_v_f * __pyx_v_Ccoeff)) + (((1.0 - __pyx_v_t) * 1.) / __pyx_v_area)));
13641 
13642  /* "mprans/cMoveMeshMonitor.pyx":736
13643  * for ndi in range(nd):
13644  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
13645  * coords[ndi] += dphi[ndi]*fixed_dir[ndi]*dt # <<<<<<<<<<<<<<
13646  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank],
13647  * [[coords[0],
13648  */
13649  __pyx_t_17 = __pyx_v_ndi;
13650  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_dphi.shape[0];
13651  __pyx_t_26 = __pyx_v_ndi;
13652  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_fixed_dir.shape[0];
13653  __pyx_t_31 = __pyx_v_ndi;
13654  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_coords.shape[0];
13655  *((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_31 * __pyx_v_coords.strides[0]) )) += (((*((double *) ( /* dim=0 */ (__pyx_v_dphi.data + __pyx_t_17 * __pyx_v_dphi.strides[0]) ))) * (*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_26 * __pyx_v_fixed_dir.strides[0]) )))) * __pyx_v_dt);
13656  }
13657 
13658  /* "mprans/cMoveMeshMonitor.pyx":723
13659  * print('dot: ', dot)
13660  * comm.Abort()
13661  * if inside_eN: # <<<<<<<<<<<<<<
13662  * xi = femSpace.elementMaps.getInverseValue(nearestN, coords)
13663  * # line below needs optimisation:
13664  */
13665  }
13666  }
13667  __pyx_L81:;
13668 
13669  /* "mprans/cMoveMeshMonitor.pyx":635
13670  * fixed_dir[1] = coords_2doArray[iN, 13]
13671  * fixed_dir[2] = coords_2doArray[iN, 14]
13672  * if solFound_2doArray[iN] == 0: # <<<<<<<<<<<<<<
13673  * result = findN(coords=coords,
13674  * nodeArray=nodeArray,
13675  */
13676  }
13677 
13678  /* "mprans/cMoveMeshMonitor.pyx":737
13679  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
13680  * coords[ndi] += dphi[ndi]*fixed_dir[ndi]*dt
13681  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank], # <<<<<<<<<<<<<<
13682  * [[coords[0],
13683  * coords[1],
13684  */
13685  __Pyx_GetModuleGlobalName(__pyx_t_43, __pyx_n_s_np); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 737, __pyx_L1_error)
13686  __Pyx_GOTREF(__pyx_t_43);
13687  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_43, __pyx_n_s_append); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 737, __pyx_L1_error)
13688  __Pyx_GOTREF(__pyx_t_7);
13689  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13690  __pyx_t_43 = __Pyx_PyInt_From_int(__pyx_v_new_rank); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 737, __pyx_L1_error)
13691  __Pyx_GOTREF(__pyx_t_43);
13692  __pyx_t_46 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_43); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 737, __pyx_L1_error)
13693  __Pyx_GOTREF(__pyx_t_46);
13694  __Pyx_DECREF(__pyx_t_43); __pyx_t_43 = 0;
13695 
13696  /* "mprans/cMoveMeshMonitor.pyx":738
13697  * coords[ndi] += dphi[ndi]*fixed_dir[ndi]*dt
13698  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank],
13699  * [[coords[0], # <<<<<<<<<<<<<<
13700  * coords[1],
13701  * coords[2],
13702  */
13703  __pyx_t_26 = 0;
13704  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
13705  __pyx_t_43 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )))); if (unlikely(!__pyx_t_43)) __PYX_ERR(0, 738, __pyx_L1_error)
13706  __Pyx_GOTREF(__pyx_t_43);
13707 
13708  /* "mprans/cMoveMeshMonitor.pyx":739
13709  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank],
13710  * [[coords[0],
13711  * coords[1], # <<<<<<<<<<<<<<
13712  * coords[2],
13713  * nearestN,
13714  */
13715  __pyx_t_26 = 1;
13716  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
13717  __pyx_t_47 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )))); if (unlikely(!__pyx_t_47)) __PYX_ERR(0, 739, __pyx_L1_error)
13718  __Pyx_GOTREF(__pyx_t_47);
13719 
13720  /* "mprans/cMoveMeshMonitor.pyx":740
13721  * [[coords[0],
13722  * coords[1],
13723  * coords[2], # <<<<<<<<<<<<<<
13724  * nearestN,
13725  * typeN,
13726  */
13727  __pyx_t_26 = 2;
13728  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_coords.shape[0];
13729  __pyx_t_8 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_26 * __pyx_v_coords.strides[0]) )))); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 740, __pyx_L1_error)
13730  __Pyx_GOTREF(__pyx_t_8);
13731 
13732  /* "mprans/cMoveMeshMonitor.pyx":741
13733  * coords[1],
13734  * coords[2],
13735  * nearestN, # <<<<<<<<<<<<<<
13736  * typeN,
13737  * v_grad[0],
13738  */
13739  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nearestN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error)
13740  __Pyx_GOTREF(__pyx_t_4);
13741 
13742  /* "mprans/cMoveMeshMonitor.pyx":742
13743  * coords[2],
13744  * nearestN,
13745  * typeN, # <<<<<<<<<<<<<<
13746  * v_grad[0],
13747  * v_grad[1],
13748  */
13749  __pyx_t_45 = __Pyx_PyInt_From_int(__pyx_v_typeN); if (unlikely(!__pyx_t_45)) __PYX_ERR(0, 742, __pyx_L1_error)
13750  __Pyx_GOTREF(__pyx_t_45);
13751 
13752  /* "mprans/cMoveMeshMonitor.pyx":743
13753  * nearestN,
13754  * typeN,
13755  * v_grad[0], # <<<<<<<<<<<<<<
13756  * v_grad[1],
13757  * v_grad[2],
13758  */
13759  __pyx_t_26 = 0;
13760  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_v_grad.shape[0];
13761  __pyx_t_44 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_v_grad.data + __pyx_t_26 * __pyx_v_v_grad.strides[0]) )))); if (unlikely(!__pyx_t_44)) __PYX_ERR(0, 743, __pyx_L1_error)
13762  __Pyx_GOTREF(__pyx_t_44);
13763 
13764  /* "mprans/cMoveMeshMonitor.pyx":744
13765  * typeN,
13766  * v_grad[0],
13767  * v_grad[1], # <<<<<<<<<<<<<<
13768  * v_grad[2],
13769  * area,
13770  */
13771  __pyx_t_26 = 1;
13772  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_v_grad.shape[0];
13773  __pyx_t_42 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_v_grad.data + __pyx_t_26 * __pyx_v_v_grad.strides[0]) )))); if (unlikely(!__pyx_t_42)) __PYX_ERR(0, 744, __pyx_L1_error)
13774  __Pyx_GOTREF(__pyx_t_42);
13775 
13776  /* "mprans/cMoveMeshMonitor.pyx":745
13777  * v_grad[0],
13778  * v_grad[1],
13779  * v_grad[2], # <<<<<<<<<<<<<<
13780  * area,
13781  * ls_phi,
13782  */
13783  __pyx_t_26 = 2;
13784  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_v_grad.shape[0];
13785  __pyx_t_5 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_v_grad.data + __pyx_t_26 * __pyx_v_v_grad.strides[0]) )))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 745, __pyx_L1_error)
13786  __Pyx_GOTREF(__pyx_t_5);
13787 
13788  /* "mprans/cMoveMeshMonitor.pyx":746
13789  * v_grad[1],
13790  * v_grad[2],
13791  * area, # <<<<<<<<<<<<<<
13792  * ls_phi,
13793  * node0,
13794  */
13795  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_area); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 746, __pyx_L1_error)
13796  __Pyx_GOTREF(__pyx_t_6);
13797 
13798  /* "mprans/cMoveMeshMonitor.pyx":747
13799  * v_grad[2],
13800  * area,
13801  * ls_phi, # <<<<<<<<<<<<<<
13802  * node0,
13803  * rank0,
13804  */
13805  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_ls_phi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error)
13806  __Pyx_GOTREF(__pyx_t_1);
13807 
13808  /* "mprans/cMoveMeshMonitor.pyx":748
13809  * area,
13810  * ls_phi,
13811  * node0, # <<<<<<<<<<<<<<
13812  * rank0,
13813  * fixed_dir[0],
13814  */
13815  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_node0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error)
13816  __Pyx_GOTREF(__pyx_t_3);
13817 
13818  /* "mprans/cMoveMeshMonitor.pyx":750
13819  * node0,
13820  * rank0,
13821  * fixed_dir[0], # <<<<<<<<<<<<<<
13822  * fixed_dir[1],
13823  * fixed_dir[2]]],
13824  */
13825  __pyx_t_26 = 0;
13826  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_fixed_dir.shape[0];
13827  __pyx_t_50 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_26 * __pyx_v_fixed_dir.strides[0]) )))); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 750, __pyx_L1_error)
13828  __Pyx_GOTREF(__pyx_t_50);
13829 
13830  /* "mprans/cMoveMeshMonitor.pyx":751
13831  * rank0,
13832  * fixed_dir[0],
13833  * fixed_dir[1], # <<<<<<<<<<<<<<
13834  * fixed_dir[2]]],
13835  * axis=0)
13836  */
13837  __pyx_t_26 = 1;
13838  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_fixed_dir.shape[0];
13839  __pyx_t_51 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_26 * __pyx_v_fixed_dir.strides[0]) )))); if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 751, __pyx_L1_error)
13840  __Pyx_GOTREF(__pyx_t_51);
13841 
13842  /* "mprans/cMoveMeshMonitor.pyx":752
13843  * fixed_dir[0],
13844  * fixed_dir[1],
13845  * fixed_dir[2]]], # <<<<<<<<<<<<<<
13846  * axis=0)
13847  * nPending_disp_total = comm.allreduce(nPending_disp)
13848  */
13849  __pyx_t_26 = 2;
13850  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_fixed_dir.shape[0];
13851  __pyx_t_52 = PyFloat_FromDouble((*((double *) ( /* dim=0 */ (__pyx_v_fixed_dir.data + __pyx_t_26 * __pyx_v_fixed_dir.strides[0]) )))); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 752, __pyx_L1_error)
13852  __Pyx_GOTREF(__pyx_t_52);
13853 
13854  /* "mprans/cMoveMeshMonitor.pyx":738
13855  * coords[ndi] += dphi[ndi]*fixed_dir[ndi]*dt
13856  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank],
13857  * [[coords[0], # <<<<<<<<<<<<<<
13858  * coords[1],
13859  * coords[2],
13860  */
13861  __pyx_t_53 = PyList_New(15); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 738, __pyx_L1_error)
13862  __Pyx_GOTREF(__pyx_t_53);
13863  __Pyx_GIVEREF(__pyx_t_43);
13864  PyList_SET_ITEM(__pyx_t_53, 0, __pyx_t_43);
13865  __Pyx_GIVEREF(__pyx_t_47);
13866  PyList_SET_ITEM(__pyx_t_53, 1, __pyx_t_47);
13867  __Pyx_GIVEREF(__pyx_t_8);
13868  PyList_SET_ITEM(__pyx_t_53, 2, __pyx_t_8);
13869  __Pyx_GIVEREF(__pyx_t_4);
13870  PyList_SET_ITEM(__pyx_t_53, 3, __pyx_t_4);
13871  __Pyx_GIVEREF(__pyx_t_45);
13872  PyList_SET_ITEM(__pyx_t_53, 4, __pyx_t_45);
13873  __Pyx_GIVEREF(__pyx_t_44);
13874  PyList_SET_ITEM(__pyx_t_53, 5, __pyx_t_44);
13875  __Pyx_GIVEREF(__pyx_t_42);
13876  PyList_SET_ITEM(__pyx_t_53, 6, __pyx_t_42);
13877  __Pyx_GIVEREF(__pyx_t_5);
13878  PyList_SET_ITEM(__pyx_t_53, 7, __pyx_t_5);
13879  __Pyx_GIVEREF(__pyx_t_6);
13880  PyList_SET_ITEM(__pyx_t_53, 8, __pyx_t_6);
13881  __Pyx_GIVEREF(__pyx_t_1);
13882  PyList_SET_ITEM(__pyx_t_53, 9, __pyx_t_1);
13883  __Pyx_GIVEREF(__pyx_t_3);
13884  PyList_SET_ITEM(__pyx_t_53, 10, __pyx_t_3);
13885  __Pyx_INCREF(__pyx_v_rank0);
13886  __Pyx_GIVEREF(__pyx_v_rank0);
13887  PyList_SET_ITEM(__pyx_t_53, 11, __pyx_v_rank0);
13888  __Pyx_GIVEREF(__pyx_t_50);
13889  PyList_SET_ITEM(__pyx_t_53, 12, __pyx_t_50);
13890  __Pyx_GIVEREF(__pyx_t_51);
13891  PyList_SET_ITEM(__pyx_t_53, 13, __pyx_t_51);
13892  __Pyx_GIVEREF(__pyx_t_52);
13893  PyList_SET_ITEM(__pyx_t_53, 14, __pyx_t_52);
13894  __pyx_t_43 = 0;
13895  __pyx_t_47 = 0;
13896  __pyx_t_8 = 0;
13897  __pyx_t_4 = 0;
13898  __pyx_t_45 = 0;
13899  __pyx_t_44 = 0;
13900  __pyx_t_42 = 0;
13901  __pyx_t_5 = 0;
13902  __pyx_t_6 = 0;
13903  __pyx_t_1 = 0;
13904  __pyx_t_3 = 0;
13905  __pyx_t_50 = 0;
13906  __pyx_t_51 = 0;
13907  __pyx_t_52 = 0;
13908  __pyx_t_52 = PyList_New(1); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 738, __pyx_L1_error)
13909  __Pyx_GOTREF(__pyx_t_52);
13910  __Pyx_GIVEREF(__pyx_t_53);
13911  PyList_SET_ITEM(__pyx_t_52, 0, __pyx_t_53);
13912  __pyx_t_53 = 0;
13913 
13914  /* "mprans/cMoveMeshMonitor.pyx":737
13915  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
13916  * coords[ndi] += dphi[ndi]*fixed_dir[ndi]*dt
13917  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank], # <<<<<<<<<<<<<<
13918  * [[coords[0],
13919  * coords[1],
13920  */
13921  __pyx_t_53 = PyTuple_New(2); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 737, __pyx_L1_error)
13922  __Pyx_GOTREF(__pyx_t_53);
13923  __Pyx_GIVEREF(__pyx_t_46);
13924  PyTuple_SET_ITEM(__pyx_t_53, 0, __pyx_t_46);
13925  __Pyx_GIVEREF(__pyx_t_52);
13926  PyTuple_SET_ITEM(__pyx_t_53, 1, __pyx_t_52);
13927  __pyx_t_46 = 0;
13928  __pyx_t_52 = 0;
13929 
13930  /* "mprans/cMoveMeshMonitor.pyx":753
13931  * fixed_dir[1],
13932  * fixed_dir[2]]],
13933  * axis=0) # <<<<<<<<<<<<<<
13934  * nPending_disp_total = comm.allreduce(nPending_disp)
13935  *
13936  */
13937  __pyx_t_52 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 753, __pyx_L1_error)
13938  __Pyx_GOTREF(__pyx_t_52);
13939  if (PyDict_SetItem(__pyx_t_52, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
13940 
13941  /* "mprans/cMoveMeshMonitor.pyx":737
13942  * dphi[ndi] = v_grad[ndi]/(t*1./(f*Ccoeff)+(1-t)*1./area)
13943  * coords[ndi] += dphi[ndi]*fixed_dir[ndi]*dt
13944  * coords_2rank[new_rank] = np.append(coords_2rank[new_rank], # <<<<<<<<<<<<<<
13945  * [[coords[0],
13946  * coords[1],
13947  */
13948  __pyx_t_46 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_53, __pyx_t_52); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 737, __pyx_L1_error)
13949  __Pyx_GOTREF(__pyx_t_46);
13950  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13951  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
13952  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
13953  __pyx_t_52 = __Pyx_PyInt_From_int(__pyx_v_new_rank); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 737, __pyx_L1_error)
13954  __Pyx_GOTREF(__pyx_t_52);
13955  if (unlikely(PyDict_SetItem(__pyx_v_coords_2rank, __pyx_t_52, __pyx_t_46) < 0)) __PYX_ERR(0, 737, __pyx_L1_error)
13956  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
13957  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
13958  }
13959 
13960  /* "mprans/cMoveMeshMonitor.pyx":754
13961  * fixed_dir[2]]],
13962  * axis=0)
13963  * nPending_disp_total = comm.allreduce(nPending_disp) # <<<<<<<<<<<<<<
13964  *
13965  * comm.barrier()
13966  */
13967  __pyx_t_52 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_allreduce); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 754, __pyx_L1_error)
13968  __Pyx_GOTREF(__pyx_t_52);
13969  __pyx_t_53 = __Pyx_PyInt_From_int(__pyx_v_nPending_disp); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 754, __pyx_L1_error)
13970  __Pyx_GOTREF(__pyx_t_53);
13971  __pyx_t_7 = NULL;
13972  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_52))) {
13973  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_52);
13974  if (likely(__pyx_t_7)) {
13975  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_52);
13976  __Pyx_INCREF(__pyx_t_7);
13977  __Pyx_INCREF(function);
13978  __Pyx_DECREF_SET(__pyx_t_52, function);
13979  }
13980  }
13981  __pyx_t_46 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_52, __pyx_t_7, __pyx_t_53) : __Pyx_PyObject_CallOneArg(__pyx_t_52, __pyx_t_53);
13982  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13983  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
13984  if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 754, __pyx_L1_error)
13985  __Pyx_GOTREF(__pyx_t_46);
13986  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
13987  __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_t_46); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 754, __pyx_L1_error)
13988  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
13989  __pyx_v_nPending_disp_total = __pyx_t_22;
13990  }
13991 
13992  /* "mprans/cMoveMeshMonitor.pyx":560
13993  * # parallel comm
13994  * comm.barrier()
13995  * if comm_size > 1: # <<<<<<<<<<<<<<
13996  * # number of pending solutions to send to other processors
13997  * nPending_disp_total = comm.allreduce(nPending_disp)
13998  */
13999  }
14000  }
14001 
14002  /* "mprans/cMoveMeshMonitor.pyx":756
14003  * nPending_disp_total = comm.allreduce(nPending_disp)
14004  *
14005  * comm.barrier() # <<<<<<<<<<<<<<
14006  * # SEND NODES POSITION SOLUTION BACK TO ORIGINAL PROCESSORS
14007  * if sendBack is True:
14008  */
14009  __pyx_t_52 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 756, __pyx_L1_error)
14010  __Pyx_GOTREF(__pyx_t_52);
14011  __pyx_t_53 = NULL;
14012  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_52))) {
14013  __pyx_t_53 = PyMethod_GET_SELF(__pyx_t_52);
14014  if (likely(__pyx_t_53)) {
14015  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_52);
14016  __Pyx_INCREF(__pyx_t_53);
14017  __Pyx_INCREF(function);
14018  __Pyx_DECREF_SET(__pyx_t_52, function);
14019  }
14020  }
14021  __pyx_t_46 = (__pyx_t_53) ? __Pyx_PyObject_CallOneArg(__pyx_t_52, __pyx_t_53) : __Pyx_PyObject_CallNoArg(__pyx_t_52);
14022  __Pyx_XDECREF(__pyx_t_53); __pyx_t_53 = 0;
14023  if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 756, __pyx_L1_error)
14024  __Pyx_GOTREF(__pyx_t_46);
14025  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14026  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14027 
14028  /* "mprans/cMoveMeshMonitor.pyx":758
14029  * comm.barrier()
14030  * # SEND NODES POSITION SOLUTION BACK TO ORIGINAL PROCESSORS
14031  * if sendBack is True: # <<<<<<<<<<<<<<
14032  * coords_2doArray = coords_2rank[my_rank]
14033  * for rank in range(comm.size):
14034  */
14035  __pyx_t_19 = ((__pyx_v_sendBack == 1) != 0);
14036  if (__pyx_t_19) {
14037 
14038  /* "mprans/cMoveMeshMonitor.pyx":759
14039  * # SEND NODES POSITION SOLUTION BACK TO ORIGINAL PROCESSORS
14040  * if sendBack is True:
14041  * coords_2doArray = coords_2rank[my_rank] # <<<<<<<<<<<<<<
14042  * for rank in range(comm.size):
14043  * # things to send to other processors to get solution
14044  */
14045  __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_my_rank); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 759, __pyx_L1_error)
14046  __Pyx_GOTREF(__pyx_t_46);
14047  __pyx_t_52 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_46); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 759, __pyx_L1_error)
14048  __Pyx_GOTREF(__pyx_t_52);
14049  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14050  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_52, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 759, __pyx_L1_error)
14051  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14052  __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_coords_2doArray, 1);
14053  __pyx_cur_scope->__pyx_v_coords_2doArray = __pyx_t_13;
14054  __pyx_t_13.memview = NULL;
14055  __pyx_t_13.data = NULL;
14056 
14057  /* "mprans/cMoveMeshMonitor.pyx":760
14058  * if sendBack is True:
14059  * coords_2doArray = coords_2rank[my_rank]
14060  * for rank in range(comm.size): # <<<<<<<<<<<<<<
14061  * # things to send to other processors to get solution
14062  * coords_2rank[rank] = np.zeros((0, 15))
14063  */
14064  __pyx_t_52 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_size); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 760, __pyx_L1_error)
14065  __Pyx_GOTREF(__pyx_t_52);
14066  __pyx_t_46 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_52); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 760, __pyx_L1_error)
14067  __Pyx_GOTREF(__pyx_t_46);
14068  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14069  if (likely(PyList_CheckExact(__pyx_t_46)) || PyTuple_CheckExact(__pyx_t_46)) {
14070  __pyx_t_52 = __pyx_t_46; __Pyx_INCREF(__pyx_t_52); __pyx_t_15 = 0;
14071  __pyx_t_16 = NULL;
14072  } else {
14073  __pyx_t_15 = -1; __pyx_t_52 = PyObject_GetIter(__pyx_t_46); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 760, __pyx_L1_error)
14074  __Pyx_GOTREF(__pyx_t_52);
14075  __pyx_t_16 = Py_TYPE(__pyx_t_52)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 760, __pyx_L1_error)
14076  }
14077  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14078  for (;;) {
14079  if (likely(!__pyx_t_16)) {
14080  if (likely(PyList_CheckExact(__pyx_t_52))) {
14081  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_52)) break;
14082  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14083  __pyx_t_46 = PyList_GET_ITEM(__pyx_t_52, __pyx_t_15); __Pyx_INCREF(__pyx_t_46); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 760, __pyx_L1_error)
14084  #else
14085  __pyx_t_46 = PySequence_ITEM(__pyx_t_52, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 760, __pyx_L1_error)
14086  __Pyx_GOTREF(__pyx_t_46);
14087  #endif
14088  } else {
14089  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_52)) break;
14090  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14091  __pyx_t_46 = PyTuple_GET_ITEM(__pyx_t_52, __pyx_t_15); __Pyx_INCREF(__pyx_t_46); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 760, __pyx_L1_error)
14092  #else
14093  __pyx_t_46 = PySequence_ITEM(__pyx_t_52, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 760, __pyx_L1_error)
14094  __Pyx_GOTREF(__pyx_t_46);
14095  #endif
14096  }
14097  } else {
14098  __pyx_t_46 = __pyx_t_16(__pyx_t_52);
14099  if (unlikely(!__pyx_t_46)) {
14100  PyObject* exc_type = PyErr_Occurred();
14101  if (exc_type) {
14102  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14103  else __PYX_ERR(0, 760, __pyx_L1_error)
14104  }
14105  break;
14106  }
14107  __Pyx_GOTREF(__pyx_t_46);
14108  }
14109  __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_46);
14110  __pyx_t_46 = 0;
14111 
14112  /* "mprans/cMoveMeshMonitor.pyx":762
14113  * for rank in range(comm.size):
14114  * # things to send to other processors to get solution
14115  * coords_2rank[rank] = np.zeros((0, 15)) # <<<<<<<<<<<<<<
14116  * nNodes = len(coords_2doArray)
14117  * for iN in range(nNodes):
14118  */
14119  __Pyx_GetModuleGlobalName(__pyx_t_53, __pyx_n_s_np); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 762, __pyx_L1_error)
14120  __Pyx_GOTREF(__pyx_t_53);
14121  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_53, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 762, __pyx_L1_error)
14122  __Pyx_GOTREF(__pyx_t_7);
14123  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14124  __pyx_t_53 = NULL;
14125  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
14126  __pyx_t_53 = PyMethod_GET_SELF(__pyx_t_7);
14127  if (likely(__pyx_t_53)) {
14128  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
14129  __Pyx_INCREF(__pyx_t_53);
14130  __Pyx_INCREF(function);
14131  __Pyx_DECREF_SET(__pyx_t_7, function);
14132  }
14133  }
14134  __pyx_t_46 = (__pyx_t_53) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_53, __pyx_tuple__5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_tuple__5);
14135  __Pyx_XDECREF(__pyx_t_53); __pyx_t_53 = 0;
14136  if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 762, __pyx_L1_error)
14137  __Pyx_GOTREF(__pyx_t_46);
14138  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14139  if (unlikely(PyDict_SetItem(__pyx_v_coords_2rank, __pyx_v_rank, __pyx_t_46) < 0)) __PYX_ERR(0, 762, __pyx_L1_error)
14140  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14141 
14142  /* "mprans/cMoveMeshMonitor.pyx":760
14143  * if sendBack is True:
14144  * coords_2doArray = coords_2rank[my_rank]
14145  * for rank in range(comm.size): # <<<<<<<<<<<<<<
14146  * # things to send to other processors to get solution
14147  * coords_2rank[rank] = np.zeros((0, 15))
14148  */
14149  }
14150  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14151 
14152  /* "mprans/cMoveMeshMonitor.pyx":763
14153  * # things to send to other processors to get solution
14154  * coords_2rank[rank] = np.zeros((0, 15))
14155  * nNodes = len(coords_2doArray) # <<<<<<<<<<<<<<
14156  * for iN in range(nNodes):
14157  * rank0 = coords_2doArray[iN, 11]
14158  */
14159  __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_cur_scope->__pyx_v_coords_2doArray);
14160  __pyx_v_nNodes = __pyx_t_10;
14161 
14162  /* "mprans/cMoveMeshMonitor.pyx":764
14163  * coords_2rank[rank] = np.zeros((0, 15))
14164  * nNodes = len(coords_2doArray)
14165  * for iN in range(nNodes): # <<<<<<<<<<<<<<
14166  * rank0 = coords_2doArray[iN, 11]
14167  * coords_2rank[rank0] = np.append(coords_2rank[rank0], [coords_2doArray[iN]], axis=0)
14168  */
14169  __pyx_t_2 = __pyx_v_nNodes;
14170  __pyx_t_20 = __pyx_t_2;
14171  for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
14172  __pyx_v_iN = __pyx_t_21;
14173 
14174  /* "mprans/cMoveMeshMonitor.pyx":765
14175  * nNodes = len(coords_2doArray)
14176  * for iN in range(nNodes):
14177  * rank0 = coords_2doArray[iN, 11] # <<<<<<<<<<<<<<
14178  * coords_2rank[rank0] = np.append(coords_2rank[rank0], [coords_2doArray[iN]], axis=0)
14179  * # gather counts info from all processors
14180  */
14181  __pyx_t_26 = __pyx_v_iN;
14182  __pyx_t_17 = 11;
14183  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
14184  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
14185  __pyx_t_52 = PyFloat_FromDouble((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_26 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_17 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )))); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 765, __pyx_L1_error)
14186  __Pyx_GOTREF(__pyx_t_52);
14187  __Pyx_XDECREF_SET(__pyx_v_rank0, __pyx_t_52);
14188  __pyx_t_52 = 0;
14189 
14190  /* "mprans/cMoveMeshMonitor.pyx":766
14191  * for iN in range(nNodes):
14192  * rank0 = coords_2doArray[iN, 11]
14193  * coords_2rank[rank0] = np.append(coords_2rank[rank0], [coords_2doArray[iN]], axis=0) # <<<<<<<<<<<<<<
14194  * # gather counts info from all processors
14195  * for rank in range(comm_size):
14196  */
14197  __Pyx_GetModuleGlobalName(__pyx_t_52, __pyx_n_s_np); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 766, __pyx_L1_error)
14198  __Pyx_GOTREF(__pyx_t_52);
14199  __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_t_52, __pyx_n_s_append); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 766, __pyx_L1_error)
14200  __Pyx_GOTREF(__pyx_t_46);
14201  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14202  __pyx_t_52 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_v_rank0); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 766, __pyx_L1_error)
14203  __Pyx_GOTREF(__pyx_t_52);
14204  __pyx_t_9.data = __pyx_cur_scope->__pyx_v_coords_2doArray.data;
14205  __pyx_t_9.memview = __pyx_cur_scope->__pyx_v_coords_2doArray.memview;
14206  __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
14207  {
14208  Py_ssize_t __pyx_tmp_idx = __pyx_v_iN;
14209  Py_ssize_t __pyx_tmp_shape = __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
14210  Py_ssize_t __pyx_tmp_stride = __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0];
14211  if (__pyx_tmp_idx < 0)
14212  __pyx_tmp_idx += __pyx_tmp_shape;
14213  __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
14214 }
14215 
14216 __pyx_t_9.shape[0] = __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
14217 __pyx_t_9.strides[0] = __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1];
14218  __pyx_t_9.suboffsets[0] = -1;
14219 
14220 __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_t_9, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 766, __pyx_L1_error)
14221  __Pyx_GOTREF(__pyx_t_7);
14222  __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
14223  __pyx_t_9.memview = NULL;
14224  __pyx_t_9.data = NULL;
14225  __pyx_t_53 = PyList_New(1); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 766, __pyx_L1_error)
14226  __Pyx_GOTREF(__pyx_t_53);
14227  __Pyx_GIVEREF(__pyx_t_7);
14228  PyList_SET_ITEM(__pyx_t_53, 0, __pyx_t_7);
14229  __pyx_t_7 = 0;
14230  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 766, __pyx_L1_error)
14231  __Pyx_GOTREF(__pyx_t_7);
14232  __Pyx_GIVEREF(__pyx_t_52);
14233  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_52);
14234  __Pyx_GIVEREF(__pyx_t_53);
14235  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_53);
14236  __pyx_t_52 = 0;
14237  __pyx_t_53 = 0;
14238  __pyx_t_53 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 766, __pyx_L1_error)
14239  __Pyx_GOTREF(__pyx_t_53);
14240  if (PyDict_SetItem(__pyx_t_53, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 766, __pyx_L1_error)
14241  __pyx_t_52 = __Pyx_PyObject_Call(__pyx_t_46, __pyx_t_7, __pyx_t_53); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 766, __pyx_L1_error)
14242  __Pyx_GOTREF(__pyx_t_52);
14243  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14244  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14245  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14246  if (unlikely(PyDict_SetItem(__pyx_v_coords_2rank, __pyx_v_rank0, __pyx_t_52) < 0)) __PYX_ERR(0, 766, __pyx_L1_error)
14247  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14248  }
14249 
14250  /* "mprans/cMoveMeshMonitor.pyx":768
14251  * coords_2rank[rank0] = np.append(coords_2rank[rank0], [coords_2doArray[iN]], axis=0)
14252  * # gather counts info from all processors
14253  * for rank in range(comm_size): # <<<<<<<<<<<<<<
14254  * counts_local[rank] = len(coords_2rank[rank])
14255  * comm.Allgatherv([counts_local, MPI.INT],
14256  */
14257  __pyx_t_52 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 768, __pyx_L1_error)
14258  __Pyx_GOTREF(__pyx_t_52);
14259  __pyx_t_53 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_52); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 768, __pyx_L1_error)
14260  __Pyx_GOTREF(__pyx_t_53);
14261  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14262  if (likely(PyList_CheckExact(__pyx_t_53)) || PyTuple_CheckExact(__pyx_t_53)) {
14263  __pyx_t_52 = __pyx_t_53; __Pyx_INCREF(__pyx_t_52); __pyx_t_15 = 0;
14264  __pyx_t_16 = NULL;
14265  } else {
14266  __pyx_t_15 = -1; __pyx_t_52 = PyObject_GetIter(__pyx_t_53); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 768, __pyx_L1_error)
14267  __Pyx_GOTREF(__pyx_t_52);
14268  __pyx_t_16 = Py_TYPE(__pyx_t_52)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 768, __pyx_L1_error)
14269  }
14270  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14271  for (;;) {
14272  if (likely(!__pyx_t_16)) {
14273  if (likely(PyList_CheckExact(__pyx_t_52))) {
14274  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_52)) break;
14275  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14276  __pyx_t_53 = PyList_GET_ITEM(__pyx_t_52, __pyx_t_15); __Pyx_INCREF(__pyx_t_53); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 768, __pyx_L1_error)
14277  #else
14278  __pyx_t_53 = PySequence_ITEM(__pyx_t_52, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 768, __pyx_L1_error)
14279  __Pyx_GOTREF(__pyx_t_53);
14280  #endif
14281  } else {
14282  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_52)) break;
14283  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14284  __pyx_t_53 = PyTuple_GET_ITEM(__pyx_t_52, __pyx_t_15); __Pyx_INCREF(__pyx_t_53); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 768, __pyx_L1_error)
14285  #else
14286  __pyx_t_53 = PySequence_ITEM(__pyx_t_52, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 768, __pyx_L1_error)
14287  __Pyx_GOTREF(__pyx_t_53);
14288  #endif
14289  }
14290  } else {
14291  __pyx_t_53 = __pyx_t_16(__pyx_t_52);
14292  if (unlikely(!__pyx_t_53)) {
14293  PyObject* exc_type = PyErr_Occurred();
14294  if (exc_type) {
14295  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14296  else __PYX_ERR(0, 768, __pyx_L1_error)
14297  }
14298  break;
14299  }
14300  __Pyx_GOTREF(__pyx_t_53);
14301  }
14302  __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_53);
14303  __pyx_t_53 = 0;
14304 
14305  /* "mprans/cMoveMeshMonitor.pyx":769
14306  * # gather counts info from all processors
14307  * for rank in range(comm_size):
14308  * counts_local[rank] = len(coords_2rank[rank]) # <<<<<<<<<<<<<<
14309  * comm.Allgatherv([counts_local, MPI.INT],
14310  * [counts_total,
14311  */
14312  __pyx_t_53 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_v_rank); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 769, __pyx_L1_error)
14313  __Pyx_GOTREF(__pyx_t_53);
14314  __pyx_t_48 = PyObject_Length(__pyx_t_53); if (unlikely(__pyx_t_48 == ((Py_ssize_t)-1))) __PYX_ERR(0, 769, __pyx_L1_error)
14315  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14316  __pyx_t_41 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank); if (unlikely((__pyx_t_41 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 769, __pyx_L1_error)
14317  __pyx_t_17 = __pyx_t_41;
14318  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_counts_local.shape[0];
14319  *((int *) ( /* dim=0 */ (__pyx_v_counts_local.data + __pyx_t_17 * __pyx_v_counts_local.strides[0]) )) = __pyx_t_48;
14320 
14321  /* "mprans/cMoveMeshMonitor.pyx":768
14322  * coords_2rank[rank0] = np.append(coords_2rank[rank0], [coords_2doArray[iN]], axis=0)
14323  * # gather counts info from all processors
14324  * for rank in range(comm_size): # <<<<<<<<<<<<<<
14325  * counts_local[rank] = len(coords_2rank[rank])
14326  * comm.Allgatherv([counts_local, MPI.INT],
14327  */
14328  }
14329  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14330 
14331  /* "mprans/cMoveMeshMonitor.pyx":770
14332  * for rank in range(comm_size):
14333  * counts_local[rank] = len(coords_2rank[rank])
14334  * comm.Allgatherv([counts_local, MPI.INT], # <<<<<<<<<<<<<<
14335  * [counts_total,
14336  * [comm_size for i in range(comm_size)],
14337  */
14338  __pyx_t_53 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_Allgatherv); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 770, __pyx_L1_error)
14339  __Pyx_GOTREF(__pyx_t_53);
14340  __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_counts_local, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 770, __pyx_L1_error)
14341  __Pyx_GOTREF(__pyx_t_7);
14342  __Pyx_GetModuleGlobalName(__pyx_t_46, __pyx_n_s_MPI); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 770, __pyx_L1_error)
14343  __Pyx_GOTREF(__pyx_t_46);
14344  __pyx_t_51 = __Pyx_PyObject_GetAttrStr(__pyx_t_46, __pyx_n_s_INT); if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 770, __pyx_L1_error)
14345  __Pyx_GOTREF(__pyx_t_51);
14346  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14347  __pyx_t_46 = PyList_New(2); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 770, __pyx_L1_error)
14348  __Pyx_GOTREF(__pyx_t_46);
14349  __Pyx_GIVEREF(__pyx_t_7);
14350  PyList_SET_ITEM(__pyx_t_46, 0, __pyx_t_7);
14351  __Pyx_GIVEREF(__pyx_t_51);
14352  PyList_SET_ITEM(__pyx_t_46, 1, __pyx_t_51);
14353  __pyx_t_7 = 0;
14354  __pyx_t_51 = 0;
14355 
14356  /* "mprans/cMoveMeshMonitor.pyx":771
14357  * counts_local[rank] = len(coords_2rank[rank])
14358  * comm.Allgatherv([counts_local, MPI.INT],
14359  * [counts_total, # <<<<<<<<<<<<<<
14360  * [comm_size for i in range(comm_size)],
14361  * [comm_size*i for i in range(comm_size)],
14362  */
14363  __pyx_t_51 = __pyx_memoryview_fromslice(__pyx_v_counts_total, 2, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 771, __pyx_L1_error)
14364  __Pyx_GOTREF(__pyx_t_51);
14365 
14366  /* "mprans/cMoveMeshMonitor.pyx":772
14367  * comm.Allgatherv([counts_local, MPI.INT],
14368  * [counts_total,
14369  * [comm_size for i in range(comm_size)], # <<<<<<<<<<<<<<
14370  * [comm_size*i for i in range(comm_size)],
14371  * MPI.INT])
14372  */
14373  __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 772, __pyx_L1_error)
14374  __Pyx_GOTREF(__pyx_t_7);
14375  __pyx_t_2 = __pyx_cur_scope->__pyx_v_comm_size;
14376  __pyx_t_20 = __pyx_t_2;
14377  for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
14378  __pyx_v_i = __pyx_t_21;
14379  __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 772, __pyx_L1_error)
14380  __Pyx_GOTREF(__pyx_t_50);
14381  if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_50))) __PYX_ERR(0, 772, __pyx_L1_error)
14382  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14383  }
14384 
14385  /* "mprans/cMoveMeshMonitor.pyx":773
14386  * [counts_total,
14387  * [comm_size for i in range(comm_size)],
14388  * [comm_size*i for i in range(comm_size)], # <<<<<<<<<<<<<<
14389  * MPI.INT])
14390  * # calculate array_size for current rank
14391  */
14392  __pyx_t_50 = PyList_New(0); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 773, __pyx_L1_error)
14393  __Pyx_GOTREF(__pyx_t_50);
14394  __pyx_t_2 = __pyx_cur_scope->__pyx_v_comm_size;
14395  __pyx_t_20 = __pyx_t_2;
14396  for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
14397  __pyx_v_i = __pyx_t_21;
14398  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_cur_scope->__pyx_v_comm_size * __pyx_v_i)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error)
14399  __Pyx_GOTREF(__pyx_t_3);
14400  if (unlikely(__Pyx_ListComp_Append(__pyx_t_50, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 773, __pyx_L1_error)
14401  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14402  }
14403 
14404  /* "mprans/cMoveMeshMonitor.pyx":774
14405  * [comm_size for i in range(comm_size)],
14406  * [comm_size*i for i in range(comm_size)],
14407  * MPI.INT]) # <<<<<<<<<<<<<<
14408  * # calculate array_size for current rank
14409  * for rank_recv in range(comm_size):
14410  */
14411  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MPI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error)
14412  __Pyx_GOTREF(__pyx_t_3);
14413  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_INT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error)
14414  __Pyx_GOTREF(__pyx_t_1);
14415  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14416 
14417  /* "mprans/cMoveMeshMonitor.pyx":771
14418  * counts_local[rank] = len(coords_2rank[rank])
14419  * comm.Allgatherv([counts_local, MPI.INT],
14420  * [counts_total, # <<<<<<<<<<<<<<
14421  * [comm_size for i in range(comm_size)],
14422  * [comm_size*i for i in range(comm_size)],
14423  */
14424  __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __pyx_L1_error)
14425  __Pyx_GOTREF(__pyx_t_3);
14426  __Pyx_GIVEREF(__pyx_t_51);
14427  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_51);
14428  __Pyx_GIVEREF(__pyx_t_7);
14429  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
14430  __Pyx_GIVEREF(__pyx_t_50);
14431  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_50);
14432  __Pyx_GIVEREF(__pyx_t_1);
14433  PyList_SET_ITEM(__pyx_t_3, 3, __pyx_t_1);
14434  __pyx_t_51 = 0;
14435  __pyx_t_7 = 0;
14436  __pyx_t_50 = 0;
14437  __pyx_t_1 = 0;
14438  __pyx_t_1 = NULL;
14439  __pyx_t_2 = 0;
14440  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_53))) {
14441  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_53);
14442  if (likely(__pyx_t_1)) {
14443  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_53);
14444  __Pyx_INCREF(__pyx_t_1);
14445  __Pyx_INCREF(function);
14446  __Pyx_DECREF_SET(__pyx_t_53, function);
14447  __pyx_t_2 = 1;
14448  }
14449  }
14450  #if CYTHON_FAST_PYCALL
14451  if (PyFunction_Check(__pyx_t_53)) {
14452  PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_46, __pyx_t_3};
14453  __pyx_t_52 = __Pyx_PyFunction_FastCall(__pyx_t_53, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 770, __pyx_L1_error)
14454  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14455  __Pyx_GOTREF(__pyx_t_52);
14456  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14457  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14458  } else
14459  #endif
14460  #if CYTHON_FAST_PYCCALL
14461  if (__Pyx_PyFastCFunction_Check(__pyx_t_53)) {
14462  PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_46, __pyx_t_3};
14463  __pyx_t_52 = __Pyx_PyCFunction_FastCall(__pyx_t_53, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 770, __pyx_L1_error)
14464  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14465  __Pyx_GOTREF(__pyx_t_52);
14466  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
14467  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14468  } else
14469  #endif
14470  {
14471  __pyx_t_50 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 770, __pyx_L1_error)
14472  __Pyx_GOTREF(__pyx_t_50);
14473  if (__pyx_t_1) {
14474  __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_50, 0, __pyx_t_1); __pyx_t_1 = NULL;
14475  }
14476  __Pyx_GIVEREF(__pyx_t_46);
14477  PyTuple_SET_ITEM(__pyx_t_50, 0+__pyx_t_2, __pyx_t_46);
14478  __Pyx_GIVEREF(__pyx_t_3);
14479  PyTuple_SET_ITEM(__pyx_t_50, 1+__pyx_t_2, __pyx_t_3);
14480  __pyx_t_46 = 0;
14481  __pyx_t_3 = 0;
14482  __pyx_t_52 = __Pyx_PyObject_Call(__pyx_t_53, __pyx_t_50, NULL); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 770, __pyx_L1_error)
14483  __Pyx_GOTREF(__pyx_t_52);
14484  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14485  }
14486  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14487  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14488 
14489  /* "mprans/cMoveMeshMonitor.pyx":776
14490  * MPI.INT])
14491  * # calculate array_size for current rank
14492  * for rank_recv in range(comm_size): # <<<<<<<<<<<<<<
14493  * array_size = 0
14494  * for rank in range(comm_size):
14495  */
14496  __pyx_t_2 = __pyx_cur_scope->__pyx_v_comm_size;
14497  __pyx_t_20 = __pyx_t_2;
14498  for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
14499  __pyx_v_rank_recv = __pyx_t_21;
14500 
14501  /* "mprans/cMoveMeshMonitor.pyx":777
14502  * # calculate array_size for current rank
14503  * for rank_recv in range(comm_size):
14504  * array_size = 0 # <<<<<<<<<<<<<<
14505  * for rank in range(comm_size):
14506  * array_size += counts_total[rank, rank_recv]
14507  */
14508  __Pyx_INCREF(__pyx_int_0);
14509  __Pyx_XDECREF_SET(__pyx_v_array_size, __pyx_int_0);
14510 
14511  /* "mprans/cMoveMeshMonitor.pyx":778
14512  * for rank_recv in range(comm_size):
14513  * array_size = 0
14514  * for rank in range(comm_size): # <<<<<<<<<<<<<<
14515  * array_size += counts_total[rank, rank_recv]
14516  * counts_in[rank] = counts_total[rank, rank_recv]
14517  */
14518  __pyx_t_52 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_comm_size); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 778, __pyx_L1_error)
14519  __Pyx_GOTREF(__pyx_t_52);
14520  __pyx_t_53 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_52); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 778, __pyx_L1_error)
14521  __Pyx_GOTREF(__pyx_t_53);
14522  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14523  if (likely(PyList_CheckExact(__pyx_t_53)) || PyTuple_CheckExact(__pyx_t_53)) {
14524  __pyx_t_52 = __pyx_t_53; __Pyx_INCREF(__pyx_t_52); __pyx_t_15 = 0;
14525  __pyx_t_16 = NULL;
14526  } else {
14527  __pyx_t_15 = -1; __pyx_t_52 = PyObject_GetIter(__pyx_t_53); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 778, __pyx_L1_error)
14528  __Pyx_GOTREF(__pyx_t_52);
14529  __pyx_t_16 = Py_TYPE(__pyx_t_52)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 778, __pyx_L1_error)
14530  }
14531  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14532  for (;;) {
14533  if (likely(!__pyx_t_16)) {
14534  if (likely(PyList_CheckExact(__pyx_t_52))) {
14535  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_52)) break;
14536  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14537  __pyx_t_53 = PyList_GET_ITEM(__pyx_t_52, __pyx_t_15); __Pyx_INCREF(__pyx_t_53); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 778, __pyx_L1_error)
14538  #else
14539  __pyx_t_53 = PySequence_ITEM(__pyx_t_52, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 778, __pyx_L1_error)
14540  __Pyx_GOTREF(__pyx_t_53);
14541  #endif
14542  } else {
14543  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_52)) break;
14544  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14545  __pyx_t_53 = PyTuple_GET_ITEM(__pyx_t_52, __pyx_t_15); __Pyx_INCREF(__pyx_t_53); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 778, __pyx_L1_error)
14546  #else
14547  __pyx_t_53 = PySequence_ITEM(__pyx_t_52, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 778, __pyx_L1_error)
14548  __Pyx_GOTREF(__pyx_t_53);
14549  #endif
14550  }
14551  } else {
14552  __pyx_t_53 = __pyx_t_16(__pyx_t_52);
14553  if (unlikely(!__pyx_t_53)) {
14554  PyObject* exc_type = PyErr_Occurred();
14555  if (exc_type) {
14556  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14557  else __PYX_ERR(0, 778, __pyx_L1_error)
14558  }
14559  break;
14560  }
14561  __Pyx_GOTREF(__pyx_t_53);
14562  }
14563  __Pyx_XDECREF_SET(__pyx_v_rank, __pyx_t_53);
14564  __pyx_t_53 = 0;
14565 
14566  /* "mprans/cMoveMeshMonitor.pyx":779
14567  * array_size = 0
14568  * for rank in range(comm_size):
14569  * array_size += counts_total[rank, rank_recv] # <<<<<<<<<<<<<<
14570  * counts_in[rank] = counts_total[rank, rank_recv]
14571  * if rank > 0:
14572  */
14573  __pyx_t_48 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank); if (unlikely((__pyx_t_48 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 779, __pyx_L1_error)
14574  __pyx_t_17 = __pyx_t_48;
14575  __pyx_t_26 = __pyx_v_rank_recv;
14576  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_counts_total.shape[0];
14577  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_counts_total.shape[1];
14578  __pyx_t_53 = __Pyx_PyInt_From_int((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_counts_total.data + __pyx_t_17 * __pyx_v_counts_total.strides[0]) ) + __pyx_t_26 * __pyx_v_counts_total.strides[1]) )))); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 779, __pyx_L1_error)
14579  __Pyx_GOTREF(__pyx_t_53);
14580  __pyx_t_50 = PyNumber_InPlaceAdd(__pyx_v_array_size, __pyx_t_53); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 779, __pyx_L1_error)
14581  __Pyx_GOTREF(__pyx_t_50);
14582  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14583  __Pyx_DECREF_SET(__pyx_v_array_size, __pyx_t_50);
14584  __pyx_t_50 = 0;
14585 
14586  /* "mprans/cMoveMeshMonitor.pyx":780
14587  * for rank in range(comm_size):
14588  * array_size += counts_total[rank, rank_recv]
14589  * counts_in[rank] = counts_total[rank, rank_recv] # <<<<<<<<<<<<<<
14590  * if rank > 0:
14591  * displacements_in[rank] = displacements_in[rank-1]+counts_in[rank-1]
14592  */
14593  __pyx_t_48 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank); if (unlikely((__pyx_t_48 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L1_error)
14594  __pyx_t_26 = __pyx_t_48;
14595  __pyx_t_17 = __pyx_v_rank_recv;
14596  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_counts_total.shape[0];
14597  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_counts_total.shape[1];
14598  __pyx_t_41 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank); if (unlikely((__pyx_t_41 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L1_error)
14599  __pyx_t_31 = __pyx_t_41;
14600  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_cur_scope->__pyx_v_counts_in.shape[0];
14601  *((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_counts_in.data + __pyx_t_31 * __pyx_cur_scope->__pyx_v_counts_in.strides[0]) )) = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_counts_total.data + __pyx_t_26 * __pyx_v_counts_total.strides[0]) ) + __pyx_t_17 * __pyx_v_counts_total.strides[1]) )));
14602 
14603  /* "mprans/cMoveMeshMonitor.pyx":781
14604  * array_size += counts_total[rank, rank_recv]
14605  * counts_in[rank] = counts_total[rank, rank_recv]
14606  * if rank > 0: # <<<<<<<<<<<<<<
14607  * displacements_in[rank] = displacements_in[rank-1]+counts_in[rank-1]
14608  * # check if another parallel comm is needed
14609  */
14610  __pyx_t_50 = PyObject_RichCompare(__pyx_v_rank, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_50); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 781, __pyx_L1_error)
14611  __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_50); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 781, __pyx_L1_error)
14612  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14613  if (__pyx_t_19) {
14614 
14615  /* "mprans/cMoveMeshMonitor.pyx":782
14616  * counts_in[rank] = counts_total[rank, rank_recv]
14617  * if rank > 0:
14618  * displacements_in[rank] = displacements_in[rank-1]+counts_in[rank-1] # <<<<<<<<<<<<<<
14619  * # check if another parallel comm is needed
14620  * if array_size-counts_total[rank_recv, rank_recv] > 0:
14621  */
14622  __pyx_t_50 = __Pyx_PyInt_SubtractObjC(__pyx_v_rank, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 782, __pyx_L1_error)
14623  __Pyx_GOTREF(__pyx_t_50);
14624  __pyx_t_48 = __Pyx_PyIndex_AsSsize_t(__pyx_t_50); if (unlikely((__pyx_t_48 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 782, __pyx_L1_error)
14625  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14626  __pyx_t_17 = __pyx_t_48;
14627  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_cur_scope->__pyx_v_displacements_in.shape[0];
14628  __pyx_t_50 = __Pyx_PyInt_SubtractObjC(__pyx_v_rank, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 782, __pyx_L1_error)
14629  __Pyx_GOTREF(__pyx_t_50);
14630  __pyx_t_41 = __Pyx_PyIndex_AsSsize_t(__pyx_t_50); if (unlikely((__pyx_t_41 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 782, __pyx_L1_error)
14631  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14632  __pyx_t_26 = __pyx_t_41;
14633  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_cur_scope->__pyx_v_counts_in.shape[0];
14634  __pyx_t_49 = __Pyx_PyIndex_AsSsize_t(__pyx_v_rank); if (unlikely((__pyx_t_49 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 782, __pyx_L1_error)
14635  __pyx_t_31 = __pyx_t_49;
14636  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_cur_scope->__pyx_v_displacements_in.shape[0];
14637  *((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_displacements_in.data + __pyx_t_31 * __pyx_cur_scope->__pyx_v_displacements_in.strides[0]) )) = ((*((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_displacements_in.data + __pyx_t_17 * __pyx_cur_scope->__pyx_v_displacements_in.strides[0]) ))) + (*((int *) ( /* dim=0 */ (__pyx_cur_scope->__pyx_v_counts_in.data + __pyx_t_26 * __pyx_cur_scope->__pyx_v_counts_in.strides[0]) ))));
14638 
14639  /* "mprans/cMoveMeshMonitor.pyx":781
14640  * array_size += counts_total[rank, rank_recv]
14641  * counts_in[rank] = counts_total[rank, rank_recv]
14642  * if rank > 0: # <<<<<<<<<<<<<<
14643  * displacements_in[rank] = displacements_in[rank-1]+counts_in[rank-1]
14644  * # check if another parallel comm is needed
14645  */
14646  }
14647 
14648  /* "mprans/cMoveMeshMonitor.pyx":778
14649  * for rank_recv in range(comm_size):
14650  * array_size = 0
14651  * for rank in range(comm_size): # <<<<<<<<<<<<<<
14652  * array_size += counts_total[rank, rank_recv]
14653  * counts_in[rank] = counts_total[rank, rank_recv]
14654  */
14655  }
14656  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14657 
14658  /* "mprans/cMoveMeshMonitor.pyx":784
14659  * displacements_in[rank] = displacements_in[rank-1]+counts_in[rank-1]
14660  * # check if another parallel comm is needed
14661  * if array_size-counts_total[rank_recv, rank_recv] > 0: # <<<<<<<<<<<<<<
14662  * if my_rank == rank_recv:
14663  * # initialise coords_2doArray only on receiving processor
14664  */
14665  __pyx_t_26 = __pyx_v_rank_recv;
14666  __pyx_t_17 = __pyx_v_rank_recv;
14667  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_counts_total.shape[0];
14668  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_counts_total.shape[1];
14669  __pyx_t_52 = __Pyx_PyInt_From_int((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_counts_total.data + __pyx_t_26 * __pyx_v_counts_total.strides[0]) ) + __pyx_t_17 * __pyx_v_counts_total.strides[1]) )))); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 784, __pyx_L1_error)
14670  __Pyx_GOTREF(__pyx_t_52);
14671  __pyx_t_50 = PyNumber_Subtract(__pyx_v_array_size, __pyx_t_52); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 784, __pyx_L1_error)
14672  __Pyx_GOTREF(__pyx_t_50);
14673  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14674  __pyx_t_52 = PyObject_RichCompare(__pyx_t_50, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_52); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 784, __pyx_L1_error)
14675  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14676  __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_52); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 784, __pyx_L1_error)
14677  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14678  if (__pyx_t_19) {
14679 
14680  /* "mprans/cMoveMeshMonitor.pyx":785
14681  * # check if another parallel comm is needed
14682  * if array_size-counts_total[rank_recv, rank_recv] > 0:
14683  * if my_rank == rank_recv: # <<<<<<<<<<<<<<
14684  * # initialise coords_2doArray only on receiving processor
14685  * coords_2doArray = np.zeros((array_size, 15))
14686  */
14687  __pyx_t_19 = ((__pyx_v_my_rank == __pyx_v_rank_recv) != 0);
14688  if (__pyx_t_19) {
14689 
14690  /* "mprans/cMoveMeshMonitor.pyx":787
14691  * if my_rank == rank_recv:
14692  * # initialise coords_2doArray only on receiving processor
14693  * coords_2doArray = np.zeros((array_size, 15)) # <<<<<<<<<<<<<<
14694  * # -----
14695  * # get the coords_2doArray (nodes where to retrieve values for arg)
14696  */
14697  __Pyx_GetModuleGlobalName(__pyx_t_50, __pyx_n_s_np); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 787, __pyx_L1_error)
14698  __Pyx_GOTREF(__pyx_t_50);
14699  __pyx_t_53 = __Pyx_PyObject_GetAttrStr(__pyx_t_50, __pyx_n_s_zeros); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 787, __pyx_L1_error)
14700  __Pyx_GOTREF(__pyx_t_53);
14701  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14702  __pyx_t_50 = PyTuple_New(2); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 787, __pyx_L1_error)
14703  __Pyx_GOTREF(__pyx_t_50);
14704  __Pyx_INCREF(__pyx_v_array_size);
14705  __Pyx_GIVEREF(__pyx_v_array_size);
14706  PyTuple_SET_ITEM(__pyx_t_50, 0, __pyx_v_array_size);
14707  __Pyx_INCREF(__pyx_int_15);
14708  __Pyx_GIVEREF(__pyx_int_15);
14709  PyTuple_SET_ITEM(__pyx_t_50, 1, __pyx_int_15);
14710  __pyx_t_3 = NULL;
14711  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_53))) {
14712  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_53);
14713  if (likely(__pyx_t_3)) {
14714  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_53);
14715  __Pyx_INCREF(__pyx_t_3);
14716  __Pyx_INCREF(function);
14717  __Pyx_DECREF_SET(__pyx_t_53, function);
14718  }
14719  }
14720  __pyx_t_52 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_53, __pyx_t_3, __pyx_t_50) : __Pyx_PyObject_CallOneArg(__pyx_t_53, __pyx_t_50);
14721  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14722  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14723  if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 787, __pyx_L1_error)
14724  __Pyx_GOTREF(__pyx_t_52);
14725  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14726  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_52, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 787, __pyx_L1_error)
14727  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14728  __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_coords_2doArray, 1);
14729  __pyx_cur_scope->__pyx_v_coords_2doArray = __pyx_t_13;
14730  __pyx_t_13.memview = NULL;
14731  __pyx_t_13.data = NULL;
14732 
14733  /* "mprans/cMoveMeshMonitor.pyx":785
14734  * # check if another parallel comm is needed
14735  * if array_size-counts_total[rank_recv, rank_recv] > 0:
14736  * if my_rank == rank_recv: # <<<<<<<<<<<<<<
14737  * # initialise coords_2doArray only on receiving processor
14738  * coords_2doArray = np.zeros((array_size, 15))
14739  */
14740  }
14741 
14742  /* "mprans/cMoveMeshMonitor.pyx":790
14743  * # -----
14744  * # get the coords_2doArray (nodes where to retrieve values for arg)
14745  * datatype = MPI.DOUBLE.Create_contiguous(15).Commit() # <<<<<<<<<<<<<<
14746  * comm.Gatherv(coords_2rank[rank_recv],
14747  * [coords_2doArray,
14748  */
14749  __Pyx_GetModuleGlobalName(__pyx_t_50, __pyx_n_s_MPI); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 790, __pyx_L1_error)
14750  __Pyx_GOTREF(__pyx_t_50);
14751  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_50, __pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error)
14752  __Pyx_GOTREF(__pyx_t_3);
14753  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14754  __pyx_t_50 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Create_contiguous); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 790, __pyx_L1_error)
14755  __Pyx_GOTREF(__pyx_t_50);
14756  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14757  __pyx_t_3 = NULL;
14758  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_50))) {
14759  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_50);
14760  if (likely(__pyx_t_3)) {
14761  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_50);
14762  __Pyx_INCREF(__pyx_t_3);
14763  __Pyx_INCREF(function);
14764  __Pyx_DECREF_SET(__pyx_t_50, function);
14765  }
14766  }
14767  __pyx_t_53 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_50, __pyx_t_3, __pyx_int_15) : __Pyx_PyObject_CallOneArg(__pyx_t_50, __pyx_int_15);
14768  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14769  if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 790, __pyx_L1_error)
14770  __Pyx_GOTREF(__pyx_t_53);
14771  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14772  __pyx_t_50 = __Pyx_PyObject_GetAttrStr(__pyx_t_53, __pyx_n_s_Commit); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 790, __pyx_L1_error)
14773  __Pyx_GOTREF(__pyx_t_50);
14774  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14775  __pyx_t_53 = NULL;
14776  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_50))) {
14777  __pyx_t_53 = PyMethod_GET_SELF(__pyx_t_50);
14778  if (likely(__pyx_t_53)) {
14779  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_50);
14780  __Pyx_INCREF(__pyx_t_53);
14781  __Pyx_INCREF(function);
14782  __Pyx_DECREF_SET(__pyx_t_50, function);
14783  }
14784  }
14785  __pyx_t_52 = (__pyx_t_53) ? __Pyx_PyObject_CallOneArg(__pyx_t_50, __pyx_t_53) : __Pyx_PyObject_CallNoArg(__pyx_t_50);
14786  __Pyx_XDECREF(__pyx_t_53); __pyx_t_53 = 0;
14787  if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 790, __pyx_L1_error)
14788  __Pyx_GOTREF(__pyx_t_52);
14789  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14790  __Pyx_XDECREF_SET(__pyx_v_datatype, __pyx_t_52);
14791  __pyx_t_52 = 0;
14792 
14793  /* "mprans/cMoveMeshMonitor.pyx":791
14794  * # get the coords_2doArray (nodes where to retrieve values for arg)
14795  * datatype = MPI.DOUBLE.Create_contiguous(15).Commit()
14796  * comm.Gatherv(coords_2rank[rank_recv], # <<<<<<<<<<<<<<
14797  * [coords_2doArray,
14798  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
14799  */
14800  __pyx_t_52 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_Gatherv); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 791, __pyx_L1_error)
14801  __Pyx_GOTREF(__pyx_t_52);
14802  __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_v_rank_recv); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 791, __pyx_L1_error)
14803  __Pyx_GOTREF(__pyx_t_50);
14804  __pyx_t_53 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_50); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 791, __pyx_L1_error)
14805  __Pyx_GOTREF(__pyx_t_53);
14806  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
14807 
14808  /* "mprans/cMoveMeshMonitor.pyx":792
14809  * datatype = MPI.DOUBLE.Create_contiguous(15).Commit()
14810  * comm.Gatherv(coords_2rank[rank_recv],
14811  * [coords_2doArray, # <<<<<<<<<<<<<<
14812  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
14813  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
14814  */
14815  __pyx_t_50 = __pyx_memoryview_fromslice(__pyx_cur_scope->__pyx_v_coords_2doArray, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 792, __pyx_L1_error)
14816  __Pyx_GOTREF(__pyx_t_50);
14817 
14818  /* "mprans/cMoveMeshMonitor.pyx":793
14819  * comm.Gatherv(coords_2rank[rank_recv],
14820  * [coords_2doArray,
14821  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)), # <<<<<<<<<<<<<<
14822  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
14823  * MPI.DOUBLE],
14824  */
14825  __pyx_t_3 = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_6genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error)
14826  __Pyx_GOTREF(__pyx_t_3);
14827  __pyx_t_46 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 793, __pyx_L1_error)
14828  __Pyx_GOTREF(__pyx_t_46);
14829  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14830 
14831  /* "mprans/cMoveMeshMonitor.pyx":794
14832  * [coords_2doArray,
14833  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
14834  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)), # <<<<<<<<<<<<<<
14835  * MPI.DOUBLE],
14836  * root=rank_recv)
14837  */
14838  __pyx_t_3 = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_9genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 794, __pyx_L1_error)
14839  __Pyx_GOTREF(__pyx_t_3);
14840  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error)
14841  __Pyx_GOTREF(__pyx_t_1);
14842  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14843 
14844  /* "mprans/cMoveMeshMonitor.pyx":795
14845  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
14846  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
14847  * MPI.DOUBLE], # <<<<<<<<<<<<<<
14848  * root=rank_recv)
14849  * ncomm += 1
14850  */
14851  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MPI); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 795, __pyx_L1_error)
14852  __Pyx_GOTREF(__pyx_t_3);
14853  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L1_error)
14854  __Pyx_GOTREF(__pyx_t_7);
14855  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14856 
14857  /* "mprans/cMoveMeshMonitor.pyx":792
14858  * datatype = MPI.DOUBLE.Create_contiguous(15).Commit()
14859  * comm.Gatherv(coords_2rank[rank_recv],
14860  * [coords_2doArray, # <<<<<<<<<<<<<<
14861  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
14862  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
14863  */
14864  __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 792, __pyx_L1_error)
14865  __Pyx_GOTREF(__pyx_t_3);
14866  __Pyx_GIVEREF(__pyx_t_50);
14867  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_50);
14868  __Pyx_GIVEREF(__pyx_t_46);
14869  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_46);
14870  __Pyx_GIVEREF(__pyx_t_1);
14871  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
14872  __Pyx_GIVEREF(__pyx_t_7);
14873  PyList_SET_ITEM(__pyx_t_3, 3, __pyx_t_7);
14874  __pyx_t_50 = 0;
14875  __pyx_t_46 = 0;
14876  __pyx_t_1 = 0;
14877  __pyx_t_7 = 0;
14878 
14879  /* "mprans/cMoveMeshMonitor.pyx":791
14880  * # get the coords_2doArray (nodes where to retrieve values for arg)
14881  * datatype = MPI.DOUBLE.Create_contiguous(15).Commit()
14882  * comm.Gatherv(coords_2rank[rank_recv], # <<<<<<<<<<<<<<
14883  * [coords_2doArray,
14884  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
14885  */
14886  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 791, __pyx_L1_error)
14887  __Pyx_GOTREF(__pyx_t_7);
14888  __Pyx_GIVEREF(__pyx_t_53);
14889  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_53);
14890  __Pyx_GIVEREF(__pyx_t_3);
14891  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
14892  __pyx_t_53 = 0;
14893  __pyx_t_3 = 0;
14894 
14895  /* "mprans/cMoveMeshMonitor.pyx":796
14896  * tuple(displacements_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
14897  * MPI.DOUBLE],
14898  * root=rank_recv) # <<<<<<<<<<<<<<
14899  * ncomm += 1
14900  * else:
14901  */
14902  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 796, __pyx_L1_error)
14903  __Pyx_GOTREF(__pyx_t_3);
14904  __pyx_t_53 = __Pyx_PyInt_From_int(__pyx_v_rank_recv); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 796, __pyx_L1_error)
14905  __Pyx_GOTREF(__pyx_t_53);
14906  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_root, __pyx_t_53) < 0) __PYX_ERR(0, 796, __pyx_L1_error)
14907  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14908 
14909  /* "mprans/cMoveMeshMonitor.pyx":791
14910  * # get the coords_2doArray (nodes where to retrieve values for arg)
14911  * datatype = MPI.DOUBLE.Create_contiguous(15).Commit()
14912  * comm.Gatherv(coords_2rank[rank_recv], # <<<<<<<<<<<<<<
14913  * [coords_2doArray,
14914  * tuple(counts_in[i]*coords_2doArray.shape[1] for i in range(comm_size)),
14915  */
14916  __pyx_t_53 = __Pyx_PyObject_Call(__pyx_t_52, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 791, __pyx_L1_error)
14917  __Pyx_GOTREF(__pyx_t_53);
14918  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
14919  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14920  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14921  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14922 
14923  /* "mprans/cMoveMeshMonitor.pyx":797
14924  * MPI.DOUBLE],
14925  * root=rank_recv)
14926  * ncomm += 1 # <<<<<<<<<<<<<<
14927  * else:
14928  * if rank_recv == my_rank:
14929  */
14930  __pyx_v_ncomm = (__pyx_v_ncomm + 1);
14931 
14932  /* "mprans/cMoveMeshMonitor.pyx":784
14933  * displacements_in[rank] = displacements_in[rank-1]+counts_in[rank-1]
14934  * # check if another parallel comm is needed
14935  * if array_size-counts_total[rank_recv, rank_recv] > 0: # <<<<<<<<<<<<<<
14936  * if my_rank == rank_recv:
14937  * # initialise coords_2doArray only on receiving processor
14938  */
14939  goto __pyx_L119;
14940  }
14941 
14942  /* "mprans/cMoveMeshMonitor.pyx":799
14943  * ncomm += 1
14944  * else:
14945  * if rank_recv == my_rank: # <<<<<<<<<<<<<<
14946  * coords_2doArray = coords_2rank[my_rank]
14947  * nNodes = len(coords_2doArray)
14948  */
14949  /*else*/ {
14950  __pyx_t_19 = ((__pyx_v_rank_recv == __pyx_v_my_rank) != 0);
14951  if (__pyx_t_19) {
14952 
14953  /* "mprans/cMoveMeshMonitor.pyx":800
14954  * else:
14955  * if rank_recv == my_rank:
14956  * coords_2doArray = coords_2rank[my_rank] # <<<<<<<<<<<<<<
14957  * nNodes = len(coords_2doArray)
14958  * for iN in range(nNodes):
14959  */
14960  __pyx_t_53 = __Pyx_PyInt_From_int(__pyx_v_my_rank); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 800, __pyx_L1_error)
14961  __Pyx_GOTREF(__pyx_t_53);
14962  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_coords_2rank, __pyx_t_53); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 800, __pyx_L1_error)
14963  __Pyx_GOTREF(__pyx_t_3);
14964  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
14965  __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 800, __pyx_L1_error)
14966  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14967  __PYX_XDEC_MEMVIEW(&__pyx_cur_scope->__pyx_v_coords_2doArray, 1);
14968  __pyx_cur_scope->__pyx_v_coords_2doArray = __pyx_t_13;
14969  __pyx_t_13.memview = NULL;
14970  __pyx_t_13.data = NULL;
14971 
14972  /* "mprans/cMoveMeshMonitor.pyx":799
14973  * ncomm += 1
14974  * else:
14975  * if rank_recv == my_rank: # <<<<<<<<<<<<<<
14976  * coords_2doArray = coords_2rank[my_rank]
14977  * nNodes = len(coords_2doArray)
14978  */
14979  }
14980  }
14981  __pyx_L119:;
14982  }
14983 
14984  /* "mprans/cMoveMeshMonitor.pyx":801
14985  * if rank_recv == my_rank:
14986  * coords_2doArray = coords_2rank[my_rank]
14987  * nNodes = len(coords_2doArray) # <<<<<<<<<<<<<<
14988  * for iN in range(nNodes):
14989  * node0 = int(coords_2doArray[iN, 10])
14990  */
14991  __pyx_t_10 = __Pyx_MemoryView_Len(__pyx_cur_scope->__pyx_v_coords_2doArray);
14992  __pyx_v_nNodes = __pyx_t_10;
14993 
14994  /* "mprans/cMoveMeshMonitor.pyx":802
14995  * coords_2doArray = coords_2rank[my_rank]
14996  * nNodes = len(coords_2doArray)
14997  * for iN in range(nNodes): # <<<<<<<<<<<<<<
14998  * node0 = int(coords_2doArray[iN, 10])
14999  * coords[0] = coords_2doArray[iN, 0]
15000  */
15001  __pyx_t_2 = __pyx_v_nNodes;
15002  __pyx_t_20 = __pyx_t_2;
15003  for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
15004  __pyx_v_iN = __pyx_t_21;
15005 
15006  /* "mprans/cMoveMeshMonitor.pyx":803
15007  * nNodes = len(coords_2doArray)
15008  * for iN in range(nNodes):
15009  * node0 = int(coords_2doArray[iN, 10]) # <<<<<<<<<<<<<<
15010  * coords[0] = coords_2doArray[iN, 0]
15011  * coords[1] = coords_2doArray[iN, 1]
15012  */
15013  __pyx_t_17 = __pyx_v_iN;
15014  __pyx_t_26 = 10;
15015  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
15016  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
15017  __pyx_v_node0 = ((int)(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_17 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_26 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) ))));
15018 
15019  /* "mprans/cMoveMeshMonitor.pyx":804
15020  * for iN in range(nNodes):
15021  * node0 = int(coords_2doArray[iN, 10])
15022  * coords[0] = coords_2doArray[iN, 0] # <<<<<<<<<<<<<<
15023  * coords[1] = coords_2doArray[iN, 1]
15024  * coords[2] = coords_2doArray[iN, 2]
15025  */
15026  __pyx_t_26 = __pyx_v_iN;
15027  __pyx_t_17 = 0;
15028  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
15029  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
15030  __pyx_t_31 = 0;
15031  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_coords.shape[0];
15032  *((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_31 * __pyx_v_coords.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_26 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_17 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
15033 
15034  /* "mprans/cMoveMeshMonitor.pyx":805
15035  * node0 = int(coords_2doArray[iN, 10])
15036  * coords[0] = coords_2doArray[iN, 0]
15037  * coords[1] = coords_2doArray[iN, 1] # <<<<<<<<<<<<<<
15038  * coords[2] = coords_2doArray[iN, 2]
15039  * for ind in range(nd):
15040  */
15041  __pyx_t_17 = __pyx_v_iN;
15042  __pyx_t_26 = 1;
15043  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
15044  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
15045  __pyx_t_31 = 1;
15046  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_coords.shape[0];
15047  *((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_31 * __pyx_v_coords.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_17 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_26 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
15048 
15049  /* "mprans/cMoveMeshMonitor.pyx":806
15050  * coords[0] = coords_2doArray[iN, 0]
15051  * coords[1] = coords_2doArray[iN, 1]
15052  * coords[2] = coords_2doArray[iN, 2] # <<<<<<<<<<<<<<
15053  * for ind in range(nd):
15054  * xx[node0, ind] = coords[ind]
15055  */
15056  __pyx_t_26 = __pyx_v_iN;
15057  __pyx_t_17 = 2;
15058  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[0];
15059  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_cur_scope->__pyx_v_coords_2doArray.shape[1];
15060  __pyx_t_31 = 2;
15061  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_coords.shape[0];
15062  *((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_31 * __pyx_v_coords.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_cur_scope->__pyx_v_coords_2doArray.data + __pyx_t_26 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[0]) ) + __pyx_t_17 * __pyx_cur_scope->__pyx_v_coords_2doArray.strides[1]) )));
15063 
15064  /* "mprans/cMoveMeshMonitor.pyx":807
15065  * coords[1] = coords_2doArray[iN, 1]
15066  * coords[2] = coords_2doArray[iN, 2]
15067  * for ind in range(nd): # <<<<<<<<<<<<<<
15068  * xx[node0, ind] = coords[ind]
15069  *
15070  */
15071  __pyx_t_22 = __pyx_v_nd;
15072  __pyx_t_23 = __pyx_t_22;
15073  for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
15074  __pyx_v_ind = __pyx_t_24;
15075 
15076  /* "mprans/cMoveMeshMonitor.pyx":808
15077  * coords[2] = coords_2doArray[iN, 2]
15078  * for ind in range(nd):
15079  * xx[node0, ind] = coords[ind] # <<<<<<<<<<<<<<
15080  *
15081  * comm.barrier()
15082  */
15083  __pyx_t_17 = __pyx_v_ind;
15084  if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_coords.shape[0];
15085  __pyx_t_26 = __pyx_v_node0;
15086  __pyx_t_31 = __pyx_v_ind;
15087  if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_xx.shape[0];
15088  if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_v_xx.shape[1];
15089  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_xx.data + __pyx_t_26 * __pyx_v_xx.strides[0]) ) + __pyx_t_31 * __pyx_v_xx.strides[1]) )) = (*((double *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_17 * __pyx_v_coords.strides[0]) )));
15090  }
15091  }
15092 
15093  /* "mprans/cMoveMeshMonitor.pyx":758
15094  * comm.barrier()
15095  * # SEND NODES POSITION SOLUTION BACK TO ORIGINAL PROCESSORS
15096  * if sendBack is True: # <<<<<<<<<<<<<<
15097  * coords_2doArray = coords_2rank[my_rank]
15098  * for rank in range(comm.size):
15099  */
15100  }
15101 
15102  /* "mprans/cMoveMeshMonitor.pyx":810
15103  * xx[node0, ind] = coords[ind]
15104  *
15105  * comm.barrier() # <<<<<<<<<<<<<<
15106  * # FINAL STEP: GET NON-OWNED NODES POSITION FOR CONSISTENCY
15107  * # BUILD NON OWNED NODES ARRAY TO RETRIEVE SOLUTION
15108  */
15109  __pyx_t_53 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 810, __pyx_L1_error)
15110  __Pyx_GOTREF(__pyx_t_53);
15111  __pyx_t_7 = NULL;
15112  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_53))) {
15113  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_53);
15114  if (likely(__pyx_t_7)) {
15115  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_53);
15116  __Pyx_INCREF(__pyx_t_7);
15117  __Pyx_INCREF(function);
15118  __Pyx_DECREF_SET(__pyx_t_53, function);
15119  }
15120  }
15121  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_53, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_53);
15122  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15123  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 810, __pyx_L1_error)
15124  __Pyx_GOTREF(__pyx_t_3);
15125  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
15126  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15127 
15128  /* "mprans/cMoveMeshMonitor.pyx":813
15129  * # FINAL STEP: GET NON-OWNED NODES POSITION FOR CONSISTENCY
15130  * # BUILD NON OWNED NODES ARRAY TO RETRIEVE SOLUTION
15131  * ms.getNonOwnedNodeValues(xx, # <<<<<<<<<<<<<<
15132  * nNodes_owned,
15133  * nNodes_global,
15134  */
15135  __Pyx_GetModuleGlobalName(__pyx_t_53, __pyx_n_s_ms); if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 813, __pyx_L1_error)
15136  __Pyx_GOTREF(__pyx_t_53);
15137  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_53, __pyx_n_s_getNonOwnedNodeValues); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error)
15138  __Pyx_GOTREF(__pyx_t_7);
15139  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
15140  __pyx_t_53 = __pyx_memoryview_fromslice(__pyx_v_xx, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_53)) __PYX_ERR(0, 813, __pyx_L1_error)
15141  __Pyx_GOTREF(__pyx_t_53);
15142 
15143  /* "mprans/cMoveMeshMonitor.pyx":814
15144  * # BUILD NON OWNED NODES ARRAY TO RETRIEVE SOLUTION
15145  * ms.getNonOwnedNodeValues(xx,
15146  * nNodes_owned, # <<<<<<<<<<<<<<
15147  * nNodes_global,
15148  * nodeNumbering_subdomain2global,
15149  */
15150  __pyx_t_52 = __Pyx_PyInt_From_int(__pyx_v_nNodes_owned); if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 814, __pyx_L1_error)
15151  __Pyx_GOTREF(__pyx_t_52);
15152 
15153  /* "mprans/cMoveMeshMonitor.pyx":815
15154  * ms.getNonOwnedNodeValues(xx,
15155  * nNodes_owned,
15156  * nNodes_global, # <<<<<<<<<<<<<<
15157  * nodeNumbering_subdomain2global,
15158  * nodeOffsets_subdomain_owned)
15159  */
15160  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nNodes_global); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error)
15161  __Pyx_GOTREF(__pyx_t_1);
15162 
15163  /* "mprans/cMoveMeshMonitor.pyx":816
15164  * nNodes_owned,
15165  * nNodes_global,
15166  * nodeNumbering_subdomain2global, # <<<<<<<<<<<<<<
15167  * nodeOffsets_subdomain_owned)
15168  *
15169  */
15170  __pyx_t_46 = __pyx_memoryview_fromslice(__pyx_v_nodeNumbering_subdomain2global, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 816, __pyx_L1_error)
15171  __Pyx_GOTREF(__pyx_t_46);
15172 
15173  /* "mprans/cMoveMeshMonitor.pyx":817
15174  * nNodes_global,
15175  * nodeNumbering_subdomain2global,
15176  * nodeOffsets_subdomain_owned) # <<<<<<<<<<<<<<
15177  *
15178  *
15179  */
15180  __pyx_t_50 = __pyx_memoryview_fromslice(__pyx_v_nodeOffsets_subdomain_owned, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 817, __pyx_L1_error)
15181  __Pyx_GOTREF(__pyx_t_50);
15182  __pyx_t_51 = NULL;
15183  __pyx_t_2 = 0;
15184  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
15185  __pyx_t_51 = PyMethod_GET_SELF(__pyx_t_7);
15186  if (likely(__pyx_t_51)) {
15187  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
15188  __Pyx_INCREF(__pyx_t_51);
15189  __Pyx_INCREF(function);
15190  __Pyx_DECREF_SET(__pyx_t_7, function);
15191  __pyx_t_2 = 1;
15192  }
15193  }
15194  #if CYTHON_FAST_PYCALL
15195  if (PyFunction_Check(__pyx_t_7)) {
15196  PyObject *__pyx_temp[6] = {__pyx_t_51, __pyx_t_53, __pyx_t_52, __pyx_t_1, __pyx_t_46, __pyx_t_50};
15197  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 5+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 813, __pyx_L1_error)
15198  __Pyx_XDECREF(__pyx_t_51); __pyx_t_51 = 0;
15199  __Pyx_GOTREF(__pyx_t_3);
15200  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
15201  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
15202  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15203  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
15204  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
15205  } else
15206  #endif
15207  #if CYTHON_FAST_PYCCALL
15208  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
15209  PyObject *__pyx_temp[6] = {__pyx_t_51, __pyx_t_53, __pyx_t_52, __pyx_t_1, __pyx_t_46, __pyx_t_50};
15210  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 5+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 813, __pyx_L1_error)
15211  __Pyx_XDECREF(__pyx_t_51); __pyx_t_51 = 0;
15212  __Pyx_GOTREF(__pyx_t_3);
15213  __Pyx_DECREF(__pyx_t_53); __pyx_t_53 = 0;
15214  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
15215  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15216  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
15217  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
15218  } else
15219  #endif
15220  {
15221  __pyx_t_6 = PyTuple_New(5+__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 813, __pyx_L1_error)
15222  __Pyx_GOTREF(__pyx_t_6);
15223  if (__pyx_t_51) {
15224  __Pyx_GIVEREF(__pyx_t_51); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_51); __pyx_t_51 = NULL;
15225  }
15226  __Pyx_GIVEREF(__pyx_t_53);
15227  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, __pyx_t_53);
15228  __Pyx_GIVEREF(__pyx_t_52);
15229  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_t_52);
15230  __Pyx_GIVEREF(__pyx_t_1);
15231  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_2, __pyx_t_1);
15232  __Pyx_GIVEREF(__pyx_t_46);
15233  PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_2, __pyx_t_46);
15234  __Pyx_GIVEREF(__pyx_t_50);
15235  PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_2, __pyx_t_50);
15236  __pyx_t_53 = 0;
15237  __pyx_t_52 = 0;
15238  __pyx_t_1 = 0;
15239  __pyx_t_46 = 0;
15240  __pyx_t_50 = 0;
15241  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 813, __pyx_L1_error)
15242  __Pyx_GOTREF(__pyx_t_3);
15243  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15244  }
15245  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15246  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15247 
15248  /* "mprans/cMoveMeshMonitor.pyx":820
15249  *
15250  *
15251  * if nSmoothIn > 0: # <<<<<<<<<<<<<<
15252  * nSmooth = nSmoothIn
15253  * elif nSmoothOut > 0 and ntimes_i == ntimes_solved-1:
15254  */
15255  __pyx_t_19 = ((__pyx_v_nSmoothIn > 0) != 0);
15256  if (__pyx_t_19) {
15257 
15258  /* "mprans/cMoveMeshMonitor.pyx":821
15259  *
15260  * if nSmoothIn > 0:
15261  * nSmooth = nSmoothIn # <<<<<<<<<<<<<<
15262  * elif nSmoothOut > 0 and ntimes_i == ntimes_solved-1:
15263  * nSmooth = nSmoothOut
15264  */
15265  __pyx_v_nSmooth = __pyx_v_nSmoothIn;
15266 
15267  /* "mprans/cMoveMeshMonitor.pyx":820
15268  *
15269  *
15270  * if nSmoothIn > 0: # <<<<<<<<<<<<<<
15271  * nSmooth = nSmoothIn
15272  * elif nSmoothOut > 0 and ntimes_i == ntimes_solved-1:
15273  */
15274  goto __pyx_L126;
15275  }
15276 
15277  /* "mprans/cMoveMeshMonitor.pyx":822
15278  * if nSmoothIn > 0:
15279  * nSmooth = nSmoothIn
15280  * elif nSmoothOut > 0 and ntimes_i == ntimes_solved-1: # <<<<<<<<<<<<<<
15281  * nSmooth = nSmoothOut
15282  * comm.barrier()
15283  */
15284  __pyx_t_30 = ((__pyx_v_nSmoothOut > 0) != 0);
15285  if (__pyx_t_30) {
15286  } else {
15287  __pyx_t_19 = __pyx_t_30;
15288  goto __pyx_L127_bool_binop_done;
15289  }
15290  __pyx_t_30 = ((__pyx_v_ntimes_i == (__pyx_v_ntimes_solved - 1)) != 0);
15291  __pyx_t_19 = __pyx_t_30;
15292  __pyx_L127_bool_binop_done:;
15293  if (__pyx_t_19) {
15294 
15295  /* "mprans/cMoveMeshMonitor.pyx":823
15296  * nSmooth = nSmoothIn
15297  * elif nSmoothOut > 0 and ntimes_i == ntimes_solved-1:
15298  * nSmooth = nSmoothOut # <<<<<<<<<<<<<<
15299  * comm.barrier()
15300  * if nSmooth > 0:
15301  */
15302  __pyx_v_nSmooth = __pyx_v_nSmoothOut;
15303 
15304  /* "mprans/cMoveMeshMonitor.pyx":822
15305  * if nSmoothIn > 0:
15306  * nSmooth = nSmoothIn
15307  * elif nSmoothOut > 0 and ntimes_i == ntimes_solved-1: # <<<<<<<<<<<<<<
15308  * nSmooth = nSmoothOut
15309  * comm.barrier()
15310  */
15311  }
15312  __pyx_L126:;
15313 
15314  /* "mprans/cMoveMeshMonitor.pyx":824
15315  * elif nSmoothOut > 0 and ntimes_i == ntimes_solved-1:
15316  * nSmooth = nSmoothOut
15317  * comm.barrier() # <<<<<<<<<<<<<<
15318  * if nSmooth > 0:
15319  * logEvent('Smoothing Mesh with Laplace Smoothing - '+str(nSmooth))
15320  */
15321  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 824, __pyx_L1_error)
15322  __Pyx_GOTREF(__pyx_t_7);
15323  __pyx_t_6 = NULL;
15324  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
15325  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
15326  if (likely(__pyx_t_6)) {
15327  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
15328  __Pyx_INCREF(__pyx_t_6);
15329  __Pyx_INCREF(function);
15330  __Pyx_DECREF_SET(__pyx_t_7, function);
15331  }
15332  }
15333  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
15334  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15335  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error)
15336  __Pyx_GOTREF(__pyx_t_3);
15337  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15338  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15339 
15340  /* "mprans/cMoveMeshMonitor.pyx":825
15341  * nSmooth = nSmoothOut
15342  * comm.barrier()
15343  * if nSmooth > 0: # <<<<<<<<<<<<<<
15344  * logEvent('Smoothing Mesh with Laplace Smoothing - '+str(nSmooth))
15345  * for iS in range(nSmooth):
15346  */
15347  __pyx_t_19 = ((__pyx_v_nSmooth > 0) != 0);
15348  if (__pyx_t_19) {
15349 
15350  /* "mprans/cMoveMeshMonitor.pyx":826
15351  * comm.barrier()
15352  * if nSmooth > 0:
15353  * logEvent('Smoothing Mesh with Laplace Smoothing - '+str(nSmooth)) # <<<<<<<<<<<<<<
15354  * for iS in range(nSmooth):
15355  * # elementVolumesArray = self.model.q['abs(det(J))'][:,0]
15356  */
15357  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 826, __pyx_L1_error)
15358  __Pyx_GOTREF(__pyx_t_7);
15359  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nSmooth); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 826, __pyx_L1_error)
15360  __Pyx_GOTREF(__pyx_t_6);
15361  __pyx_t_50 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_6); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 826, __pyx_L1_error)
15362  __Pyx_GOTREF(__pyx_t_50);
15363  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15364  __pyx_t_6 = PyNumber_Add(__pyx_kp_s_Smoothing_Mesh_with_Laplace_Smoo, __pyx_t_50); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 826, __pyx_L1_error)
15365  __Pyx_GOTREF(__pyx_t_6);
15366  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
15367  __pyx_t_50 = NULL;
15368  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
15369  __pyx_t_50 = PyMethod_GET_SELF(__pyx_t_7);
15370  if (likely(__pyx_t_50)) {
15371  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
15372  __Pyx_INCREF(__pyx_t_50);
15373  __Pyx_INCREF(function);
15374  __Pyx_DECREF_SET(__pyx_t_7, function);
15375  }
15376  }
15377  __pyx_t_3 = (__pyx_t_50) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_50, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
15378  __Pyx_XDECREF(__pyx_t_50); __pyx_t_50 = 0;
15379  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15380  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error)
15381  __Pyx_GOTREF(__pyx_t_3);
15382  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15383  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15384 
15385  /* "mprans/cMoveMeshMonitor.pyx":827
15386  * if nSmooth > 0:
15387  * logEvent('Smoothing Mesh with Laplace Smoothing - '+str(nSmooth))
15388  * for iS in range(nSmooth): # <<<<<<<<<<<<<<
15389  * # elementVolumesArray = self.model.q['abs(det(J))'][:,0]
15390  * # elementBarycentersArray = self.mesh.elementBarycentersArray
15391  */
15392  __pyx_t_2 = __pyx_v_nSmooth;
15393  __pyx_t_20 = __pyx_t_2;
15394  for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
15395  __pyx_v_iS = __pyx_t_21;
15396 
15397  /* "mprans/cMoveMeshMonitor.pyx":836
15398  * # elementNodesArray=self.mesh.elementNodesArray,
15399  * # nodeArray=self.PHI)
15400  * simultaneous = True # <<<<<<<<<<<<<<
15401  * ms.smoothNodesLaplace(nodeArray_=xx,
15402  * nodeStarOffsets=nodeStarOffsets,
15403  */
15404  __pyx_v_simultaneous = 1;
15405 
15406  /* "mprans/cMoveMeshMonitor.pyx":837
15407  * # nodeArray=self.PHI)
15408  * simultaneous = True
15409  * ms.smoothNodesLaplace(nodeArray_=xx, # <<<<<<<<<<<<<<
15410  * nodeStarOffsets=nodeStarOffsets,
15411  * nodeStarArray=nodeStarArray,
15412  */
15413  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ms); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
15414  __Pyx_GOTREF(__pyx_t_3);
15415  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_smoothNodesLaplace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 837, __pyx_L1_error)
15416  __Pyx_GOTREF(__pyx_t_7);
15417  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15418  __pyx_t_3 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
15419  __Pyx_GOTREF(__pyx_t_3);
15420  __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_xx, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 837, __pyx_L1_error)
15421  __Pyx_GOTREF(__pyx_t_6);
15422  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nodeArray_2, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15423  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15424 
15425  /* "mprans/cMoveMeshMonitor.pyx":838
15426  * simultaneous = True
15427  * ms.smoothNodesLaplace(nodeArray_=xx,
15428  * nodeStarOffsets=nodeStarOffsets, # <<<<<<<<<<<<<<
15429  * nodeStarArray=nodeStarArray,
15430  * nodeMaterialTypes=nodeMaterialTypes,
15431  */
15432  __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_nodeStarOffsets, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 838, __pyx_L1_error)
15433  __Pyx_GOTREF(__pyx_t_6);
15434  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nodeStarOffsets, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15435  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15436 
15437  /* "mprans/cMoveMeshMonitor.pyx":839
15438  * ms.smoothNodesLaplace(nodeArray_=xx,
15439  * nodeStarOffsets=nodeStarOffsets,
15440  * nodeStarArray=nodeStarArray, # <<<<<<<<<<<<<<
15441  * nodeMaterialTypes=nodeMaterialTypes,
15442  * nNodes_owned=nNodes_owned,
15443  */
15444  __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_nodeStarArray, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 839, __pyx_L1_error)
15445  __Pyx_GOTREF(__pyx_t_6);
15446  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nodeStarArray, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15447  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15448 
15449  /* "mprans/cMoveMeshMonitor.pyx":840
15450  * nodeStarOffsets=nodeStarOffsets,
15451  * nodeStarArray=nodeStarArray,
15452  * nodeMaterialTypes=nodeMaterialTypes, # <<<<<<<<<<<<<<
15453  * nNodes_owned=nNodes_owned,
15454  * nd=nd,
15455  */
15456  __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_nodeMaterialTypes, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 840, __pyx_L1_error)
15457  __Pyx_GOTREF(__pyx_t_6);
15458  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nodeMaterialTypes, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15459  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15460 
15461  /* "mprans/cMoveMeshMonitor.pyx":841
15462  * nodeStarArray=nodeStarArray,
15463  * nodeMaterialTypes=nodeMaterialTypes,
15464  * nNodes_owned=nNodes_owned, # <<<<<<<<<<<<<<
15465  * nd=nd,
15466  * simultaneous=simultaneous,
15467  */
15468  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nNodes_owned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 841, __pyx_L1_error)
15469  __Pyx_GOTREF(__pyx_t_6);
15470  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nNodes_owned, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15471  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15472 
15473  /* "mprans/cMoveMeshMonitor.pyx":842
15474  * nodeMaterialTypes=nodeMaterialTypes,
15475  * nNodes_owned=nNodes_owned,
15476  * nd=nd, # <<<<<<<<<<<<<<
15477  * simultaneous=simultaneous,
15478  * smoothBoundaries=True,
15479  */
15480  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_nd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error)
15481  __Pyx_GOTREF(__pyx_t_6);
15482  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nd, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15483  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15484 
15485  /* "mprans/cMoveMeshMonitor.pyx":843
15486  * nNodes_owned=nNodes_owned,
15487  * nd=nd,
15488  * simultaneous=simultaneous, # <<<<<<<<<<<<<<
15489  * smoothBoundaries=True,
15490  * fixedNodesBoolArray=fixedNodesBoolArray,
15491  */
15492  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_simultaneous); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 843, __pyx_L1_error)
15493  __Pyx_GOTREF(__pyx_t_6);
15494  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_simultaneous, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15495  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15496 
15497  /* "mprans/cMoveMeshMonitor.pyx":844
15498  * nd=nd,
15499  * simultaneous=simultaneous,
15500  * smoothBoundaries=True, # <<<<<<<<<<<<<<
15501  * fixedNodesBoolArray=fixedNodesBoolArray,
15502  * alpha=0.)
15503  */
15504  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_smoothBoundaries, Py_True) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15505 
15506  /* "mprans/cMoveMeshMonitor.pyx":845
15507  * simultaneous=simultaneous,
15508  * smoothBoundaries=True,
15509  * fixedNodesBoolArray=fixedNodesBoolArray, # <<<<<<<<<<<<<<
15510  * alpha=0.)
15511  * comm.barrier()
15512  */
15513  __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_fixedNodesBoolArray, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 845, __pyx_L1_error)
15514  __Pyx_GOTREF(__pyx_t_6);
15515  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fixedNodesBoolArray, __pyx_t_6) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15516  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15517  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alpha, __pyx_float_0_) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
15518 
15519  /* "mprans/cMoveMeshMonitor.pyx":837
15520  * # nodeArray=self.PHI)
15521  * simultaneous = True
15522  * ms.smoothNodesLaplace(nodeArray_=xx, # <<<<<<<<<<<<<<
15523  * nodeStarOffsets=nodeStarOffsets,
15524  * nodeStarArray=nodeStarArray,
15525  */
15526  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 837, __pyx_L1_error)
15527  __Pyx_GOTREF(__pyx_t_6);
15528  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15529  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15530  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15531 
15532  /* "mprans/cMoveMeshMonitor.pyx":847
15533  * fixedNodesBoolArray=fixedNodesBoolArray,
15534  * alpha=0.)
15535  * comm.barrier() # <<<<<<<<<<<<<<
15536  * ms.getNonOwnedNodeValues(xx,
15537  * nNodes_owned,
15538  */
15539  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 847, __pyx_L1_error)
15540  __Pyx_GOTREF(__pyx_t_3);
15541  __pyx_t_7 = NULL;
15542  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
15543  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
15544  if (likely(__pyx_t_7)) {
15545  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
15546  __Pyx_INCREF(__pyx_t_7);
15547  __Pyx_INCREF(function);
15548  __Pyx_DECREF_SET(__pyx_t_3, function);
15549  }
15550  }
15551  __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
15552  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15553  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 847, __pyx_L1_error)
15554  __Pyx_GOTREF(__pyx_t_6);
15555  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15556  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15557 
15558  /* "mprans/cMoveMeshMonitor.pyx":848
15559  * alpha=0.)
15560  * comm.barrier()
15561  * ms.getNonOwnedNodeValues(xx, # <<<<<<<<<<<<<<
15562  * nNodes_owned,
15563  * nNodes_global,
15564  */
15565  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ms); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error)
15566  __Pyx_GOTREF(__pyx_t_3);
15567  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getNonOwnedNodeValues); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 848, __pyx_L1_error)
15568  __Pyx_GOTREF(__pyx_t_7);
15569  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15570  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_xx, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error)
15571  __Pyx_GOTREF(__pyx_t_3);
15572 
15573  /* "mprans/cMoveMeshMonitor.pyx":849
15574  * comm.barrier()
15575  * ms.getNonOwnedNodeValues(xx,
15576  * nNodes_owned, # <<<<<<<<<<<<<<
15577  * nNodes_global,
15578  * nodeNumbering_subdomain2global,
15579  */
15580  __pyx_t_50 = __Pyx_PyInt_From_int(__pyx_v_nNodes_owned); if (unlikely(!__pyx_t_50)) __PYX_ERR(0, 849, __pyx_L1_error)
15581  __Pyx_GOTREF(__pyx_t_50);
15582 
15583  /* "mprans/cMoveMeshMonitor.pyx":850
15584  * ms.getNonOwnedNodeValues(xx,
15585  * nNodes_owned,
15586  * nNodes_global, # <<<<<<<<<<<<<<
15587  * nodeNumbering_subdomain2global,
15588  * nodeOffsets_subdomain_owned)
15589  */
15590  __pyx_t_46 = __Pyx_PyInt_From_int(__pyx_v_nNodes_global); if (unlikely(!__pyx_t_46)) __PYX_ERR(0, 850, __pyx_L1_error)
15591  __Pyx_GOTREF(__pyx_t_46);
15592 
15593  /* "mprans/cMoveMeshMonitor.pyx":851
15594  * nNodes_owned,
15595  * nNodes_global,
15596  * nodeNumbering_subdomain2global, # <<<<<<<<<<<<<<
15597  * nodeOffsets_subdomain_owned)
15598  * logEvent('Done smoothing')
15599  */
15600  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_nodeNumbering_subdomain2global, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
15601  __Pyx_GOTREF(__pyx_t_1);
15602 
15603  /* "mprans/cMoveMeshMonitor.pyx":852
15604  * nNodes_global,
15605  * nodeNumbering_subdomain2global,
15606  * nodeOffsets_subdomain_owned) # <<<<<<<<<<<<<<
15607  * logEvent('Done smoothing')
15608  *
15609  */
15610  __pyx_t_52 = __pyx_memoryview_fromslice(__pyx_v_nodeOffsets_subdomain_owned, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_52)) __PYX_ERR(0, 852, __pyx_L1_error)
15611  __Pyx_GOTREF(__pyx_t_52);
15612  __pyx_t_53 = NULL;
15613  __pyx_t_22 = 0;
15614  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
15615  __pyx_t_53 = PyMethod_GET_SELF(__pyx_t_7);
15616  if (likely(__pyx_t_53)) {
15617  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
15618  __Pyx_INCREF(__pyx_t_53);
15619  __Pyx_INCREF(function);
15620  __Pyx_DECREF_SET(__pyx_t_7, function);
15621  __pyx_t_22 = 1;
15622  }
15623  }
15624  #if CYTHON_FAST_PYCALL
15625  if (PyFunction_Check(__pyx_t_7)) {
15626  PyObject *__pyx_temp[6] = {__pyx_t_53, __pyx_t_3, __pyx_t_50, __pyx_t_46, __pyx_t_1, __pyx_t_52};
15627  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_22, 5+__pyx_t_22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 848, __pyx_L1_error)
15628  __Pyx_XDECREF(__pyx_t_53); __pyx_t_53 = 0;
15629  __Pyx_GOTREF(__pyx_t_6);
15630  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15631  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
15632  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
15633  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15634  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
15635  } else
15636  #endif
15637  #if CYTHON_FAST_PYCCALL
15638  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
15639  PyObject *__pyx_temp[6] = {__pyx_t_53, __pyx_t_3, __pyx_t_50, __pyx_t_46, __pyx_t_1, __pyx_t_52};
15640  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_22, 5+__pyx_t_22); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 848, __pyx_L1_error)
15641  __Pyx_XDECREF(__pyx_t_53); __pyx_t_53 = 0;
15642  __Pyx_GOTREF(__pyx_t_6);
15643  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15644  __Pyx_DECREF(__pyx_t_50); __pyx_t_50 = 0;
15645  __Pyx_DECREF(__pyx_t_46); __pyx_t_46 = 0;
15646  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15647  __Pyx_DECREF(__pyx_t_52); __pyx_t_52 = 0;
15648  } else
15649  #endif
15650  {
15651  __pyx_t_51 = PyTuple_New(5+__pyx_t_22); if (unlikely(!__pyx_t_51)) __PYX_ERR(0, 848, __pyx_L1_error)
15652  __Pyx_GOTREF(__pyx_t_51);
15653  if (__pyx_t_53) {
15654  __Pyx_GIVEREF(__pyx_t_53); PyTuple_SET_ITEM(__pyx_t_51, 0, __pyx_t_53); __pyx_t_53 = NULL;
15655  }
15656  __Pyx_GIVEREF(__pyx_t_3);
15657  PyTuple_SET_ITEM(__pyx_t_51, 0+__pyx_t_22, __pyx_t_3);
15658  __Pyx_GIVEREF(__pyx_t_50);
15659  PyTuple_SET_ITEM(__pyx_t_51, 1+__pyx_t_22, __pyx_t_50);
15660  __Pyx_GIVEREF(__pyx_t_46);
15661  PyTuple_SET_ITEM(__pyx_t_51, 2+__pyx_t_22, __pyx_t_46);
15662  __Pyx_GIVEREF(__pyx_t_1);
15663  PyTuple_SET_ITEM(__pyx_t_51, 3+__pyx_t_22, __pyx_t_1);
15664  __Pyx_GIVEREF(__pyx_t_52);
15665  PyTuple_SET_ITEM(__pyx_t_51, 4+__pyx_t_22, __pyx_t_52);
15666  __pyx_t_3 = 0;
15667  __pyx_t_50 = 0;
15668  __pyx_t_46 = 0;
15669  __pyx_t_1 = 0;
15670  __pyx_t_52 = 0;
15671  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_51, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 848, __pyx_L1_error)
15672  __Pyx_GOTREF(__pyx_t_6);
15673  __Pyx_DECREF(__pyx_t_51); __pyx_t_51 = 0;
15674  }
15675  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15676  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15677  }
15678 
15679  /* "mprans/cMoveMeshMonitor.pyx":853
15680  * nodeNumbering_subdomain2global,
15681  * nodeOffsets_subdomain_owned)
15682  * logEvent('Done smoothing') # <<<<<<<<<<<<<<
15683  *
15684  * logEvent('Done pseudo-timestepping')
15685  */
15686  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 853, __pyx_L1_error)
15687  __Pyx_GOTREF(__pyx_t_7);
15688  __pyx_t_51 = NULL;
15689  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
15690  __pyx_t_51 = PyMethod_GET_SELF(__pyx_t_7);
15691  if (likely(__pyx_t_51)) {
15692  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
15693  __Pyx_INCREF(__pyx_t_51);
15694  __Pyx_INCREF(function);
15695  __Pyx_DECREF_SET(__pyx_t_7, function);
15696  }
15697  }
15698  __pyx_t_6 = (__pyx_t_51) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_51, __pyx_kp_s_Done_smoothing) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_s_Done_smoothing);
15699  __Pyx_XDECREF(__pyx_t_51); __pyx_t_51 = 0;
15700  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 853, __pyx_L1_error)
15701  __Pyx_GOTREF(__pyx_t_6);
15702  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15703  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15704 
15705  /* "mprans/cMoveMeshMonitor.pyx":825
15706  * nSmooth = nSmoothOut
15707  * comm.barrier()
15708  * if nSmooth > 0: # <<<<<<<<<<<<<<
15709  * logEvent('Smoothing Mesh with Laplace Smoothing - '+str(nSmooth))
15710  * for iS in range(nSmooth):
15711  */
15712  }
15713 
15714  /* "mprans/cMoveMeshMonitor.pyx":855
15715  * logEvent('Done smoothing')
15716  *
15717  * logEvent('Done pseudo-timestepping') # <<<<<<<<<<<<<<
15718  *
15719  * # def evaluateFunAtX(self, x, ls_phi=None):
15720  */
15721  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 855, __pyx_L1_error)
15722  __Pyx_GOTREF(__pyx_t_7);
15723  __pyx_t_51 = NULL;
15724  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
15725  __pyx_t_51 = PyMethod_GET_SELF(__pyx_t_7);
15726  if (likely(__pyx_t_51)) {
15727  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
15728  __Pyx_INCREF(__pyx_t_51);
15729  __Pyx_INCREF(function);
15730  __Pyx_DECREF_SET(__pyx_t_7, function);
15731  }
15732  }
15733  __pyx_t_6 = (__pyx_t_51) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_51, __pyx_kp_s_Done_pseudo_timestepping) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_s_Done_pseudo_timestepping);
15734  __Pyx_XDECREF(__pyx_t_51); __pyx_t_51 = 0;
15735  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 855, __pyx_L1_error)
15736  __Pyx_GOTREF(__pyx_t_6);
15737  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15738  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15739 
15740  /* "mprans/cMoveMeshMonitor.pyx":202
15741  * eps=eps)
15742  *
15743  * cdef cppPseudoTimeSteppingParallel(self, # <<<<<<<<<<<<<<
15744  * double[:,:] xx,
15745  * double eps):
15746  */
15747 
15748  /* function exit code */
15749  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15750  goto __pyx_L0;
15751  __pyx_L1_error:;
15752  __Pyx_XDECREF(__pyx_t_1);
15753  __Pyx_XDECREF(__pyx_t_3);
15754  __Pyx_XDECREF(__pyx_t_4);
15755  __Pyx_XDECREF(__pyx_t_5);
15756  __Pyx_XDECREF(__pyx_t_6);
15757  __Pyx_XDECREF(__pyx_t_7);
15758  __Pyx_XDECREF(__pyx_t_8);
15759  __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
15760  __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
15761  __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
15762  __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
15763  __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
15764  __Pyx_XDECREF(__pyx_t_42);
15765  __Pyx_XDECREF(__pyx_t_43);
15766  __Pyx_XDECREF(__pyx_t_44);
15767  __Pyx_XDECREF(__pyx_t_45);
15768  __Pyx_XDECREF(__pyx_t_46);
15769  __Pyx_XDECREF(__pyx_t_47);
15770  __Pyx_XDECREF(__pyx_t_50);
15771  __Pyx_XDECREF(__pyx_t_51);
15772  __Pyx_XDECREF(__pyx_t_52);
15773  __Pyx_XDECREF(__pyx_t_53);
15774  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.cppPseudoTimeSteppingParallel", __pyx_clineno, __pyx_lineno, __pyx_filename);
15775  __pyx_r = 0;
15776  __pyx_L0:;
15777  __Pyx_XDECREF(__pyx_v_pc);
15778  __PYX_XDEC_MEMVIEW(&__pyx_v_t_range, 1);
15779  __PYX_XDEC_MEMVIEW(&__pyx_v_eN_phi, 1);
15780  __PYX_XDEC_MEMVIEW(&__pyx_v_normal, 1);
15781  __PYX_XDEC_MEMVIEW(&__pyx_v_dphi, 1);
15782  __PYX_XDEC_MEMVIEW(&__pyx_v_grads, 1);
15783  __PYX_XDEC_MEMVIEW(&__pyx_v_v_grad, 1);
15784  __PYX_XDEC_MEMVIEW(&__pyx_v_areas_nodes, 1);
15785  __PYX_XDEC_MEMVIEW(&__pyx_v_areas, 1);
15786  __PYX_XDEC_MEMVIEW(&__pyx_v_u_phi, 1);
15787  __Pyx_XDECREF(__pyx_v_femSpace);
15788  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeArray, 1);
15789  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeStarOffsets, 1);
15790  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeStarArray, 1);
15791  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementOffsets, 1);
15792  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementsArray, 1);
15793  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeMaterialTypes, 1);
15794  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBarycentersArray, 1);
15795  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryElementsArray, 1);
15796  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundariesArray, 1);
15797  __PYX_XDEC_MEMVIEW(&__pyx_v_elementNodesArray, 1);
15798  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryBarycentersArray, 1);
15799  __PYX_XDEC_MEMVIEW(&__pyx_v_exteriorElementBoundariesBoolArray, 1);
15800  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNormalsArray, 1);
15801  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeNumbering_subdomain2global, 1);
15802  __PYX_XDEC_MEMVIEW(&__pyx_v_elementNumbering_subdomain2global, 1);
15803  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeOffsets_subdomain_owned, 1);
15804  __PYX_XDEC_MEMVIEW(&__pyx_v_elementOffsets_subdomain_owned, 1);
15805  __PYX_XDEC_MEMVIEW(&__pyx_v_nearestNArray, 1);
15806  __PYX_XDEC_MEMVIEW(&__pyx_v_typeNArray, 1);
15807  __PYX_XDEC_MEMVIEW(&__pyx_v_elementNeighborsArray, 1);
15808  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNumbering_subdomain2global, 1);
15809  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryOffsets_subdomain_owned, 1);
15810  __PYX_XDEC_MEMVIEW(&__pyx_v_elementBoundaryNodesArray, 1);
15811  __PYX_XDEC_MEMVIEW(&__pyx_v_fixedNodesBoolArray, 1);
15812  __PYX_XDEC_MEMVIEW(&__pyx_v_vec, 1);
15813  __PYX_XDEC_MEMVIEW(&__pyx_v_vec2, 1);
15814  __PYX_XDEC_MEMVIEW(&__pyx_v_fixed_dir, 1);
15815  __Pyx_XDECREF(__pyx_v_comm);
15816  __PYX_XDEC_MEMVIEW(&__pyx_v_counts_local, 1);
15817  __PYX_XDEC_MEMVIEW(&__pyx_v_counts_total, 1);
15818  __PYX_XDEC_MEMVIEW(&__pyx_v_counts_out, 1);
15819  __PYX_XDEC_MEMVIEW(&__pyx_v_displacements_out, 1);
15820  __Pyx_XDECREF(__pyx_v_coords_2rank);
15821  __Pyx_XDECREF(__pyx_v_nodes0_2rank);
15822  __Pyx_XDECREF(__pyx_v_rank0_2rank);
15823  __Pyx_XDECREF(__pyx_v_nearestN_2rank);
15824  __Pyx_XDECREF(__pyx_v_typeN_2rank);
15825  __Pyx_XDECREF(__pyx_v_dir_2rank);
15826  __Pyx_XDECREF(__pyx_v_b_i_2rank);
15827  __PYX_XDEC_MEMVIEW(&__pyx_v_coords, 1);
15828  __PYX_XDEC_MEMVIEW(&__pyx_v_bound_bar, 1);
15829  __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1);
15830  __Pyx_XDECREF(__pyx_v_rank);
15831  __PYX_XDEC_MEMVIEW(&__pyx_v_nodesSentBoolArray, 1);
15832  __PYX_XDEC_MEMVIEW(&__pyx_v_starting_coords, 1);
15833  __Pyx_XDECREF(__pyx_v_exc);
15834  __Pyx_XDECREF(__pyx_v_xi);
15835  __Pyx_XDECREF(__pyx_v_array_size);
15836  __Pyx_XDECREF(__pyx_v_datatype);
15837  __Pyx_XDECREF(__pyx_v_solFound_2doArray);
15838  __Pyx_XDECREF(__pyx_v_rank0);
15839  __Pyx_XDECREF(__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_2generator);
15840  __Pyx_XDECREF(__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_5generator1);
15841  __Pyx_XDECREF(__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_8generator2);
15842  __Pyx_XDECREF(__pyx_gb_6mprans_16cMoveMeshMonitor_13cCoefficients_29cppPseudoTimeSteppingParallel_11generator3);
15843  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
15844  __Pyx_XGIVEREF(__pyx_r);
15845  __Pyx_RefNannyFinishContext();
15846  return __pyx_r;
15847 }
15848 
15849 /* "mprans/cMoveMeshMonitor.pyx":17
15850  * cdef class cCoefficients:
15851  * cdef public:
15852  * object pyCoefficients # <<<<<<<<<<<<<<
15853  * double C
15854  *
15855  */
15856 
15857 /* Python wrapper */
15858 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_1__get__(PyObject *__pyx_v_self); /*proto*/
15859 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_1__get__(PyObject *__pyx_v_self) {
15860  PyObject *__pyx_r = 0;
15861  __Pyx_RefNannyDeclarations
15862  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15863  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients___get__(((struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
15864 
15865  /* function exit code */
15866  __Pyx_RefNannyFinishContext();
15867  return __pyx_r;
15868 }
15869 
15870 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients___get__(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
15871  PyObject *__pyx_r = NULL;
15872  __Pyx_RefNannyDeclarations
15873  __Pyx_RefNannySetupContext("__get__", 0);
15874  __Pyx_XDECREF(__pyx_r);
15875  __Pyx_INCREF(__pyx_v_self->pyCoefficients);
15876  __pyx_r = __pyx_v_self->pyCoefficients;
15877  goto __pyx_L0;
15878 
15879  /* function exit code */
15880  __pyx_L0:;
15881  __Pyx_XGIVEREF(__pyx_r);
15882  __Pyx_RefNannyFinishContext();
15883  return __pyx_r;
15884 }
15885 
15886 /* Python wrapper */
15887 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
15888 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
15889  int __pyx_r;
15890  __Pyx_RefNannyDeclarations
15891  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
15892  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_2__set__(((struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self), ((PyObject *)__pyx_v_value));
15893 
15894  /* function exit code */
15895  __Pyx_RefNannyFinishContext();
15896  return __pyx_r;
15897 }
15898 
15899 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_2__set__(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_value) {
15900  int __pyx_r;
15901  __Pyx_RefNannyDeclarations
15902  __Pyx_RefNannySetupContext("__set__", 0);
15903  __Pyx_INCREF(__pyx_v_value);
15904  __Pyx_GIVEREF(__pyx_v_value);
15905  __Pyx_GOTREF(__pyx_v_self->pyCoefficients);
15906  __Pyx_DECREF(__pyx_v_self->pyCoefficients);
15907  __pyx_v_self->pyCoefficients = __pyx_v_value;
15908 
15909  /* function exit code */
15910  __pyx_r = 0;
15911  __Pyx_RefNannyFinishContext();
15912  return __pyx_r;
15913 }
15914 
15915 /* Python wrapper */
15916 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_5__del__(PyObject *__pyx_v_self); /*proto*/
15917 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_5__del__(PyObject *__pyx_v_self) {
15918  int __pyx_r;
15919  __Pyx_RefNannyDeclarations
15920  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
15921  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_4__del__(((struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
15922 
15923  /* function exit code */
15924  __Pyx_RefNannyFinishContext();
15925  return __pyx_r;
15926 }
15927 
15928 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_4__del__(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
15929  int __pyx_r;
15930  __Pyx_RefNannyDeclarations
15931  __Pyx_RefNannySetupContext("__del__", 0);
15932  __Pyx_INCREF(Py_None);
15933  __Pyx_GIVEREF(Py_None);
15934  __Pyx_GOTREF(__pyx_v_self->pyCoefficients);
15935  __Pyx_DECREF(__pyx_v_self->pyCoefficients);
15936  __pyx_v_self->pyCoefficients = Py_None;
15937 
15938  /* function exit code */
15939  __pyx_r = 0;
15940  __Pyx_RefNannyFinishContext();
15941  return __pyx_r;
15942 }
15943 
15944 /* "mprans/cMoveMeshMonitor.pyx":18
15945  * cdef public:
15946  * object pyCoefficients
15947  * double C # <<<<<<<<<<<<<<
15948  *
15949  * def __cinit__(self):
15950  */
15951 
15952 /* Python wrapper */
15953 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_1__get__(PyObject *__pyx_v_self); /*proto*/
15954 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_1__get__(PyObject *__pyx_v_self) {
15955  PyObject *__pyx_r = 0;
15956  __Pyx_RefNannyDeclarations
15957  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15958  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_1C___get__(((struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
15959 
15960  /* function exit code */
15961  __Pyx_RefNannyFinishContext();
15962  return __pyx_r;
15963 }
15964 
15965 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_1C___get__(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
15966  PyObject *__pyx_r = NULL;
15967  __Pyx_RefNannyDeclarations
15968  PyObject *__pyx_t_1 = NULL;
15969  int __pyx_lineno = 0;
15970  const char *__pyx_filename = NULL;
15971  int __pyx_clineno = 0;
15972  __Pyx_RefNannySetupContext("__get__", 0);
15973  __Pyx_XDECREF(__pyx_r);
15974  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->C); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
15975  __Pyx_GOTREF(__pyx_t_1);
15976  __pyx_r = __pyx_t_1;
15977  __pyx_t_1 = 0;
15978  goto __pyx_L0;
15979 
15980  /* function exit code */
15981  __pyx_L1_error:;
15982  __Pyx_XDECREF(__pyx_t_1);
15983  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.C.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15984  __pyx_r = NULL;
15985  __pyx_L0:;
15986  __Pyx_XGIVEREF(__pyx_r);
15987  __Pyx_RefNannyFinishContext();
15988  return __pyx_r;
15989 }
15990 
15991 /* Python wrapper */
15992 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
15993 static int __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
15994  int __pyx_r;
15995  __Pyx_RefNannyDeclarations
15996  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
15997  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_2__set__(((struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self), ((PyObject *)__pyx_v_value));
15998 
15999  /* function exit code */
16000  __Pyx_RefNannyFinishContext();
16001  return __pyx_r;
16002 }
16003 
16004 static int __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_2__set__(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, PyObject *__pyx_v_value) {
16005  int __pyx_r;
16006  __Pyx_RefNannyDeclarations
16007  double __pyx_t_1;
16008  int __pyx_lineno = 0;
16009  const char *__pyx_filename = NULL;
16010  int __pyx_clineno = 0;
16011  __Pyx_RefNannySetupContext("__set__", 0);
16012  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L1_error)
16013  __pyx_v_self->C = __pyx_t_1;
16014 
16015  /* function exit code */
16016  __pyx_r = 0;
16017  goto __pyx_L0;
16018  __pyx_L1_error:;
16019  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.C.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16020  __pyx_r = -1;
16021  __pyx_L0:;
16022  __Pyx_RefNannyFinishContext();
16023  return __pyx_r;
16024 }
16025 
16026 /* "(tree fragment)":1
16027  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16028  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16029  * def __setstate_cython__(self, __pyx_state):
16030  */
16031 
16032 /* Python wrapper */
16033 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
16034 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16035  PyObject *__pyx_r = 0;
16036  __Pyx_RefNannyDeclarations
16037  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
16038  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_10__reduce_cython__(((struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self));
16039 
16040  /* function exit code */
16041  __Pyx_RefNannyFinishContext();
16042  return __pyx_r;
16043 }
16044 
16045 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self) {
16046  PyObject *__pyx_r = NULL;
16047  __Pyx_RefNannyDeclarations
16048  PyObject *__pyx_t_1 = NULL;
16049  int __pyx_lineno = 0;
16050  const char *__pyx_filename = NULL;
16051  int __pyx_clineno = 0;
16052  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
16053 
16054  /* "(tree fragment)":2
16055  * def __reduce_cython__(self):
16056  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16057  * def __setstate_cython__(self, __pyx_state):
16058  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16059  */
16060  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
16061  __Pyx_GOTREF(__pyx_t_1);
16062  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16063  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16064  __PYX_ERR(1, 2, __pyx_L1_error)
16065 
16066  /* "(tree fragment)":1
16067  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16068  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16069  * def __setstate_cython__(self, __pyx_state):
16070  */
16071 
16072  /* function exit code */
16073  __pyx_L1_error:;
16074  __Pyx_XDECREF(__pyx_t_1);
16075  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16076  __pyx_r = NULL;
16077  __Pyx_XGIVEREF(__pyx_r);
16078  __Pyx_RefNannyFinishContext();
16079  return __pyx_r;
16080 }
16081 
16082 /* "(tree fragment)":3
16083  * def __reduce_cython__(self):
16084  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16085  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16086  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16087  */
16088 
16089 /* Python wrapper */
16090 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
16091 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
16092  PyObject *__pyx_r = 0;
16093  __Pyx_RefNannyDeclarations
16094  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
16095  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_12__setstate_cython__(((struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
16096 
16097  /* function exit code */
16098  __Pyx_RefNannyFinishContext();
16099  return __pyx_r;
16100 }
16101 
16102 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_13cCoefficients_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
16103  PyObject *__pyx_r = NULL;
16104  __Pyx_RefNannyDeclarations
16105  PyObject *__pyx_t_1 = NULL;
16106  int __pyx_lineno = 0;
16107  const char *__pyx_filename = NULL;
16108  int __pyx_clineno = 0;
16109  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
16110 
16111  /* "(tree fragment)":4
16112  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16113  * def __setstate_cython__(self, __pyx_state):
16114  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16115  */
16116  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
16117  __Pyx_GOTREF(__pyx_t_1);
16118  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16119  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16120  __PYX_ERR(1, 4, __pyx_L1_error)
16121 
16122  /* "(tree fragment)":3
16123  * def __reduce_cython__(self):
16124  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16125  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16126  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16127  */
16128 
16129  /* function exit code */
16130  __pyx_L1_error:;
16131  __Pyx_XDECREF(__pyx_t_1);
16132  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cCoefficients.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16133  __pyx_r = NULL;
16134  __Pyx_XGIVEREF(__pyx_r);
16135  __Pyx_RefNannyFinishContext();
16136  return __pyx_r;
16137 }
16138 
16139 /* "mprans/cMoveMeshMonitor.pyx":944
16140  * # self.uOfXTatQuadrature[e, k] = f
16141  *
16142  * def recoveryAtNodes(double[:] scalars, # <<<<<<<<<<<<<<
16143  * int[:] nodeElementsArray,
16144  * int[:] nodeElementOffsets):
16145  */
16146 
16147 /* Python wrapper */
16148 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_1recoveryAtNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
16149 static PyMethodDef __pyx_mdef_6mprans_16cMoveMeshMonitor_1recoveryAtNodes = {"recoveryAtNodes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_16cMoveMeshMonitor_1recoveryAtNodes, METH_VARARGS|METH_KEYWORDS, 0};
16150 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_1recoveryAtNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16151  __Pyx_memviewslice __pyx_v_scalars = { 0, 0, { 0 }, { 0 }, { 0 } };
16152  __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
16153  __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
16154  int __pyx_lineno = 0;
16155  const char *__pyx_filename = NULL;
16156  int __pyx_clineno = 0;
16157  PyObject *__pyx_r = 0;
16158  __Pyx_RefNannyDeclarations
16159  __Pyx_RefNannySetupContext("recoveryAtNodes (wrapper)", 0);
16160  {
16161  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scalars,&__pyx_n_s_nodeElementsArray,&__pyx_n_s_nodeElementOffsets,0};
16162  PyObject* values[3] = {0,0,0};
16163  if (unlikely(__pyx_kwds)) {
16164  Py_ssize_t kw_args;
16165  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16166  switch (pos_args) {
16167  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16168  CYTHON_FALLTHROUGH;
16169  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16170  CYTHON_FALLTHROUGH;
16171  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16172  CYTHON_FALLTHROUGH;
16173  case 0: break;
16174  default: goto __pyx_L5_argtuple_error;
16175  }
16176  kw_args = PyDict_Size(__pyx_kwds);
16177  switch (pos_args) {
16178  case 0:
16179  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scalars)) != 0)) kw_args--;
16180  else goto __pyx_L5_argtuple_error;
16181  CYTHON_FALLTHROUGH;
16182  case 1:
16183  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
16184  else {
16185  __Pyx_RaiseArgtupleInvalid("recoveryAtNodes", 1, 3, 3, 1); __PYX_ERR(0, 944, __pyx_L3_error)
16186  }
16187  CYTHON_FALLTHROUGH;
16188  case 2:
16189  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
16190  else {
16191  __Pyx_RaiseArgtupleInvalid("recoveryAtNodes", 1, 3, 3, 2); __PYX_ERR(0, 944, __pyx_L3_error)
16192  }
16193  }
16194  if (unlikely(kw_args > 0)) {
16195  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "recoveryAtNodes") < 0)) __PYX_ERR(0, 944, __pyx_L3_error)
16196  }
16197  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
16198  goto __pyx_L5_argtuple_error;
16199  } else {
16200  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16201  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16202  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16203  }
16204  __pyx_v_scalars = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_scalars.memview)) __PYX_ERR(0, 944, __pyx_L3_error)
16205  __pyx_v_nodeElementsArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_nodeElementsArray.memview)) __PYX_ERR(0, 945, __pyx_L3_error)
16206  __pyx_v_nodeElementOffsets = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_nodeElementOffsets.memview)) __PYX_ERR(0, 946, __pyx_L3_error)
16207  }
16208  goto __pyx_L4_argument_unpacking_done;
16209  __pyx_L5_argtuple_error:;
16210  __Pyx_RaiseArgtupleInvalid("recoveryAtNodes", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 944, __pyx_L3_error)
16211  __pyx_L3_error:;
16212  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.recoveryAtNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
16213  __Pyx_RefNannyFinishContext();
16214  return NULL;
16215  __pyx_L4_argument_unpacking_done:;
16216  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_recoveryAtNodes(__pyx_self, __pyx_v_scalars, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets);
16217 
16218  /* function exit code */
16219  __Pyx_RefNannyFinishContext();
16220  return __pyx_r;
16221 }
16222 
16223 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_recoveryAtNodes(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_scalars, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets) {
16224  PyObject *__pyx_r = NULL;
16225  __Pyx_RefNannyDeclarations
16226  __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
16227  PyObject *__pyx_t_2 = NULL;
16228  int __pyx_lineno = 0;
16229  const char *__pyx_filename = NULL;
16230  int __pyx_clineno = 0;
16231  __Pyx_RefNannySetupContext("recoveryAtNodes", 0);
16232 
16233  /* "mprans/cMoveMeshMonitor.pyx":947
16234  * int[:] nodeElementsArray,
16235  * int[:] nodeElementOffsets):
16236  * return cppRecoveryAtNodes(scalars=scalars, # <<<<<<<<<<<<<<
16237  * nodeElementsArray=nodeElementsArray,
16238  * nodeElementOffsets=nodeElementOffsets)
16239  */
16240  __Pyx_XDECREF(__pyx_r);
16241 
16242  /* "mprans/cMoveMeshMonitor.pyx":949
16243  * return cppRecoveryAtNodes(scalars=scalars,
16244  * nodeElementsArray=nodeElementsArray,
16245  * nodeElementOffsets=nodeElementOffsets) # <<<<<<<<<<<<<<
16246  *
16247  * cdef double[:] cppRecoveryAtNodes(double[:] scalars,
16248  */
16249  __pyx_t_1 = __pyx_f_6mprans_16cMoveMeshMonitor_cppRecoveryAtNodes(__pyx_v_scalars, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 947, __pyx_L1_error)
16250 
16251  /* "mprans/cMoveMeshMonitor.pyx":947
16252  * int[:] nodeElementsArray,
16253  * int[:] nodeElementOffsets):
16254  * return cppRecoveryAtNodes(scalars=scalars, # <<<<<<<<<<<<<<
16255  * nodeElementsArray=nodeElementsArray,
16256  * nodeElementOffsets=nodeElementOffsets)
16257  */
16258  __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_t_1, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 947, __pyx_L1_error)
16259  __Pyx_GOTREF(__pyx_t_2);
16260  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
16261  __pyx_t_1.memview = NULL;
16262  __pyx_t_1.data = NULL;
16263  __pyx_r = __pyx_t_2;
16264  __pyx_t_2 = 0;
16265  goto __pyx_L0;
16266 
16267  /* "mprans/cMoveMeshMonitor.pyx":944
16268  * # self.uOfXTatQuadrature[e, k] = f
16269  *
16270  * def recoveryAtNodes(double[:] scalars, # <<<<<<<<<<<<<<
16271  * int[:] nodeElementsArray,
16272  * int[:] nodeElementOffsets):
16273  */
16274 
16275  /* function exit code */
16276  __pyx_L1_error:;
16277  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
16278  __Pyx_XDECREF(__pyx_t_2);
16279  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.recoveryAtNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
16280  __pyx_r = NULL;
16281  __pyx_L0:;
16282  __PYX_XDEC_MEMVIEW(&__pyx_v_scalars, 1);
16283  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementsArray, 1);
16284  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementOffsets, 1);
16285  __Pyx_XGIVEREF(__pyx_r);
16286  __Pyx_RefNannyFinishContext();
16287  return __pyx_r;
16288 }
16289 
16290 /* "mprans/cMoveMeshMonitor.pyx":951
16291  * nodeElementOffsets=nodeElementOffsets)
16292  *
16293  * cdef double[:] cppRecoveryAtNodes(double[:] scalars, # <<<<<<<<<<<<<<
16294  * int[:] nodeElementsArray,
16295  * int[:] nodeElementOffsets):
16296  */
16297 
16298 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppRecoveryAtNodes(__Pyx_memviewslice __pyx_v_scalars, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets) {
16299  __Pyx_memviewslice __pyx_v_recovered_scalars = { 0, 0, { 0 }, { 0 }, { 0 } };
16300  int __pyx_v_nb_el;
16301  double __pyx_v_var_sum;
16302  PyObject *__pyx_v_node = NULL;
16303  PyObject *__pyx_v_eOffset = NULL;
16304  __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
16305  __Pyx_RefNannyDeclarations
16306  PyObject *__pyx_t_1 = NULL;
16307  PyObject *__pyx_t_2 = NULL;
16308  PyObject *__pyx_t_3 = NULL;
16309  size_t __pyx_t_4;
16310  PyObject *__pyx_t_5 = NULL;
16311  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
16312  Py_ssize_t __pyx_t_7;
16313  PyObject *(*__pyx_t_8)(PyObject *);
16314  Py_ssize_t __pyx_t_9;
16315  Py_ssize_t __pyx_t_10;
16316  PyObject *(*__pyx_t_11)(PyObject *);
16317  Py_ssize_t __pyx_t_12;
16318  Py_ssize_t __pyx_t_13;
16319  int __pyx_lineno = 0;
16320  const char *__pyx_filename = NULL;
16321  int __pyx_clineno = 0;
16322  __Pyx_RefNannySetupContext("cppRecoveryAtNodes", 0);
16323 
16324  /* "mprans/cMoveMeshMonitor.pyx":958
16325  * Scalar in element
16326  * """
16327  * cdef double[:] recovered_scalars = np.zeros(len(nodeElementOffsets)-1) # <<<<<<<<<<<<<<
16328  * cdef int nb_el
16329  * cdef double var_sum
16330  */
16331  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error)
16332  __Pyx_GOTREF(__pyx_t_2);
16333  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 958, __pyx_L1_error)
16334  __Pyx_GOTREF(__pyx_t_3);
16335  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16336  __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_nodeElementOffsets);
16337  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error)
16338  __Pyx_GOTREF(__pyx_t_2);
16339  __pyx_t_5 = NULL;
16340  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
16341  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
16342  if (likely(__pyx_t_5)) {
16343  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
16344  __Pyx_INCREF(__pyx_t_5);
16345  __Pyx_INCREF(function);
16346  __Pyx_DECREF_SET(__pyx_t_3, function);
16347  }
16348  }
16349  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
16350  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16351  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16352  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __pyx_L1_error)
16353  __Pyx_GOTREF(__pyx_t_1);
16354  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16355  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 958, __pyx_L1_error)
16356  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16357  __pyx_v_recovered_scalars = __pyx_t_6;
16358  __pyx_t_6.memview = NULL;
16359  __pyx_t_6.data = NULL;
16360 
16361  /* "mprans/cMoveMeshMonitor.pyx":961
16362  * cdef int nb_el
16363  * cdef double var_sum
16364  * for node in range(len(nodeElementOffsets)-1): # <<<<<<<<<<<<<<
16365  * nb_el = 0
16366  * var_sum = 0
16367  */
16368  __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_nodeElementOffsets);
16369  __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
16370  __Pyx_GOTREF(__pyx_t_1);
16371  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error)
16372  __Pyx_GOTREF(__pyx_t_3);
16373  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16374  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
16375  __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
16376  __pyx_t_8 = NULL;
16377  } else {
16378  __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
16379  __Pyx_GOTREF(__pyx_t_1);
16380  __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 961, __pyx_L1_error)
16381  }
16382  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16383  for (;;) {
16384  if (likely(!__pyx_t_8)) {
16385  if (likely(PyList_CheckExact(__pyx_t_1))) {
16386  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
16387  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16388  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 961, __pyx_L1_error)
16389  #else
16390  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error)
16391  __Pyx_GOTREF(__pyx_t_3);
16392  #endif
16393  } else {
16394  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
16395  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16396  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 961, __pyx_L1_error)
16397  #else
16398  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error)
16399  __Pyx_GOTREF(__pyx_t_3);
16400  #endif
16401  }
16402  } else {
16403  __pyx_t_3 = __pyx_t_8(__pyx_t_1);
16404  if (unlikely(!__pyx_t_3)) {
16405  PyObject* exc_type = PyErr_Occurred();
16406  if (exc_type) {
16407  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16408  else __PYX_ERR(0, 961, __pyx_L1_error)
16409  }
16410  break;
16411  }
16412  __Pyx_GOTREF(__pyx_t_3);
16413  }
16414  __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_3);
16415  __pyx_t_3 = 0;
16416 
16417  /* "mprans/cMoveMeshMonitor.pyx":962
16418  * cdef double var_sum
16419  * for node in range(len(nodeElementOffsets)-1):
16420  * nb_el = 0 # <<<<<<<<<<<<<<
16421  * var_sum = 0
16422  * for eOffset in range(nodeElementOffsets[node],
16423  */
16424  __pyx_v_nb_el = 0;
16425 
16426  /* "mprans/cMoveMeshMonitor.pyx":963
16427  * for node in range(len(nodeElementOffsets)-1):
16428  * nb_el = 0
16429  * var_sum = 0 # <<<<<<<<<<<<<<
16430  * for eOffset in range(nodeElementOffsets[node],
16431  * nodeElementOffsets[node+1]):
16432  */
16433  __pyx_v_var_sum = 0.0;
16434 
16435  /* "mprans/cMoveMeshMonitor.pyx":964
16436  * nb_el = 0
16437  * var_sum = 0
16438  * for eOffset in range(nodeElementOffsets[node], # <<<<<<<<<<<<<<
16439  * nodeElementOffsets[node+1]):
16440  * nb_el += 1
16441  */
16442  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_node); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 964, __pyx_L1_error)
16443  __pyx_t_10 = __pyx_t_9;
16444  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeElementOffsets.shape[0];
16445  __pyx_t_3 = __Pyx_PyInt_From_int((*((int *) ( /* dim=0 */ (__pyx_v_nodeElementOffsets.data + __pyx_t_10 * __pyx_v_nodeElementOffsets.strides[0]) )))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 964, __pyx_L1_error)
16446  __Pyx_GOTREF(__pyx_t_3);
16447 
16448  /* "mprans/cMoveMeshMonitor.pyx":965
16449  * var_sum = 0
16450  * for eOffset in range(nodeElementOffsets[node],
16451  * nodeElementOffsets[node+1]): # <<<<<<<<<<<<<<
16452  * nb_el += 1
16453  * var_sum += scalars[nodeElementsArray[eOffset]]
16454  */
16455  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_node, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error)
16456  __Pyx_GOTREF(__pyx_t_2);
16457  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L1_error)
16458  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16459  __pyx_t_10 = __pyx_t_9;
16460  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeElementOffsets.shape[0];
16461  __pyx_t_2 = __Pyx_PyInt_From_int((*((int *) ( /* dim=0 */ (__pyx_v_nodeElementOffsets.data + __pyx_t_10 * __pyx_v_nodeElementOffsets.strides[0]) )))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error)
16462  __Pyx_GOTREF(__pyx_t_2);
16463 
16464  /* "mprans/cMoveMeshMonitor.pyx":964
16465  * nb_el = 0
16466  * var_sum = 0
16467  * for eOffset in range(nodeElementOffsets[node], # <<<<<<<<<<<<<<
16468  * nodeElementOffsets[node+1]):
16469  * nb_el += 1
16470  */
16471  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 964, __pyx_L1_error)
16472  __Pyx_GOTREF(__pyx_t_5);
16473  __Pyx_GIVEREF(__pyx_t_3);
16474  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
16475  __Pyx_GIVEREF(__pyx_t_2);
16476  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
16477  __pyx_t_3 = 0;
16478  __pyx_t_2 = 0;
16479  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
16480  __Pyx_GOTREF(__pyx_t_2);
16481  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16482  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
16483  __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
16484  __pyx_t_11 = NULL;
16485  } else {
16486  __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 964, __pyx_L1_error)
16487  __Pyx_GOTREF(__pyx_t_5);
16488  __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 964, __pyx_L1_error)
16489  }
16490  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16491  for (;;) {
16492  if (likely(!__pyx_t_11)) {
16493  if (likely(PyList_CheckExact(__pyx_t_5))) {
16494  if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
16495  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16496  __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 964, __pyx_L1_error)
16497  #else
16498  __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
16499  __Pyx_GOTREF(__pyx_t_2);
16500  #endif
16501  } else {
16502  if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
16503  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16504  __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 964, __pyx_L1_error)
16505  #else
16506  __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
16507  __Pyx_GOTREF(__pyx_t_2);
16508  #endif
16509  }
16510  } else {
16511  __pyx_t_2 = __pyx_t_11(__pyx_t_5);
16512  if (unlikely(!__pyx_t_2)) {
16513  PyObject* exc_type = PyErr_Occurred();
16514  if (exc_type) {
16515  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16516  else __PYX_ERR(0, 964, __pyx_L1_error)
16517  }
16518  break;
16519  }
16520  __Pyx_GOTREF(__pyx_t_2);
16521  }
16522  __Pyx_XDECREF_SET(__pyx_v_eOffset, __pyx_t_2);
16523  __pyx_t_2 = 0;
16524 
16525  /* "mprans/cMoveMeshMonitor.pyx":966
16526  * for eOffset in range(nodeElementOffsets[node],
16527  * nodeElementOffsets[node+1]):
16528  * nb_el += 1 # <<<<<<<<<<<<<<
16529  * var_sum += scalars[nodeElementsArray[eOffset]]
16530  * recovered_scalars[node] = var_sum/nb_el
16531  */
16532  __pyx_v_nb_el = (__pyx_v_nb_el + 1);
16533 
16534  /* "mprans/cMoveMeshMonitor.pyx":967
16535  * nodeElementOffsets[node+1]):
16536  * nb_el += 1
16537  * var_sum += scalars[nodeElementsArray[eOffset]] # <<<<<<<<<<<<<<
16538  * recovered_scalars[node] = var_sum/nb_el
16539  * return recovered_scalars
16540  */
16541  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eOffset); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 967, __pyx_L1_error)
16542  __pyx_t_10 = __pyx_t_12;
16543  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_nodeElementsArray.shape[0];
16544  __pyx_t_13 = (*((int *) ( /* dim=0 */ (__pyx_v_nodeElementsArray.data + __pyx_t_10 * __pyx_v_nodeElementsArray.strides[0]) )));
16545  if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_scalars.shape[0];
16546  __pyx_v_var_sum = (__pyx_v_var_sum + (*((double *) ( /* dim=0 */ (__pyx_v_scalars.data + __pyx_t_13 * __pyx_v_scalars.strides[0]) ))));
16547 
16548  /* "mprans/cMoveMeshMonitor.pyx":964
16549  * nb_el = 0
16550  * var_sum = 0
16551  * for eOffset in range(nodeElementOffsets[node], # <<<<<<<<<<<<<<
16552  * nodeElementOffsets[node+1]):
16553  * nb_el += 1
16554  */
16555  }
16556  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16557 
16558  /* "mprans/cMoveMeshMonitor.pyx":968
16559  * nb_el += 1
16560  * var_sum += scalars[nodeElementsArray[eOffset]]
16561  * recovered_scalars[node] = var_sum/nb_el # <<<<<<<<<<<<<<
16562  * return recovered_scalars
16563  *
16564  */
16565  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_node); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 968, __pyx_L1_error)
16566  __pyx_t_10 = __pyx_t_9;
16567  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_recovered_scalars.shape[0];
16568  *((double *) ( /* dim=0 */ (__pyx_v_recovered_scalars.data + __pyx_t_10 * __pyx_v_recovered_scalars.strides[0]) )) = (__pyx_v_var_sum / __pyx_v_nb_el);
16569 
16570  /* "mprans/cMoveMeshMonitor.pyx":961
16571  * cdef int nb_el
16572  * cdef double var_sum
16573  * for node in range(len(nodeElementOffsets)-1): # <<<<<<<<<<<<<<
16574  * nb_el = 0
16575  * var_sum = 0
16576  */
16577  }
16578  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16579 
16580  /* "mprans/cMoveMeshMonitor.pyx":969
16581  * var_sum += scalars[nodeElementsArray[eOffset]]
16582  * recovered_scalars[node] = var_sum/nb_el
16583  * return recovered_scalars # <<<<<<<<<<<<<<
16584  *
16585  * def recoveryAtNodesWeighted(double[:] scalars,
16586  */
16587  __PYX_INC_MEMVIEW(&__pyx_v_recovered_scalars, 0);
16588  __pyx_r = __pyx_v_recovered_scalars;
16589  goto __pyx_L0;
16590 
16591  /* "mprans/cMoveMeshMonitor.pyx":951
16592  * nodeElementOffsets=nodeElementOffsets)
16593  *
16594  * cdef double[:] cppRecoveryAtNodes(double[:] scalars, # <<<<<<<<<<<<<<
16595  * int[:] nodeElementsArray,
16596  * int[:] nodeElementOffsets):
16597  */
16598 
16599  /* function exit code */
16600  __pyx_L1_error:;
16601  __Pyx_XDECREF(__pyx_t_1);
16602  __Pyx_XDECREF(__pyx_t_2);
16603  __Pyx_XDECREF(__pyx_t_3);
16604  __Pyx_XDECREF(__pyx_t_5);
16605  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
16606  __pyx_r.data = NULL;
16607  __pyx_r.memview = NULL;
16608  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cppRecoveryAtNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
16609  goto __pyx_L2;
16610  __pyx_L0:;
16611  if (unlikely(!__pyx_r.memview)) {
16612  PyErr_SetString(PyExc_TypeError, "Memoryview return value is not initialized");
16613  }
16614  __pyx_L2:;
16615  __PYX_XDEC_MEMVIEW(&__pyx_v_recovered_scalars, 1);
16616  __Pyx_XDECREF(__pyx_v_node);
16617  __Pyx_XDECREF(__pyx_v_eOffset);
16618  __Pyx_RefNannyFinishContext();
16619  return __pyx_r;
16620 }
16621 
16622 /* "mprans/cMoveMeshMonitor.pyx":971
16623  * return recovered_scalars
16624  *
16625  * def recoveryAtNodesWeighted(double[:] scalars, # <<<<<<<<<<<<<<
16626  * int[:] nodeElementsArray,
16627  * int[:] nodeElementOffsets,
16628  */
16629 
16630 /* Python wrapper */
16631 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_3recoveryAtNodesWeighted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
16632 static PyMethodDef __pyx_mdef_6mprans_16cMoveMeshMonitor_3recoveryAtNodesWeighted = {"recoveryAtNodesWeighted", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_16cMoveMeshMonitor_3recoveryAtNodesWeighted, METH_VARARGS|METH_KEYWORDS, 0};
16633 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_3recoveryAtNodesWeighted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16634  __Pyx_memviewslice __pyx_v_scalars = { 0, 0, { 0 }, { 0 }, { 0 } };
16635  __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
16636  __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
16637  __Pyx_memviewslice __pyx_v_detJ_array = { 0, 0, { 0 }, { 0 }, { 0 } };
16638  int __pyx_v_nNodes;
16639  int __pyx_lineno = 0;
16640  const char *__pyx_filename = NULL;
16641  int __pyx_clineno = 0;
16642  PyObject *__pyx_r = 0;
16643  __Pyx_RefNannyDeclarations
16644  __Pyx_RefNannySetupContext("recoveryAtNodesWeighted (wrapper)", 0);
16645  {
16646  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scalars,&__pyx_n_s_nodeElementsArray,&__pyx_n_s_nodeElementOffsets,&__pyx_n_s_detJ_array,&__pyx_n_s_nNodes,0};
16647  PyObject* values[5] = {0,0,0,0,0};
16648  if (unlikely(__pyx_kwds)) {
16649  Py_ssize_t kw_args;
16650  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16651  switch (pos_args) {
16652  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16653  CYTHON_FALLTHROUGH;
16654  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16655  CYTHON_FALLTHROUGH;
16656  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16657  CYTHON_FALLTHROUGH;
16658  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16659  CYTHON_FALLTHROUGH;
16660  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16661  CYTHON_FALLTHROUGH;
16662  case 0: break;
16663  default: goto __pyx_L5_argtuple_error;
16664  }
16665  kw_args = PyDict_Size(__pyx_kwds);
16666  switch (pos_args) {
16667  case 0:
16668  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scalars)) != 0)) kw_args--;
16669  else goto __pyx_L5_argtuple_error;
16670  CYTHON_FALLTHROUGH;
16671  case 1:
16672  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
16673  else {
16674  __Pyx_RaiseArgtupleInvalid("recoveryAtNodesWeighted", 1, 5, 5, 1); __PYX_ERR(0, 971, __pyx_L3_error)
16675  }
16676  CYTHON_FALLTHROUGH;
16677  case 2:
16678  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
16679  else {
16680  __Pyx_RaiseArgtupleInvalid("recoveryAtNodesWeighted", 1, 5, 5, 2); __PYX_ERR(0, 971, __pyx_L3_error)
16681  }
16682  CYTHON_FALLTHROUGH;
16683  case 3:
16684  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_detJ_array)) != 0)) kw_args--;
16685  else {
16686  __Pyx_RaiseArgtupleInvalid("recoveryAtNodesWeighted", 1, 5, 5, 3); __PYX_ERR(0, 971, __pyx_L3_error)
16687  }
16688  CYTHON_FALLTHROUGH;
16689  case 4:
16690  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nNodes)) != 0)) kw_args--;
16691  else {
16692  __Pyx_RaiseArgtupleInvalid("recoveryAtNodesWeighted", 1, 5, 5, 4); __PYX_ERR(0, 971, __pyx_L3_error)
16693  }
16694  }
16695  if (unlikely(kw_args > 0)) {
16696  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "recoveryAtNodesWeighted") < 0)) __PYX_ERR(0, 971, __pyx_L3_error)
16697  }
16698  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
16699  goto __pyx_L5_argtuple_error;
16700  } else {
16701  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16702  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16703  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16704  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16705  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16706  }
16707  __pyx_v_scalars = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_scalars.memview)) __PYX_ERR(0, 971, __pyx_L3_error)
16708  __pyx_v_nodeElementsArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_nodeElementsArray.memview)) __PYX_ERR(0, 972, __pyx_L3_error)
16709  __pyx_v_nodeElementOffsets = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_nodeElementOffsets.memview)) __PYX_ERR(0, 973, __pyx_L3_error)
16710  __pyx_v_detJ_array = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_detJ_array.memview)) __PYX_ERR(0, 974, __pyx_L3_error)
16711  __pyx_v_nNodes = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_nNodes == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 975, __pyx_L3_error)
16712  }
16713  goto __pyx_L4_argument_unpacking_done;
16714  __pyx_L5_argtuple_error:;
16715  __Pyx_RaiseArgtupleInvalid("recoveryAtNodesWeighted", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 971, __pyx_L3_error)
16716  __pyx_L3_error:;
16717  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.recoveryAtNodesWeighted", __pyx_clineno, __pyx_lineno, __pyx_filename);
16718  __Pyx_RefNannyFinishContext();
16719  return NULL;
16720  __pyx_L4_argument_unpacking_done:;
16721  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_2recoveryAtNodesWeighted(__pyx_self, __pyx_v_scalars, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets, __pyx_v_detJ_array, __pyx_v_nNodes);
16722 
16723  /* function exit code */
16724  __Pyx_RefNannyFinishContext();
16725  return __pyx_r;
16726 }
16727 
16728 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_2recoveryAtNodesWeighted(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) {
16729  PyObject *__pyx_r = NULL;
16730  __Pyx_RefNannyDeclarations
16731  __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
16732  PyObject *__pyx_t_2 = NULL;
16733  int __pyx_lineno = 0;
16734  const char *__pyx_filename = NULL;
16735  int __pyx_clineno = 0;
16736  __Pyx_RefNannySetupContext("recoveryAtNodesWeighted", 0);
16737 
16738  /* "mprans/cMoveMeshMonitor.pyx":976
16739  * double[:] detJ_array,
16740  * int nNodes):
16741  * return cppRecoveryAtNodesWeighted(scalars=scalars, # <<<<<<<<<<<<<<
16742  * nodeElementsArray=nodeElementsArray,
16743  * nodeElementOffsets=nodeElementOffsets,
16744  */
16745  __Pyx_XDECREF(__pyx_r);
16746 
16747  /* "mprans/cMoveMeshMonitor.pyx":980
16748  * nodeElementOffsets=nodeElementOffsets,
16749  * detJ_array=detJ_array,
16750  * nNodes=nNodes) # <<<<<<<<<<<<<<
16751  *
16752  * cdef double[:] cppRecoveryAtNodesWeighted(double[:] scalars,
16753  */
16754  __pyx_t_1 = __pyx_f_6mprans_16cMoveMeshMonitor_cppRecoveryAtNodesWeighted(__pyx_v_scalars, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets, __pyx_v_detJ_array, __pyx_v_nNodes); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 976, __pyx_L1_error)
16755 
16756  /* "mprans/cMoveMeshMonitor.pyx":976
16757  * double[:] detJ_array,
16758  * int nNodes):
16759  * return cppRecoveryAtNodesWeighted(scalars=scalars, # <<<<<<<<<<<<<<
16760  * nodeElementsArray=nodeElementsArray,
16761  * nodeElementOffsets=nodeElementOffsets,
16762  */
16763  __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_t_1, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
16764  __Pyx_GOTREF(__pyx_t_2);
16765  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
16766  __pyx_t_1.memview = NULL;
16767  __pyx_t_1.data = NULL;
16768  __pyx_r = __pyx_t_2;
16769  __pyx_t_2 = 0;
16770  goto __pyx_L0;
16771 
16772  /* "mprans/cMoveMeshMonitor.pyx":971
16773  * return recovered_scalars
16774  *
16775  * def recoveryAtNodesWeighted(double[:] scalars, # <<<<<<<<<<<<<<
16776  * int[:] nodeElementsArray,
16777  * int[:] nodeElementOffsets,
16778  */
16779 
16780  /* function exit code */
16781  __pyx_L1_error:;
16782  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
16783  __Pyx_XDECREF(__pyx_t_2);
16784  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.recoveryAtNodesWeighted", __pyx_clineno, __pyx_lineno, __pyx_filename);
16785  __pyx_r = NULL;
16786  __pyx_L0:;
16787  __PYX_XDEC_MEMVIEW(&__pyx_v_scalars, 1);
16788  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementsArray, 1);
16789  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementOffsets, 1);
16790  __PYX_XDEC_MEMVIEW(&__pyx_v_detJ_array, 1);
16791  __Pyx_XGIVEREF(__pyx_r);
16792  __Pyx_RefNannyFinishContext();
16793  return __pyx_r;
16794 }
16795 
16796 /* "mprans/cMoveMeshMonitor.pyx":982
16797  * nNodes=nNodes)
16798  *
16799  * cdef double[:] cppRecoveryAtNodesWeighted(double[:] scalars, # <<<<<<<<<<<<<<
16800  * int[:] nodeElementsArray,
16801  * int[:] nodeElementOffsets,
16802  */
16803 
16804 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppRecoveryAtNodesWeighted(__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) {
16805  __Pyx_memviewslice __pyx_v_recovered_scalars = { 0, 0, { 0 }, { 0 }, { 0 } };
16806  int __pyx_v_nb_el;
16807  double __pyx_v_detJ_patch;
16808  double __pyx_v_scalar_sum;
16809  int __pyx_v_node;
16810  int __pyx_v_eOffset;
16811  int __pyx_v_eN;
16812  __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
16813  __Pyx_RefNannyDeclarations
16814  PyObject *__pyx_t_1 = NULL;
16815  PyObject *__pyx_t_2 = NULL;
16816  PyObject *__pyx_t_3 = NULL;
16817  PyObject *__pyx_t_4 = NULL;
16818  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
16819  int __pyx_t_6;
16820  int __pyx_t_7;
16821  int __pyx_t_8;
16822  Py_ssize_t __pyx_t_9;
16823  int __pyx_t_10;
16824  int __pyx_t_11;
16825  int __pyx_t_12;
16826  Py_ssize_t __pyx_t_13;
16827  Py_ssize_t __pyx_t_14;
16828  int __pyx_lineno = 0;
16829  const char *__pyx_filename = NULL;
16830  int __pyx_clineno = 0;
16831  __Pyx_RefNannySetupContext("cppRecoveryAtNodesWeighted", 0);
16832 
16833  /* "mprans/cMoveMeshMonitor.pyx":987
16834  * double[:] detJ_array,
16835  * int nNodes):
16836  * cdef double[:] recovered_scalars = np.zeros(nNodes) # <<<<<<<<<<<<<<
16837  * cdef int nb_el
16838  * cdef double detJ_patch = 0.
16839  */
16840  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error)
16841  __Pyx_GOTREF(__pyx_t_2);
16842  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 987, __pyx_L1_error)
16843  __Pyx_GOTREF(__pyx_t_3);
16844  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16845  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nNodes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error)
16846  __Pyx_GOTREF(__pyx_t_2);
16847  __pyx_t_4 = NULL;
16848  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
16849  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
16850  if (likely(__pyx_t_4)) {
16851  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
16852  __Pyx_INCREF(__pyx_t_4);
16853  __Pyx_INCREF(function);
16854  __Pyx_DECREF_SET(__pyx_t_3, function);
16855  }
16856  }
16857  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
16858  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16859  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16860  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error)
16861  __Pyx_GOTREF(__pyx_t_1);
16862  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16863  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 987, __pyx_L1_error)
16864  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16865  __pyx_v_recovered_scalars = __pyx_t_5;
16866  __pyx_t_5.memview = NULL;
16867  __pyx_t_5.data = NULL;
16868 
16869  /* "mprans/cMoveMeshMonitor.pyx":989
16870  * cdef double[:] recovered_scalars = np.zeros(nNodes)
16871  * cdef int nb_el
16872  * cdef double detJ_patch = 0. # <<<<<<<<<<<<<<
16873  * cdef double scalar_sum = 0.
16874  * cdef int node
16875  */
16876  __pyx_v_detJ_patch = 0.;
16877 
16878  /* "mprans/cMoveMeshMonitor.pyx":990
16879  * cdef int nb_el
16880  * cdef double detJ_patch = 0.
16881  * cdef double scalar_sum = 0. # <<<<<<<<<<<<<<
16882  * cdef int node
16883  * cdef int eOffset
16884  */
16885  __pyx_v_scalar_sum = 0.;
16886 
16887  /* "mprans/cMoveMeshMonitor.pyx":994
16888  * cdef int eOffset
16889  * cdef int eN
16890  * for node in range(nNodes): # <<<<<<<<<<<<<<
16891  * nb_el = 0
16892  * detJ_patch = 0.
16893  */
16894  __pyx_t_6 = __pyx_v_nNodes;
16895  __pyx_t_7 = __pyx_t_6;
16896  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
16897  __pyx_v_node = __pyx_t_8;
16898 
16899  /* "mprans/cMoveMeshMonitor.pyx":995
16900  * cdef int eN
16901  * for node in range(nNodes):
16902  * nb_el = 0 # <<<<<<<<<<<<<<
16903  * detJ_patch = 0.
16904  * scalar_sum = 0.
16905  */
16906  __pyx_v_nb_el = 0;
16907 
16908  /* "mprans/cMoveMeshMonitor.pyx":996
16909  * for node in range(nNodes):
16910  * nb_el = 0
16911  * detJ_patch = 0. # <<<<<<<<<<<<<<
16912  * scalar_sum = 0.
16913  * for eOffset in range(nodeElementOffsets[node],
16914  */
16915  __pyx_v_detJ_patch = 0.;
16916 
16917  /* "mprans/cMoveMeshMonitor.pyx":997
16918  * nb_el = 0
16919  * detJ_patch = 0.
16920  * scalar_sum = 0. # <<<<<<<<<<<<<<
16921  * for eOffset in range(nodeElementOffsets[node],
16922  * nodeElementOffsets[node+1]):
16923  */
16924  __pyx_v_scalar_sum = 0.;
16925 
16926  /* "mprans/cMoveMeshMonitor.pyx":999
16927  * scalar_sum = 0.
16928  * for eOffset in range(nodeElementOffsets[node],
16929  * nodeElementOffsets[node+1]): # <<<<<<<<<<<<<<
16930  * nb_el += 1
16931  * eN = nodeElementsArray[eOffset]
16932  */
16933  __pyx_t_9 = (__pyx_v_node + 1);
16934  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_nodeElementOffsets.shape[0];
16935  __pyx_t_10 = (*((int *) ( /* dim=0 */ (__pyx_v_nodeElementOffsets.data + __pyx_t_9 * __pyx_v_nodeElementOffsets.strides[0]) )));
16936 
16937  /* "mprans/cMoveMeshMonitor.pyx":998
16938  * detJ_patch = 0.
16939  * scalar_sum = 0.
16940  * for eOffset in range(nodeElementOffsets[node], # <<<<<<<<<<<<<<
16941  * nodeElementOffsets[node+1]):
16942  * nb_el += 1
16943  */
16944  __pyx_t_9 = __pyx_v_node;
16945  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_nodeElementOffsets.shape[0];
16946 
16947  /* "mprans/cMoveMeshMonitor.pyx":999
16948  * scalar_sum = 0.
16949  * for eOffset in range(nodeElementOffsets[node],
16950  * nodeElementOffsets[node+1]): # <<<<<<<<<<<<<<
16951  * nb_el += 1
16952  * eN = nodeElementsArray[eOffset]
16953  */
16954  __pyx_t_11 = __pyx_t_10;
16955  for (__pyx_t_12 = (*((int *) ( /* dim=0 */ (__pyx_v_nodeElementOffsets.data + __pyx_t_9 * __pyx_v_nodeElementOffsets.strides[0]) ))); __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
16956 
16957  /* "mprans/cMoveMeshMonitor.pyx":998
16958  * detJ_patch = 0.
16959  * scalar_sum = 0.
16960  * for eOffset in range(nodeElementOffsets[node], # <<<<<<<<<<<<<<
16961  * nodeElementOffsets[node+1]):
16962  * nb_el += 1
16963  */
16964  __pyx_v_eOffset = __pyx_t_12;
16965 
16966  /* "mprans/cMoveMeshMonitor.pyx":1000
16967  * for eOffset in range(nodeElementOffsets[node],
16968  * nodeElementOffsets[node+1]):
16969  * nb_el += 1 # <<<<<<<<<<<<<<
16970  * eN = nodeElementsArray[eOffset]
16971  * # for k in range(n_quad):
16972  */
16973  __pyx_v_nb_el = (__pyx_v_nb_el + 1);
16974 
16975  /* "mprans/cMoveMeshMonitor.pyx":1001
16976  * nodeElementOffsets[node+1]):
16977  * nb_el += 1
16978  * eN = nodeElementsArray[eOffset] # <<<<<<<<<<<<<<
16979  * # for k in range(n_quad):
16980  * # scalar_k = gradrads[eN, k]
16981  */
16982  __pyx_t_13 = __pyx_v_eOffset;
16983  if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_nodeElementsArray.shape[0];
16984  __pyx_v_eN = (*((int *) ( /* dim=0 */ (__pyx_v_nodeElementsArray.data + __pyx_t_13 * __pyx_v_nodeElementsArray.strides[0]) )));
16985 
16986  /* "mprans/cMoveMeshMonitor.pyx":1006
16987  * # scalar_eN_av += gradrad_k
16988  * # scalar_eN_av /= n_quad
16989  * detJ_patch += detJ_array[eN] # <<<<<<<<<<<<<<
16990  * scalar_sum += detJ_array[eN]*scalars[eN] # same value at all quad points
16991  * recovered_scalars[node] = scalar_sum/detJ_patch
16992  */
16993  __pyx_t_13 = __pyx_v_eN;
16994  if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_detJ_array.shape[0];
16995  __pyx_v_detJ_patch = (__pyx_v_detJ_patch + (*((double *) ( /* dim=0 */ (__pyx_v_detJ_array.data + __pyx_t_13 * __pyx_v_detJ_array.strides[0]) ))));
16996 
16997  /* "mprans/cMoveMeshMonitor.pyx":1007
16998  * # scalar_eN_av /= n_quad
16999  * detJ_patch += detJ_array[eN]
17000  * scalar_sum += detJ_array[eN]*scalars[eN] # same value at all quad points # <<<<<<<<<<<<<<
17001  * recovered_scalars[node] = scalar_sum/detJ_patch
17002  * return recovered_scalars
17003  */
17004  __pyx_t_13 = __pyx_v_eN;
17005  if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_detJ_array.shape[0];
17006  __pyx_t_14 = __pyx_v_eN;
17007  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_scalars.shape[0];
17008  __pyx_v_scalar_sum = (__pyx_v_scalar_sum + ((*((double *) ( /* dim=0 */ (__pyx_v_detJ_array.data + __pyx_t_13 * __pyx_v_detJ_array.strides[0]) ))) * (*((double *) ( /* dim=0 */ (__pyx_v_scalars.data + __pyx_t_14 * __pyx_v_scalars.strides[0]) )))));
17009  }
17010 
17011  /* "mprans/cMoveMeshMonitor.pyx":1008
17012  * detJ_patch += detJ_array[eN]
17013  * scalar_sum += detJ_array[eN]*scalars[eN] # same value at all quad points
17014  * recovered_scalars[node] = scalar_sum/detJ_patch # <<<<<<<<<<<<<<
17015  * return recovered_scalars
17016  *
17017  */
17018  __pyx_t_9 = __pyx_v_node;
17019  if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_recovered_scalars.shape[0];
17020  *((double *) ( /* dim=0 */ (__pyx_v_recovered_scalars.data + __pyx_t_9 * __pyx_v_recovered_scalars.strides[0]) )) = (__pyx_v_scalar_sum / __pyx_v_detJ_patch);
17021  }
17022 
17023  /* "mprans/cMoveMeshMonitor.pyx":1009
17024  * scalar_sum += detJ_array[eN]*scalars[eN] # same value at all quad points
17025  * recovered_scalars[node] = scalar_sum/detJ_patch
17026  * return recovered_scalars # <<<<<<<<<<<<<<
17027  *
17028  *
17029  */
17030  __PYX_INC_MEMVIEW(&__pyx_v_recovered_scalars, 0);
17031  __pyx_r = __pyx_v_recovered_scalars;
17032  goto __pyx_L0;
17033 
17034  /* "mprans/cMoveMeshMonitor.pyx":982
17035  * nNodes=nNodes)
17036  *
17037  * cdef double[:] cppRecoveryAtNodesWeighted(double[:] scalars, # <<<<<<<<<<<<<<
17038  * int[:] nodeElementsArray,
17039  * int[:] nodeElementOffsets,
17040  */
17041 
17042  /* function exit code */
17043  __pyx_L1_error:;
17044  __Pyx_XDECREF(__pyx_t_1);
17045  __Pyx_XDECREF(__pyx_t_2);
17046  __Pyx_XDECREF(__pyx_t_3);
17047  __Pyx_XDECREF(__pyx_t_4);
17048  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
17049  __pyx_r.data = NULL;
17050  __pyx_r.memview = NULL;
17051  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cppRecoveryAtNodesWeighted", __pyx_clineno, __pyx_lineno, __pyx_filename);
17052  goto __pyx_L2;
17053  __pyx_L0:;
17054  if (unlikely(!__pyx_r.memview)) {
17055  PyErr_SetString(PyExc_TypeError, "Memoryview return value is not initialized");
17056  }
17057  __pyx_L2:;
17058  __PYX_XDEC_MEMVIEW(&__pyx_v_recovered_scalars, 1);
17059  __Pyx_RefNannyFinishContext();
17060  return __pyx_r;
17061 }
17062 
17063 /* "mprans/cMoveMeshMonitor.pyx":1012
17064  *
17065  *
17066  * def gradientRecoveryAtNodes(grads, # <<<<<<<<<<<<<<
17067  * nodeElementsArray,
17068  * nodeElementOffsets,
17069  */
17070 
17071 /* Python wrapper */
17072 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_5gradientRecoveryAtNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17073 static PyMethodDef __pyx_mdef_6mprans_16cMoveMeshMonitor_5gradientRecoveryAtNodes = {"gradientRecoveryAtNodes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_16cMoveMeshMonitor_5gradientRecoveryAtNodes, METH_VARARGS|METH_KEYWORDS, 0};
17074 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_5gradientRecoveryAtNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17075  PyObject *__pyx_v_grads = 0;
17076  PyObject *__pyx_v_nodeElementsArray = 0;
17077  PyObject *__pyx_v_nodeElementOffsets = 0;
17078  PyObject *__pyx_v_nd = 0;
17079  int __pyx_lineno = 0;
17080  const char *__pyx_filename = NULL;
17081  int __pyx_clineno = 0;
17082  PyObject *__pyx_r = 0;
17083  __Pyx_RefNannyDeclarations
17084  __Pyx_RefNannySetupContext("gradientRecoveryAtNodes (wrapper)", 0);
17085  {
17086  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grads,&__pyx_n_s_nodeElementsArray,&__pyx_n_s_nodeElementOffsets,&__pyx_n_s_nd,0};
17087  PyObject* values[4] = {0,0,0,0};
17088  if (unlikely(__pyx_kwds)) {
17089  Py_ssize_t kw_args;
17090  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17091  switch (pos_args) {
17092  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17093  CYTHON_FALLTHROUGH;
17094  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17095  CYTHON_FALLTHROUGH;
17096  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17097  CYTHON_FALLTHROUGH;
17098  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17099  CYTHON_FALLTHROUGH;
17100  case 0: break;
17101  default: goto __pyx_L5_argtuple_error;
17102  }
17103  kw_args = PyDict_Size(__pyx_kwds);
17104  switch (pos_args) {
17105  case 0:
17106  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grads)) != 0)) kw_args--;
17107  else goto __pyx_L5_argtuple_error;
17108  CYTHON_FALLTHROUGH;
17109  case 1:
17110  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
17111  else {
17112  __Pyx_RaiseArgtupleInvalid("gradientRecoveryAtNodes", 1, 4, 4, 1); __PYX_ERR(0, 1012, __pyx_L3_error)
17113  }
17114  CYTHON_FALLTHROUGH;
17115  case 2:
17116  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
17117  else {
17118  __Pyx_RaiseArgtupleInvalid("gradientRecoveryAtNodes", 1, 4, 4, 2); __PYX_ERR(0, 1012, __pyx_L3_error)
17119  }
17120  CYTHON_FALLTHROUGH;
17121  case 3:
17122  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
17123  else {
17124  __Pyx_RaiseArgtupleInvalid("gradientRecoveryAtNodes", 1, 4, 4, 3); __PYX_ERR(0, 1012, __pyx_L3_error)
17125  }
17126  }
17127  if (unlikely(kw_args > 0)) {
17128  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gradientRecoveryAtNodes") < 0)) __PYX_ERR(0, 1012, __pyx_L3_error)
17129  }
17130  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
17131  goto __pyx_L5_argtuple_error;
17132  } else {
17133  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17134  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17135  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17136  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17137  }
17138  __pyx_v_grads = values[0];
17139  __pyx_v_nodeElementsArray = values[1];
17140  __pyx_v_nodeElementOffsets = values[2];
17141  __pyx_v_nd = values[3];
17142  }
17143  goto __pyx_L4_argument_unpacking_done;
17144  __pyx_L5_argtuple_error:;
17145  __Pyx_RaiseArgtupleInvalid("gradientRecoveryAtNodes", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1012, __pyx_L3_error)
17146  __pyx_L3_error:;
17147  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.gradientRecoveryAtNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
17148  __Pyx_RefNannyFinishContext();
17149  return NULL;
17150  __pyx_L4_argument_unpacking_done:;
17151  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_4gradientRecoveryAtNodes(__pyx_self, __pyx_v_grads, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets, __pyx_v_nd);
17152 
17153  /* function exit code */
17154  __Pyx_RefNannyFinishContext();
17155  return __pyx_r;
17156 }
17157 
17158 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_4gradientRecoveryAtNodes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_grads, PyObject *__pyx_v_nodeElementsArray, PyObject *__pyx_v_nodeElementOffsets, PyObject *__pyx_v_nd) {
17159  PyObject *__pyx_r = NULL;
17160  __Pyx_RefNannyDeclarations
17161  __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
17162  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
17163  __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
17164  int __pyx_t_4;
17165  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
17166  PyObject *__pyx_t_6 = NULL;
17167  int __pyx_lineno = 0;
17168  const char *__pyx_filename = NULL;
17169  int __pyx_clineno = 0;
17170  __Pyx_RefNannySetupContext("gradientRecoveryAtNodes", 0);
17171 
17172  /* "mprans/cMoveMeshMonitor.pyx":1016
17173  * nodeElementOffsets,
17174  * nd):
17175  * return cppGradientRecoveryAtNodes(grads=grads, # <<<<<<<<<<<<<<
17176  * nodeElementsArray=nodeElementsArray,
17177  * nodeElementOffsets=nodeElementOffsets,
17178  */
17179  __Pyx_XDECREF(__pyx_r);
17180  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(__pyx_v_grads, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1016, __pyx_L1_error)
17181 
17182  /* "mprans/cMoveMeshMonitor.pyx":1017
17183  * nd):
17184  * return cppGradientRecoveryAtNodes(grads=grads,
17185  * nodeElementsArray=nodeElementsArray, # <<<<<<<<<<<<<<
17186  * nodeElementOffsets=nodeElementOffsets,
17187  * nd=nd)
17188  */
17189  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_nodeElementsArray, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 1017, __pyx_L1_error)
17190 
17191  /* "mprans/cMoveMeshMonitor.pyx":1018
17192  * return cppGradientRecoveryAtNodes(grads=grads,
17193  * nodeElementsArray=nodeElementsArray,
17194  * nodeElementOffsets=nodeElementOffsets, # <<<<<<<<<<<<<<
17195  * nd=nd)
17196  *
17197  */
17198  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_nodeElementOffsets, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 1018, __pyx_L1_error)
17199 
17200  /* "mprans/cMoveMeshMonitor.pyx":1019
17201  * nodeElementsArray=nodeElementsArray,
17202  * nodeElementOffsets=nodeElementOffsets,
17203  * nd=nd) # <<<<<<<<<<<<<<
17204  *
17205  * cdef double[:,:] cppGradientRecoveryAtNodes(double[:,:,:] grads,
17206  */
17207  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_nd); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1019, __pyx_L1_error)
17208 
17209  /* "mprans/cMoveMeshMonitor.pyx":1016
17210  * nodeElementOffsets,
17211  * nd):
17212  * return cppGradientRecoveryAtNodes(grads=grads, # <<<<<<<<<<<<<<
17213  * nodeElementsArray=nodeElementsArray,
17214  * nodeElementOffsets=nodeElementOffsets,
17215  */
17216  __pyx_t_5 = __pyx_f_6mprans_16cMoveMeshMonitor_cppGradientRecoveryAtNodes(__pyx_t_1, __pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 1016, __pyx_L1_error)
17217  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
17218  __pyx_t_1.memview = NULL;
17219  __pyx_t_1.data = NULL;
17220  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
17221  __pyx_t_2.memview = NULL;
17222  __pyx_t_2.data = NULL;
17223  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
17224  __pyx_t_3.memview = NULL;
17225  __pyx_t_3.data = NULL;
17226  __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_5, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1016, __pyx_L1_error)
17227  __Pyx_GOTREF(__pyx_t_6);
17228  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
17229  __pyx_t_5.memview = NULL;
17230  __pyx_t_5.data = NULL;
17231  __pyx_r = __pyx_t_6;
17232  __pyx_t_6 = 0;
17233  goto __pyx_L0;
17234 
17235  /* "mprans/cMoveMeshMonitor.pyx":1012
17236  *
17237  *
17238  * def gradientRecoveryAtNodes(grads, # <<<<<<<<<<<<<<
17239  * nodeElementsArray,
17240  * nodeElementOffsets,
17241  */
17242 
17243  /* function exit code */
17244  __pyx_L1_error:;
17245  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
17246  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
17247  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
17248  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
17249  __Pyx_XDECREF(__pyx_t_6);
17250  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.gradientRecoveryAtNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
17251  __pyx_r = NULL;
17252  __pyx_L0:;
17253  __Pyx_XGIVEREF(__pyx_r);
17254  __Pyx_RefNannyFinishContext();
17255  return __pyx_r;
17256 }
17257 
17258 /* "mprans/cMoveMeshMonitor.pyx":1021
17259  * nd=nd)
17260  *
17261  * cdef double[:,:] cppGradientRecoveryAtNodes(double[:,:,:] grads, # <<<<<<<<<<<<<<
17262  * int[:] nodeElementsArray,
17263  * int[:] nodeElementOffsets,
17264  */
17265 
17266 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppGradientRecoveryAtNodes(__Pyx_memviewslice __pyx_v_grads, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, int __pyx_v_nd) {
17267  __Pyx_memviewslice __pyx_v_recovered_grads = { 0, 0, { 0 }, { 0 }, { 0 } };
17268  int __pyx_v_nb_el;
17269  __Pyx_memviewslice __pyx_v_grad_sum = { 0, 0, { 0 }, { 0 }, { 0 } };
17270  PyObject *__pyx_v_node = NULL;
17271  int __pyx_v_ndi;
17272  PyObject *__pyx_v_eOffset = NULL;
17273  PyObject *__pyx_v_eN = NULL;
17274  __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
17275  __Pyx_RefNannyDeclarations
17276  PyObject *__pyx_t_1 = NULL;
17277  PyObject *__pyx_t_2 = NULL;
17278  PyObject *__pyx_t_3 = NULL;
17279  size_t __pyx_t_4;
17280  PyObject *__pyx_t_5 = NULL;
17281  PyObject *__pyx_t_6 = NULL;
17282  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
17283  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
17284  Py_ssize_t __pyx_t_9;
17285  PyObject *(*__pyx_t_10)(PyObject *);
17286  int __pyx_t_11;
17287  int __pyx_t_12;
17288  int __pyx_t_13;
17289  Py_ssize_t __pyx_t_14;
17290  Py_ssize_t __pyx_t_15;
17291  PyObject *(*__pyx_t_16)(PyObject *);
17292  Py_ssize_t __pyx_t_17;
17293  Py_ssize_t __pyx_t_18;
17294  Py_ssize_t __pyx_t_19;
17295  Py_ssize_t __pyx_t_20;
17296  int __pyx_lineno = 0;
17297  const char *__pyx_filename = NULL;
17298  int __pyx_clineno = 0;
17299  __Pyx_RefNannySetupContext("cppGradientRecoveryAtNodes", 0);
17300 
17301  /* "mprans/cMoveMeshMonitor.pyx":1025
17302  * int[:] nodeElementOffsets,
17303  * int nd):
17304  * cdef double[:, :] recovered_grads = np.zeros((len(nodeElementOffsets)-1, nd)) # <<<<<<<<<<<<<<
17305  * cdef int nb_el
17306  * cdef double[:] grad_sum = np.zeros(nd)
17307  */
17308  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error)
17309  __Pyx_GOTREF(__pyx_t_2);
17310  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1025, __pyx_L1_error)
17311  __Pyx_GOTREF(__pyx_t_3);
17312  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17313  __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_nodeElementOffsets);
17314  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error)
17315  __Pyx_GOTREF(__pyx_t_2);
17316  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1025, __pyx_L1_error)
17317  __Pyx_GOTREF(__pyx_t_5);
17318  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1025, __pyx_L1_error)
17319  __Pyx_GOTREF(__pyx_t_6);
17320  __Pyx_GIVEREF(__pyx_t_2);
17321  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
17322  __Pyx_GIVEREF(__pyx_t_5);
17323  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
17324  __pyx_t_2 = 0;
17325  __pyx_t_5 = 0;
17326  __pyx_t_5 = NULL;
17327  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
17328  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
17329  if (likely(__pyx_t_5)) {
17330  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
17331  __Pyx_INCREF(__pyx_t_5);
17332  __Pyx_INCREF(function);
17333  __Pyx_DECREF_SET(__pyx_t_3, function);
17334  }
17335  }
17336  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
17337  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17338  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17339  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error)
17340  __Pyx_GOTREF(__pyx_t_1);
17341  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17342  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1025, __pyx_L1_error)
17343  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17344  __pyx_v_recovered_grads = __pyx_t_7;
17345  __pyx_t_7.memview = NULL;
17346  __pyx_t_7.data = NULL;
17347 
17348  /* "mprans/cMoveMeshMonitor.pyx":1027
17349  * cdef double[:, :] recovered_grads = np.zeros((len(nodeElementOffsets)-1, nd))
17350  * cdef int nb_el
17351  * cdef double[:] grad_sum = np.zeros(nd) # <<<<<<<<<<<<<<
17352  * for node in range(len(nodeElementOffsets)-1):
17353  * nb_el = 0
17354  */
17355  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error)
17356  __Pyx_GOTREF(__pyx_t_3);
17357  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1027, __pyx_L1_error)
17358  __Pyx_GOTREF(__pyx_t_6);
17359  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17360  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error)
17361  __Pyx_GOTREF(__pyx_t_3);
17362  __pyx_t_5 = NULL;
17363  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
17364  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
17365  if (likely(__pyx_t_5)) {
17366  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
17367  __Pyx_INCREF(__pyx_t_5);
17368  __Pyx_INCREF(function);
17369  __Pyx_DECREF_SET(__pyx_t_6, function);
17370  }
17371  }
17372  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3);
17373  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17374  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17375  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error)
17376  __Pyx_GOTREF(__pyx_t_1);
17377  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17378  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1027, __pyx_L1_error)
17379  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17380  __pyx_v_grad_sum = __pyx_t_8;
17381  __pyx_t_8.memview = NULL;
17382  __pyx_t_8.data = NULL;
17383 
17384  /* "mprans/cMoveMeshMonitor.pyx":1028
17385  * cdef int nb_el
17386  * cdef double[:] grad_sum = np.zeros(nd)
17387  * for node in range(len(nodeElementOffsets)-1): # <<<<<<<<<<<<<<
17388  * nb_el = 0
17389  * for ndi in range(nd):
17390  */
17391  __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_nodeElementOffsets);
17392  __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
17393  __Pyx_GOTREF(__pyx_t_1);
17394  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1028, __pyx_L1_error)
17395  __Pyx_GOTREF(__pyx_t_6);
17396  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17397  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
17398  __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
17399  __pyx_t_10 = NULL;
17400  } else {
17401  __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
17402  __Pyx_GOTREF(__pyx_t_1);
17403  __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1028, __pyx_L1_error)
17404  }
17405  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17406  for (;;) {
17407  if (likely(!__pyx_t_10)) {
17408  if (likely(PyList_CheckExact(__pyx_t_1))) {
17409  if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
17410  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17411  __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1028, __pyx_L1_error)
17412  #else
17413  __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1028, __pyx_L1_error)
17414  __Pyx_GOTREF(__pyx_t_6);
17415  #endif
17416  } else {
17417  if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
17418  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17419  __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1028, __pyx_L1_error)
17420  #else
17421  __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1028, __pyx_L1_error)
17422  __Pyx_GOTREF(__pyx_t_6);
17423  #endif
17424  }
17425  } else {
17426  __pyx_t_6 = __pyx_t_10(__pyx_t_1);
17427  if (unlikely(!__pyx_t_6)) {
17428  PyObject* exc_type = PyErr_Occurred();
17429  if (exc_type) {
17430  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
17431  else __PYX_ERR(0, 1028, __pyx_L1_error)
17432  }
17433  break;
17434  }
17435  __Pyx_GOTREF(__pyx_t_6);
17436  }
17437  __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_6);
17438  __pyx_t_6 = 0;
17439 
17440  /* "mprans/cMoveMeshMonitor.pyx":1029
17441  * cdef double[:] grad_sum = np.zeros(nd)
17442  * for node in range(len(nodeElementOffsets)-1):
17443  * nb_el = 0 # <<<<<<<<<<<<<<
17444  * for ndi in range(nd):
17445  * grad_sum[ndi] = 0.
17446  */
17447  __pyx_v_nb_el = 0;
17448 
17449  /* "mprans/cMoveMeshMonitor.pyx":1030
17450  * for node in range(len(nodeElementOffsets)-1):
17451  * nb_el = 0
17452  * for ndi in range(nd): # <<<<<<<<<<<<<<
17453  * grad_sum[ndi] = 0.
17454  * for eOffset in range(nodeElementOffsets[node],
17455  */
17456  __pyx_t_11 = __pyx_v_nd;
17457  __pyx_t_12 = __pyx_t_11;
17458  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
17459  __pyx_v_ndi = __pyx_t_13;
17460 
17461  /* "mprans/cMoveMeshMonitor.pyx":1031
17462  * nb_el = 0
17463  * for ndi in range(nd):
17464  * grad_sum[ndi] = 0. # <<<<<<<<<<<<<<
17465  * for eOffset in range(nodeElementOffsets[node],
17466  * nodeElementOffsets[node+1]):
17467  */
17468  __pyx_t_14 = __pyx_v_ndi;
17469  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_grad_sum.shape[0];
17470  *((double *) ( /* dim=0 */ (__pyx_v_grad_sum.data + __pyx_t_14 * __pyx_v_grad_sum.strides[0]) )) = 0.;
17471  }
17472 
17473  /* "mprans/cMoveMeshMonitor.pyx":1032
17474  * for ndi in range(nd):
17475  * grad_sum[ndi] = 0.
17476  * for eOffset in range(nodeElementOffsets[node], # <<<<<<<<<<<<<<
17477  * nodeElementOffsets[node+1]):
17478  * nb_el += 1
17479  */
17480  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_node); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1032, __pyx_L1_error)
17481  __pyx_t_14 = __pyx_t_15;
17482  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeElementOffsets.shape[0];
17483  __pyx_t_6 = __Pyx_PyInt_From_int((*((int *) ( /* dim=0 */ (__pyx_v_nodeElementOffsets.data + __pyx_t_14 * __pyx_v_nodeElementOffsets.strides[0]) )))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1032, __pyx_L1_error)
17484  __Pyx_GOTREF(__pyx_t_6);
17485 
17486  /* "mprans/cMoveMeshMonitor.pyx":1033
17487  * grad_sum[ndi] = 0.
17488  * for eOffset in range(nodeElementOffsets[node],
17489  * nodeElementOffsets[node+1]): # <<<<<<<<<<<<<<
17490  * nb_el += 1
17491  * eN = nodeElementsArray[eOffset]
17492  */
17493  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_node, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error)
17494  __Pyx_GOTREF(__pyx_t_3);
17495  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1033, __pyx_L1_error)
17496  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17497  __pyx_t_14 = __pyx_t_15;
17498  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeElementOffsets.shape[0];
17499  __pyx_t_3 = __Pyx_PyInt_From_int((*((int *) ( /* dim=0 */ (__pyx_v_nodeElementOffsets.data + __pyx_t_14 * __pyx_v_nodeElementOffsets.strides[0]) )))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error)
17500  __Pyx_GOTREF(__pyx_t_3);
17501 
17502  /* "mprans/cMoveMeshMonitor.pyx":1032
17503  * for ndi in range(nd):
17504  * grad_sum[ndi] = 0.
17505  * for eOffset in range(nodeElementOffsets[node], # <<<<<<<<<<<<<<
17506  * nodeElementOffsets[node+1]):
17507  * nb_el += 1
17508  */
17509  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error)
17510  __Pyx_GOTREF(__pyx_t_5);
17511  __Pyx_GIVEREF(__pyx_t_6);
17512  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
17513  __Pyx_GIVEREF(__pyx_t_3);
17514  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
17515  __pyx_t_6 = 0;
17516  __pyx_t_3 = 0;
17517  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error)
17518  __Pyx_GOTREF(__pyx_t_3);
17519  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17520  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
17521  __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_15 = 0;
17522  __pyx_t_16 = NULL;
17523  } else {
17524  __pyx_t_15 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error)
17525  __Pyx_GOTREF(__pyx_t_5);
17526  __pyx_t_16 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1032, __pyx_L1_error)
17527  }
17528  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17529  for (;;) {
17530  if (likely(!__pyx_t_16)) {
17531  if (likely(PyList_CheckExact(__pyx_t_5))) {
17532  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_5)) break;
17533  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17534  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1032, __pyx_L1_error)
17535  #else
17536  __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error)
17537  __Pyx_GOTREF(__pyx_t_3);
17538  #endif
17539  } else {
17540  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
17541  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17542  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1032, __pyx_L1_error)
17543  #else
17544  __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error)
17545  __Pyx_GOTREF(__pyx_t_3);
17546  #endif
17547  }
17548  } else {
17549  __pyx_t_3 = __pyx_t_16(__pyx_t_5);
17550  if (unlikely(!__pyx_t_3)) {
17551  PyObject* exc_type = PyErr_Occurred();
17552  if (exc_type) {
17553  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
17554  else __PYX_ERR(0, 1032, __pyx_L1_error)
17555  }
17556  break;
17557  }
17558  __Pyx_GOTREF(__pyx_t_3);
17559  }
17560  __Pyx_XDECREF_SET(__pyx_v_eOffset, __pyx_t_3);
17561  __pyx_t_3 = 0;
17562 
17563  /* "mprans/cMoveMeshMonitor.pyx":1034
17564  * for eOffset in range(nodeElementOffsets[node],
17565  * nodeElementOffsets[node+1]):
17566  * nb_el += 1 # <<<<<<<<<<<<<<
17567  * eN = nodeElementsArray[eOffset]
17568  * # for k in range(n_quad):
17569  */
17570  __pyx_v_nb_el = (__pyx_v_nb_el + 1);
17571 
17572  /* "mprans/cMoveMeshMonitor.pyx":1035
17573  * nodeElementOffsets[node+1]):
17574  * nb_el += 1
17575  * eN = nodeElementsArray[eOffset] # <<<<<<<<<<<<<<
17576  * # for k in range(n_quad):
17577  * # grad_k = grads[eN, k]
17578  */
17579  __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eOffset); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1035, __pyx_L1_error)
17580  __pyx_t_14 = __pyx_t_17;
17581  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeElementsArray.shape[0];
17582  __pyx_t_3 = __Pyx_PyInt_From_int((*((int *) ( /* dim=0 */ (__pyx_v_nodeElementsArray.data + __pyx_t_14 * __pyx_v_nodeElementsArray.strides[0]) )))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1035, __pyx_L1_error)
17583  __Pyx_GOTREF(__pyx_t_3);
17584  __Pyx_XDECREF_SET(__pyx_v_eN, __pyx_t_3);
17585  __pyx_t_3 = 0;
17586 
17587  /* "mprans/cMoveMeshMonitor.pyx":1040
17588  * # grad_eN_av += grad_k
17589  * # grad_eN_av /= n_quad
17590  * for ndi in range(nd): # <<<<<<<<<<<<<<
17591  * grad_sum[ndi] += grads[eN, 0, ndi] # same value at all quad points
17592  * for ndi in range(nd):
17593  */
17594  __pyx_t_11 = __pyx_v_nd;
17595  __pyx_t_12 = __pyx_t_11;
17596  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
17597  __pyx_v_ndi = __pyx_t_13;
17598 
17599  /* "mprans/cMoveMeshMonitor.pyx":1041
17600  * # grad_eN_av /= n_quad
17601  * for ndi in range(nd):
17602  * grad_sum[ndi] += grads[eN, 0, ndi] # same value at all quad points # <<<<<<<<<<<<<<
17603  * for ndi in range(nd):
17604  * recovered_grads[node, ndi] = grad_sum[ndi]/nb_el
17605  */
17606  __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eN); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1041, __pyx_L1_error)
17607  __pyx_t_14 = __pyx_t_17;
17608  __pyx_t_18 = 0;
17609  __pyx_t_19 = __pyx_v_ndi;
17610  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_grads.shape[0];
17611  if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_grads.shape[1];
17612  if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_grads.shape[2];
17613  __pyx_t_20 = __pyx_v_ndi;
17614  if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_grad_sum.shape[0];
17615  *((double *) ( /* dim=0 */ (__pyx_v_grad_sum.data + __pyx_t_20 * __pyx_v_grad_sum.strides[0]) )) += (*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_grads.data + __pyx_t_14 * __pyx_v_grads.strides[0]) ) + __pyx_t_18 * __pyx_v_grads.strides[1]) ) + __pyx_t_19 * __pyx_v_grads.strides[2]) )));
17616  }
17617 
17618  /* "mprans/cMoveMeshMonitor.pyx":1032
17619  * for ndi in range(nd):
17620  * grad_sum[ndi] = 0.
17621  * for eOffset in range(nodeElementOffsets[node], # <<<<<<<<<<<<<<
17622  * nodeElementOffsets[node+1]):
17623  * nb_el += 1
17624  */
17625  }
17626  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17627 
17628  /* "mprans/cMoveMeshMonitor.pyx":1042
17629  * for ndi in range(nd):
17630  * grad_sum[ndi] += grads[eN, 0, ndi] # same value at all quad points
17631  * for ndi in range(nd): # <<<<<<<<<<<<<<
17632  * recovered_grads[node, ndi] = grad_sum[ndi]/nb_el
17633  * return recovered_grads
17634  */
17635  __pyx_t_11 = __pyx_v_nd;
17636  __pyx_t_12 = __pyx_t_11;
17637  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
17638  __pyx_v_ndi = __pyx_t_13;
17639 
17640  /* "mprans/cMoveMeshMonitor.pyx":1043
17641  * grad_sum[ndi] += grads[eN, 0, ndi] # same value at all quad points
17642  * for ndi in range(nd):
17643  * recovered_grads[node, ndi] = grad_sum[ndi]/nb_el # <<<<<<<<<<<<<<
17644  * return recovered_grads
17645  *
17646  */
17647  __pyx_t_19 = __pyx_v_ndi;
17648  if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_grad_sum.shape[0];
17649  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_node); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1043, __pyx_L1_error)
17650  __pyx_t_18 = __pyx_t_15;
17651  __pyx_t_14 = __pyx_v_ndi;
17652  if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_recovered_grads.shape[0];
17653  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_recovered_grads.shape[1];
17654  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_recovered_grads.data + __pyx_t_18 * __pyx_v_recovered_grads.strides[0]) ) + __pyx_t_14 * __pyx_v_recovered_grads.strides[1]) )) = ((*((double *) ( /* dim=0 */ (__pyx_v_grad_sum.data + __pyx_t_19 * __pyx_v_grad_sum.strides[0]) ))) / __pyx_v_nb_el);
17655  }
17656 
17657  /* "mprans/cMoveMeshMonitor.pyx":1028
17658  * cdef int nb_el
17659  * cdef double[:] grad_sum = np.zeros(nd)
17660  * for node in range(len(nodeElementOffsets)-1): # <<<<<<<<<<<<<<
17661  * nb_el = 0
17662  * for ndi in range(nd):
17663  */
17664  }
17665  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17666 
17667  /* "mprans/cMoveMeshMonitor.pyx":1044
17668  * for ndi in range(nd):
17669  * recovered_grads[node, ndi] = grad_sum[ndi]/nb_el
17670  * return recovered_grads # <<<<<<<<<<<<<<
17671  *
17672  * def gradientRecoveryAtNodesWeighted(double[:,:,:] grads,
17673  */
17674  __PYX_INC_MEMVIEW(&__pyx_v_recovered_grads, 0);
17675  __pyx_r = __pyx_v_recovered_grads;
17676  goto __pyx_L0;
17677 
17678  /* "mprans/cMoveMeshMonitor.pyx":1021
17679  * nd=nd)
17680  *
17681  * cdef double[:,:] cppGradientRecoveryAtNodes(double[:,:,:] grads, # <<<<<<<<<<<<<<
17682  * int[:] nodeElementsArray,
17683  * int[:] nodeElementOffsets,
17684  */
17685 
17686  /* function exit code */
17687  __pyx_L1_error:;
17688  __Pyx_XDECREF(__pyx_t_1);
17689  __Pyx_XDECREF(__pyx_t_2);
17690  __Pyx_XDECREF(__pyx_t_3);
17691  __Pyx_XDECREF(__pyx_t_5);
17692  __Pyx_XDECREF(__pyx_t_6);
17693  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
17694  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
17695  __pyx_r.data = NULL;
17696  __pyx_r.memview = NULL;
17697  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cppGradientRecoveryAtNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
17698  goto __pyx_L2;
17699  __pyx_L0:;
17700  if (unlikely(!__pyx_r.memview)) {
17701  PyErr_SetString(PyExc_TypeError, "Memoryview return value is not initialized");
17702  }
17703  __pyx_L2:;
17704  __PYX_XDEC_MEMVIEW(&__pyx_v_recovered_grads, 1);
17705  __PYX_XDEC_MEMVIEW(&__pyx_v_grad_sum, 1);
17706  __Pyx_XDECREF(__pyx_v_node);
17707  __Pyx_XDECREF(__pyx_v_eOffset);
17708  __Pyx_XDECREF(__pyx_v_eN);
17709  __Pyx_RefNannyFinishContext();
17710  return __pyx_r;
17711 }
17712 
17713 /* "mprans/cMoveMeshMonitor.pyx":1046
17714  * return recovered_grads
17715  *
17716  * def gradientRecoveryAtNodesWeighted(double[:,:,:] grads, # <<<<<<<<<<<<<<
17717  * int[:] nodeElementsArray,
17718  * int[:] nodeElementOffsets,
17719  */
17720 
17721 /* Python wrapper */
17722 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_7gradientRecoveryAtNodesWeighted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17723 static PyMethodDef __pyx_mdef_6mprans_16cMoveMeshMonitor_7gradientRecoveryAtNodesWeighted = {"gradientRecoveryAtNodesWeighted", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_16cMoveMeshMonitor_7gradientRecoveryAtNodesWeighted, METH_VARARGS|METH_KEYWORDS, 0};
17724 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_7gradientRecoveryAtNodesWeighted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17725  __Pyx_memviewslice __pyx_v_grads = { 0, 0, { 0 }, { 0 }, { 0 } };
17726  __Pyx_memviewslice __pyx_v_nodeElementsArray = { 0, 0, { 0 }, { 0 }, { 0 } };
17727  __Pyx_memviewslice __pyx_v_nodeElementOffsets = { 0, 0, { 0 }, { 0 }, { 0 } };
17728  __Pyx_memviewslice __pyx_v_detJ_array = { 0, 0, { 0 }, { 0 }, { 0 } };
17729  int __pyx_v_nd;
17730  int __pyx_lineno = 0;
17731  const char *__pyx_filename = NULL;
17732  int __pyx_clineno = 0;
17733  PyObject *__pyx_r = 0;
17734  __Pyx_RefNannyDeclarations
17735  __Pyx_RefNannySetupContext("gradientRecoveryAtNodesWeighted (wrapper)", 0);
17736  {
17737  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grads,&__pyx_n_s_nodeElementsArray,&__pyx_n_s_nodeElementOffsets,&__pyx_n_s_detJ_array,&__pyx_n_s_nd,0};
17738  PyObject* values[5] = {0,0,0,0,0};
17739  if (unlikely(__pyx_kwds)) {
17740  Py_ssize_t kw_args;
17741  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17742  switch (pos_args) {
17743  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17744  CYTHON_FALLTHROUGH;
17745  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17746  CYTHON_FALLTHROUGH;
17747  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17748  CYTHON_FALLTHROUGH;
17749  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17750  CYTHON_FALLTHROUGH;
17751  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17752  CYTHON_FALLTHROUGH;
17753  case 0: break;
17754  default: goto __pyx_L5_argtuple_error;
17755  }
17756  kw_args = PyDict_Size(__pyx_kwds);
17757  switch (pos_args) {
17758  case 0:
17759  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grads)) != 0)) kw_args--;
17760  else goto __pyx_L5_argtuple_error;
17761  CYTHON_FALLTHROUGH;
17762  case 1:
17763  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementsArray)) != 0)) kw_args--;
17764  else {
17765  __Pyx_RaiseArgtupleInvalid("gradientRecoveryAtNodesWeighted", 1, 5, 5, 1); __PYX_ERR(0, 1046, __pyx_L3_error)
17766  }
17767  CYTHON_FALLTHROUGH;
17768  case 2:
17769  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeElementOffsets)) != 0)) kw_args--;
17770  else {
17771  __Pyx_RaiseArgtupleInvalid("gradientRecoveryAtNodesWeighted", 1, 5, 5, 2); __PYX_ERR(0, 1046, __pyx_L3_error)
17772  }
17773  CYTHON_FALLTHROUGH;
17774  case 3:
17775  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_detJ_array)) != 0)) kw_args--;
17776  else {
17777  __Pyx_RaiseArgtupleInvalid("gradientRecoveryAtNodesWeighted", 1, 5, 5, 3); __PYX_ERR(0, 1046, __pyx_L3_error)
17778  }
17779  CYTHON_FALLTHROUGH;
17780  case 4:
17781  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
17782  else {
17783  __Pyx_RaiseArgtupleInvalid("gradientRecoveryAtNodesWeighted", 1, 5, 5, 4); __PYX_ERR(0, 1046, __pyx_L3_error)
17784  }
17785  }
17786  if (unlikely(kw_args > 0)) {
17787  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gradientRecoveryAtNodesWeighted") < 0)) __PYX_ERR(0, 1046, __pyx_L3_error)
17788  }
17789  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
17790  goto __pyx_L5_argtuple_error;
17791  } else {
17792  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17793  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17794  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17795  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17796  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17797  }
17798  __pyx_v_grads = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_grads.memview)) __PYX_ERR(0, 1046, __pyx_L3_error)
17799  __pyx_v_nodeElementsArray = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_nodeElementsArray.memview)) __PYX_ERR(0, 1047, __pyx_L3_error)
17800  __pyx_v_nodeElementOffsets = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_nodeElementOffsets.memview)) __PYX_ERR(0, 1048, __pyx_L3_error)
17801  __pyx_v_detJ_array = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_detJ_array.memview)) __PYX_ERR(0, 1049, __pyx_L3_error)
17802  __pyx_v_nd = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_nd == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1050, __pyx_L3_error)
17803  }
17804  goto __pyx_L4_argument_unpacking_done;
17805  __pyx_L5_argtuple_error:;
17806  __Pyx_RaiseArgtupleInvalid("gradientRecoveryAtNodesWeighted", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1046, __pyx_L3_error)
17807  __pyx_L3_error:;
17808  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.gradientRecoveryAtNodesWeighted", __pyx_clineno, __pyx_lineno, __pyx_filename);
17809  __Pyx_RefNannyFinishContext();
17810  return NULL;
17811  __pyx_L4_argument_unpacking_done:;
17812  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_6gradientRecoveryAtNodesWeighted(__pyx_self, __pyx_v_grads, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets, __pyx_v_detJ_array, __pyx_v_nd);
17813 
17814  /* function exit code */
17815  __Pyx_RefNannyFinishContext();
17816  return __pyx_r;
17817 }
17818 
17819 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_6gradientRecoveryAtNodesWeighted(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_grads, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_detJ_array, int __pyx_v_nd) {
17820  PyObject *__pyx_r = NULL;
17821  __Pyx_RefNannyDeclarations
17822  __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
17823  PyObject *__pyx_t_2 = NULL;
17824  int __pyx_lineno = 0;
17825  const char *__pyx_filename = NULL;
17826  int __pyx_clineno = 0;
17827  __Pyx_RefNannySetupContext("gradientRecoveryAtNodesWeighted", 0);
17828 
17829  /* "mprans/cMoveMeshMonitor.pyx":1051
17830  * double[:,:] detJ_array,
17831  * int nd):
17832  * return cppGradientRecoveryAtNodesWeighted(grads=grads, # <<<<<<<<<<<<<<
17833  * nodeElementsArray=nodeElementsArray,
17834  * nodeElementOffsets=nodeElementOffsets,
17835  */
17836  __Pyx_XDECREF(__pyx_r);
17837 
17838  /* "mprans/cMoveMeshMonitor.pyx":1055
17839  * nodeElementOffsets=nodeElementOffsets,
17840  * detJ_array=detJ_array,
17841  * nd=nd) # <<<<<<<<<<<<<<
17842  *
17843  * cdef double[:,:] cppGradientRecoveryAtNodesWeighted(double[:,:,:] grads,
17844  */
17845  __pyx_t_1 = __pyx_f_6mprans_16cMoveMeshMonitor_cppGradientRecoveryAtNodesWeighted(__pyx_v_grads, __pyx_v_nodeElementsArray, __pyx_v_nodeElementOffsets, __pyx_v_detJ_array, __pyx_v_nd); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 1051, __pyx_L1_error)
17846 
17847  /* "mprans/cMoveMeshMonitor.pyx":1051
17848  * double[:,:] detJ_array,
17849  * int nd):
17850  * return cppGradientRecoveryAtNodesWeighted(grads=grads, # <<<<<<<<<<<<<<
17851  * nodeElementsArray=nodeElementsArray,
17852  * nodeElementOffsets=nodeElementOffsets,
17853  */
17854  __pyx_t_2 = __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_2)) __PYX_ERR(0, 1051, __pyx_L1_error)
17855  __Pyx_GOTREF(__pyx_t_2);
17856  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
17857  __pyx_t_1.memview = NULL;
17858  __pyx_t_1.data = NULL;
17859  __pyx_r = __pyx_t_2;
17860  __pyx_t_2 = 0;
17861  goto __pyx_L0;
17862 
17863  /* "mprans/cMoveMeshMonitor.pyx":1046
17864  * return recovered_grads
17865  *
17866  * def gradientRecoveryAtNodesWeighted(double[:,:,:] grads, # <<<<<<<<<<<<<<
17867  * int[:] nodeElementsArray,
17868  * int[:] nodeElementOffsets,
17869  */
17870 
17871  /* function exit code */
17872  __pyx_L1_error:;
17873  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
17874  __Pyx_XDECREF(__pyx_t_2);
17875  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.gradientRecoveryAtNodesWeighted", __pyx_clineno, __pyx_lineno, __pyx_filename);
17876  __pyx_r = NULL;
17877  __pyx_L0:;
17878  __PYX_XDEC_MEMVIEW(&__pyx_v_grads, 1);
17879  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementsArray, 1);
17880  __PYX_XDEC_MEMVIEW(&__pyx_v_nodeElementOffsets, 1);
17881  __PYX_XDEC_MEMVIEW(&__pyx_v_detJ_array, 1);
17882  __Pyx_XGIVEREF(__pyx_r);
17883  __Pyx_RefNannyFinishContext();
17884  return __pyx_r;
17885 }
17886 
17887 /* "mprans/cMoveMeshMonitor.pyx":1057
17888  * nd=nd)
17889  *
17890  * cdef double[:,:] cppGradientRecoveryAtNodesWeighted(double[:,:,:] grads, # <<<<<<<<<<<<<<
17891  * int[:] nodeElementsArray,
17892  * int[:] nodeElementOffsets,
17893  */
17894 
17895 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_cppGradientRecoveryAtNodesWeighted(__Pyx_memviewslice __pyx_v_grads, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_detJ_array, int __pyx_v_nd) {
17896  __Pyx_memviewslice __pyx_v_recovered_grads = { 0, 0, { 0 }, { 0 }, { 0 } };
17897  int __pyx_v_nb_el;
17898  double __pyx_v_detJ_patch;
17899  __Pyx_memviewslice __pyx_v_grad_sum = { 0, 0, { 0 }, { 0 }, { 0 } };
17900  PyObject *__pyx_v_node = NULL;
17901  int __pyx_v_ndi;
17902  PyObject *__pyx_v_eOffset = NULL;
17903  PyObject *__pyx_v_eN = NULL;
17904  __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
17905  __Pyx_RefNannyDeclarations
17906  PyObject *__pyx_t_1 = NULL;
17907  PyObject *__pyx_t_2 = NULL;
17908  PyObject *__pyx_t_3 = NULL;
17909  size_t __pyx_t_4;
17910  PyObject *__pyx_t_5 = NULL;
17911  PyObject *__pyx_t_6 = NULL;
17912  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
17913  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
17914  Py_ssize_t __pyx_t_9;
17915  PyObject *(*__pyx_t_10)(PyObject *);
17916  int __pyx_t_11;
17917  int __pyx_t_12;
17918  int __pyx_t_13;
17919  Py_ssize_t __pyx_t_14;
17920  Py_ssize_t __pyx_t_15;
17921  PyObject *(*__pyx_t_16)(PyObject *);
17922  Py_ssize_t __pyx_t_17;
17923  Py_ssize_t __pyx_t_18;
17924  Py_ssize_t __pyx_t_19;
17925  Py_ssize_t __pyx_t_20;
17926  Py_ssize_t __pyx_t_21;
17927  Py_ssize_t __pyx_t_22;
17928  Py_ssize_t __pyx_t_23;
17929  int __pyx_lineno = 0;
17930  const char *__pyx_filename = NULL;
17931  int __pyx_clineno = 0;
17932  __Pyx_RefNannySetupContext("cppGradientRecoveryAtNodesWeighted", 0);
17933 
17934  /* "mprans/cMoveMeshMonitor.pyx":1062
17935  * double[:,:] detJ_array,
17936  * int nd):
17937  * cdef double[:, :] recovered_grads = np.zeros((len(nodeElementOffsets)-1, nd)) # <<<<<<<<<<<<<<
17938  * cdef int nb_el
17939  * cdef double detJ_patch = 0.
17940  */
17941  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1062, __pyx_L1_error)
17942  __Pyx_GOTREF(__pyx_t_2);
17943  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L1_error)
17944  __Pyx_GOTREF(__pyx_t_3);
17945  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17946  __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_nodeElementOffsets);
17947  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1062, __pyx_L1_error)
17948  __Pyx_GOTREF(__pyx_t_2);
17949  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1062, __pyx_L1_error)
17950  __Pyx_GOTREF(__pyx_t_5);
17951  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1062, __pyx_L1_error)
17952  __Pyx_GOTREF(__pyx_t_6);
17953  __Pyx_GIVEREF(__pyx_t_2);
17954  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
17955  __Pyx_GIVEREF(__pyx_t_5);
17956  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
17957  __pyx_t_2 = 0;
17958  __pyx_t_5 = 0;
17959  __pyx_t_5 = NULL;
17960  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
17961  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
17962  if (likely(__pyx_t_5)) {
17963  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
17964  __Pyx_INCREF(__pyx_t_5);
17965  __Pyx_INCREF(function);
17966  __Pyx_DECREF_SET(__pyx_t_3, function);
17967  }
17968  }
17969  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
17970  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17971  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17972  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __pyx_L1_error)
17973  __Pyx_GOTREF(__pyx_t_1);
17974  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17975  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 1062, __pyx_L1_error)
17976  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17977  __pyx_v_recovered_grads = __pyx_t_7;
17978  __pyx_t_7.memview = NULL;
17979  __pyx_t_7.data = NULL;
17980 
17981  /* "mprans/cMoveMeshMonitor.pyx":1064
17982  * cdef double[:, :] recovered_grads = np.zeros((len(nodeElementOffsets)-1, nd))
17983  * cdef int nb_el
17984  * cdef double detJ_patch = 0. # <<<<<<<<<<<<<<
17985  * cdef double[:] grad_sum = np.zeros(nd)
17986  * for node in range(len(nodeElementOffsets)-1):
17987  */
17988  __pyx_v_detJ_patch = 0.;
17989 
17990  /* "mprans/cMoveMeshMonitor.pyx":1065
17991  * cdef int nb_el
17992  * cdef double detJ_patch = 0.
17993  * cdef double[:] grad_sum = np.zeros(nd) # <<<<<<<<<<<<<<
17994  * for node in range(len(nodeElementOffsets)-1):
17995  * nb_el = 0
17996  */
17997  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1065, __pyx_L1_error)
17998  __Pyx_GOTREF(__pyx_t_3);
17999  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1065, __pyx_L1_error)
18000  __Pyx_GOTREF(__pyx_t_6);
18001  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18002  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1065, __pyx_L1_error)
18003  __Pyx_GOTREF(__pyx_t_3);
18004  __pyx_t_5 = NULL;
18005  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
18006  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
18007  if (likely(__pyx_t_5)) {
18008  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
18009  __Pyx_INCREF(__pyx_t_5);
18010  __Pyx_INCREF(function);
18011  __Pyx_DECREF_SET(__pyx_t_6, function);
18012  }
18013  }
18014  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3);
18015  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18016  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18017  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error)
18018  __Pyx_GOTREF(__pyx_t_1);
18019  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18020  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 1065, __pyx_L1_error)
18021  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18022  __pyx_v_grad_sum = __pyx_t_8;
18023  __pyx_t_8.memview = NULL;
18024  __pyx_t_8.data = NULL;
18025 
18026  /* "mprans/cMoveMeshMonitor.pyx":1066
18027  * cdef double detJ_patch = 0.
18028  * cdef double[:] grad_sum = np.zeros(nd)
18029  * for node in range(len(nodeElementOffsets)-1): # <<<<<<<<<<<<<<
18030  * nb_el = 0
18031  * detJ_patch = 0.
18032  */
18033  __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_nodeElementOffsets);
18034  __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error)
18035  __Pyx_GOTREF(__pyx_t_1);
18036  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1066, __pyx_L1_error)
18037  __Pyx_GOTREF(__pyx_t_6);
18038  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18039  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
18040  __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
18041  __pyx_t_10 = NULL;
18042  } else {
18043  __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error)
18044  __Pyx_GOTREF(__pyx_t_1);
18045  __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1066, __pyx_L1_error)
18046  }
18047  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18048  for (;;) {
18049  if (likely(!__pyx_t_10)) {
18050  if (likely(PyList_CheckExact(__pyx_t_1))) {
18051  if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
18052  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18053  __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1066, __pyx_L1_error)
18054  #else
18055  __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1066, __pyx_L1_error)
18056  __Pyx_GOTREF(__pyx_t_6);
18057  #endif
18058  } else {
18059  if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
18060  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18061  __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1066, __pyx_L1_error)
18062  #else
18063  __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1066, __pyx_L1_error)
18064  __Pyx_GOTREF(__pyx_t_6);
18065  #endif
18066  }
18067  } else {
18068  __pyx_t_6 = __pyx_t_10(__pyx_t_1);
18069  if (unlikely(!__pyx_t_6)) {
18070  PyObject* exc_type = PyErr_Occurred();
18071  if (exc_type) {
18072  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18073  else __PYX_ERR(0, 1066, __pyx_L1_error)
18074  }
18075  break;
18076  }
18077  __Pyx_GOTREF(__pyx_t_6);
18078  }
18079  __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_6);
18080  __pyx_t_6 = 0;
18081 
18082  /* "mprans/cMoveMeshMonitor.pyx":1067
18083  * cdef double[:] grad_sum = np.zeros(nd)
18084  * for node in range(len(nodeElementOffsets)-1):
18085  * nb_el = 0 # <<<<<<<<<<<<<<
18086  * detJ_patch = 0.
18087  * for ndi in range(nd):
18088  */
18089  __pyx_v_nb_el = 0;
18090 
18091  /* "mprans/cMoveMeshMonitor.pyx":1068
18092  * for node in range(len(nodeElementOffsets)-1):
18093  * nb_el = 0
18094  * detJ_patch = 0. # <<<<<<<<<<<<<<
18095  * for ndi in range(nd):
18096  * grad_sum[ndi] = 0.
18097  */
18098  __pyx_v_detJ_patch = 0.;
18099 
18100  /* "mprans/cMoveMeshMonitor.pyx":1069
18101  * nb_el = 0
18102  * detJ_patch = 0.
18103  * for ndi in range(nd): # <<<<<<<<<<<<<<
18104  * grad_sum[ndi] = 0.
18105  * for eOffset in range(nodeElementOffsets[node],
18106  */
18107  __pyx_t_11 = __pyx_v_nd;
18108  __pyx_t_12 = __pyx_t_11;
18109  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
18110  __pyx_v_ndi = __pyx_t_13;
18111 
18112  /* "mprans/cMoveMeshMonitor.pyx":1070
18113  * detJ_patch = 0.
18114  * for ndi in range(nd):
18115  * grad_sum[ndi] = 0. # <<<<<<<<<<<<<<
18116  * for eOffset in range(nodeElementOffsets[node],
18117  * nodeElementOffsets[node+1]):
18118  */
18119  __pyx_t_14 = __pyx_v_ndi;
18120  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_grad_sum.shape[0];
18121  *((double *) ( /* dim=0 */ (__pyx_v_grad_sum.data + __pyx_t_14 * __pyx_v_grad_sum.strides[0]) )) = 0.;
18122  }
18123 
18124  /* "mprans/cMoveMeshMonitor.pyx":1071
18125  * for ndi in range(nd):
18126  * grad_sum[ndi] = 0.
18127  * for eOffset in range(nodeElementOffsets[node], # <<<<<<<<<<<<<<
18128  * nodeElementOffsets[node+1]):
18129  * nb_el += 1
18130  */
18131  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_node); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1071, __pyx_L1_error)
18132  __pyx_t_14 = __pyx_t_15;
18133  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeElementOffsets.shape[0];
18134  __pyx_t_6 = __Pyx_PyInt_From_int((*((int *) ( /* dim=0 */ (__pyx_v_nodeElementOffsets.data + __pyx_t_14 * __pyx_v_nodeElementOffsets.strides[0]) )))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1071, __pyx_L1_error)
18135  __Pyx_GOTREF(__pyx_t_6);
18136 
18137  /* "mprans/cMoveMeshMonitor.pyx":1072
18138  * grad_sum[ndi] = 0.
18139  * for eOffset in range(nodeElementOffsets[node],
18140  * nodeElementOffsets[node+1]): # <<<<<<<<<<<<<<
18141  * nb_el += 1
18142  * eN = nodeElementsArray[eOffset]
18143  */
18144  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_node, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1072, __pyx_L1_error)
18145  __Pyx_GOTREF(__pyx_t_3);
18146  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1072, __pyx_L1_error)
18147  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18148  __pyx_t_14 = __pyx_t_15;
18149  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeElementOffsets.shape[0];
18150  __pyx_t_3 = __Pyx_PyInt_From_int((*((int *) ( /* dim=0 */ (__pyx_v_nodeElementOffsets.data + __pyx_t_14 * __pyx_v_nodeElementOffsets.strides[0]) )))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1072, __pyx_L1_error)
18151  __Pyx_GOTREF(__pyx_t_3);
18152 
18153  /* "mprans/cMoveMeshMonitor.pyx":1071
18154  * for ndi in range(nd):
18155  * grad_sum[ndi] = 0.
18156  * for eOffset in range(nodeElementOffsets[node], # <<<<<<<<<<<<<<
18157  * nodeElementOffsets[node+1]):
18158  * nb_el += 1
18159  */
18160  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1071, __pyx_L1_error)
18161  __Pyx_GOTREF(__pyx_t_5);
18162  __Pyx_GIVEREF(__pyx_t_6);
18163  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
18164  __Pyx_GIVEREF(__pyx_t_3);
18165  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
18166  __pyx_t_6 = 0;
18167  __pyx_t_3 = 0;
18168  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error)
18169  __Pyx_GOTREF(__pyx_t_3);
18170  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18171  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
18172  __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_15 = 0;
18173  __pyx_t_16 = NULL;
18174  } else {
18175  __pyx_t_15 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1071, __pyx_L1_error)
18176  __Pyx_GOTREF(__pyx_t_5);
18177  __pyx_t_16 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1071, __pyx_L1_error)
18178  }
18179  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18180  for (;;) {
18181  if (likely(!__pyx_t_16)) {
18182  if (likely(PyList_CheckExact(__pyx_t_5))) {
18183  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_5)) break;
18184  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18185  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1071, __pyx_L1_error)
18186  #else
18187  __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error)
18188  __Pyx_GOTREF(__pyx_t_3);
18189  #endif
18190  } else {
18191  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
18192  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18193  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1071, __pyx_L1_error)
18194  #else
18195  __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error)
18196  __Pyx_GOTREF(__pyx_t_3);
18197  #endif
18198  }
18199  } else {
18200  __pyx_t_3 = __pyx_t_16(__pyx_t_5);
18201  if (unlikely(!__pyx_t_3)) {
18202  PyObject* exc_type = PyErr_Occurred();
18203  if (exc_type) {
18204  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18205  else __PYX_ERR(0, 1071, __pyx_L1_error)
18206  }
18207  break;
18208  }
18209  __Pyx_GOTREF(__pyx_t_3);
18210  }
18211  __Pyx_XDECREF_SET(__pyx_v_eOffset, __pyx_t_3);
18212  __pyx_t_3 = 0;
18213 
18214  /* "mprans/cMoveMeshMonitor.pyx":1073
18215  * for eOffset in range(nodeElementOffsets[node],
18216  * nodeElementOffsets[node+1]):
18217  * nb_el += 1 # <<<<<<<<<<<<<<
18218  * eN = nodeElementsArray[eOffset]
18219  * # for k in range(n_quad):
18220  */
18221  __pyx_v_nb_el = (__pyx_v_nb_el + 1);
18222 
18223  /* "mprans/cMoveMeshMonitor.pyx":1074
18224  * nodeElementOffsets[node+1]):
18225  * nb_el += 1
18226  * eN = nodeElementsArray[eOffset] # <<<<<<<<<<<<<<
18227  * # for k in range(n_quad):
18228  * # grad_k = grads[eN, k]
18229  */
18230  __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eOffset); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1074, __pyx_L1_error)
18231  __pyx_t_14 = __pyx_t_17;
18232  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_nodeElementsArray.shape[0];
18233  __pyx_t_3 = __Pyx_PyInt_From_int((*((int *) ( /* dim=0 */ (__pyx_v_nodeElementsArray.data + __pyx_t_14 * __pyx_v_nodeElementsArray.strides[0]) )))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error)
18234  __Pyx_GOTREF(__pyx_t_3);
18235  __Pyx_XDECREF_SET(__pyx_v_eN, __pyx_t_3);
18236  __pyx_t_3 = 0;
18237 
18238  /* "mprans/cMoveMeshMonitor.pyx":1079
18239  * # grad_eN_av += grad_k
18240  * # grad_eN_av /= n_quad
18241  * detJ_patch += detJ_array[eN,0] # <<<<<<<<<<<<<<
18242  * for ndi in range(nd):
18243  * grad_sum[ndi] += detJ_array[eN,0]*grads[eN, 0, ndi] # same value at all quad points
18244  */
18245  __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eN); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1079, __pyx_L1_error)
18246  __pyx_t_14 = __pyx_t_17;
18247  __pyx_t_18 = 0;
18248  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_detJ_array.shape[0];
18249  if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_detJ_array.shape[1];
18250  __pyx_v_detJ_patch = (__pyx_v_detJ_patch + (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_detJ_array.data + __pyx_t_14 * __pyx_v_detJ_array.strides[0]) ) + __pyx_t_18 * __pyx_v_detJ_array.strides[1]) ))));
18251 
18252  /* "mprans/cMoveMeshMonitor.pyx":1080
18253  * # grad_eN_av /= n_quad
18254  * detJ_patch += detJ_array[eN,0]
18255  * for ndi in range(nd): # <<<<<<<<<<<<<<
18256  * grad_sum[ndi] += detJ_array[eN,0]*grads[eN, 0, ndi] # same value at all quad points
18257  * for ndi in range(nd):
18258  */
18259  __pyx_t_11 = __pyx_v_nd;
18260  __pyx_t_12 = __pyx_t_11;
18261  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
18262  __pyx_v_ndi = __pyx_t_13;
18263 
18264  /* "mprans/cMoveMeshMonitor.pyx":1081
18265  * detJ_patch += detJ_array[eN,0]
18266  * for ndi in range(nd):
18267  * grad_sum[ndi] += detJ_array[eN,0]*grads[eN, 0, ndi] # same value at all quad points # <<<<<<<<<<<<<<
18268  * for ndi in range(nd):
18269  * recovered_grads[node, ndi] = grad_sum[ndi]/detJ_patch
18270  */
18271  __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eN); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1081, __pyx_L1_error)
18272  __pyx_t_18 = __pyx_t_17;
18273  __pyx_t_14 = 0;
18274  if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_detJ_array.shape[0];
18275  if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_detJ_array.shape[1];
18276  __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_eN); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1081, __pyx_L1_error)
18277  __pyx_t_20 = __pyx_t_19;
18278  __pyx_t_21 = 0;
18279  __pyx_t_22 = __pyx_v_ndi;
18280  if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_grads.shape[0];
18281  if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_v_grads.shape[1];
18282  if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_v_grads.shape[2];
18283  __pyx_t_23 = __pyx_v_ndi;
18284  if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_v_grad_sum.shape[0];
18285  *((double *) ( /* dim=0 */ (__pyx_v_grad_sum.data + __pyx_t_23 * __pyx_v_grad_sum.strides[0]) )) += ((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_detJ_array.data + __pyx_t_18 * __pyx_v_detJ_array.strides[0]) ) + __pyx_t_14 * __pyx_v_detJ_array.strides[1]) ))) * (*((double *) ( /* dim=2 */ (( /* dim=1 */ (( /* dim=0 */ (__pyx_v_grads.data + __pyx_t_20 * __pyx_v_grads.strides[0]) ) + __pyx_t_21 * __pyx_v_grads.strides[1]) ) + __pyx_t_22 * __pyx_v_grads.strides[2]) ))));
18286  }
18287 
18288  /* "mprans/cMoveMeshMonitor.pyx":1071
18289  * for ndi in range(nd):
18290  * grad_sum[ndi] = 0.
18291  * for eOffset in range(nodeElementOffsets[node], # <<<<<<<<<<<<<<
18292  * nodeElementOffsets[node+1]):
18293  * nb_el += 1
18294  */
18295  }
18296  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18297 
18298  /* "mprans/cMoveMeshMonitor.pyx":1082
18299  * for ndi in range(nd):
18300  * grad_sum[ndi] += detJ_array[eN,0]*grads[eN, 0, ndi] # same value at all quad points
18301  * for ndi in range(nd): # <<<<<<<<<<<<<<
18302  * recovered_grads[node, ndi] = grad_sum[ndi]/detJ_patch
18303  * return recovered_grads
18304  */
18305  __pyx_t_11 = __pyx_v_nd;
18306  __pyx_t_12 = __pyx_t_11;
18307  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
18308  __pyx_v_ndi = __pyx_t_13;
18309 
18310  /* "mprans/cMoveMeshMonitor.pyx":1083
18311  * grad_sum[ndi] += detJ_array[eN,0]*grads[eN, 0, ndi] # same value at all quad points
18312  * for ndi in range(nd):
18313  * recovered_grads[node, ndi] = grad_sum[ndi]/detJ_patch # <<<<<<<<<<<<<<
18314  * return recovered_grads
18315  *
18316  */
18317  __pyx_t_22 = __pyx_v_ndi;
18318  if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_v_grad_sum.shape[0];
18319  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_node); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L1_error)
18320  __pyx_t_21 = __pyx_t_15;
18321  __pyx_t_20 = __pyx_v_ndi;
18322  if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_v_recovered_grads.shape[0];
18323  if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_recovered_grads.shape[1];
18324  *((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_recovered_grads.data + __pyx_t_21 * __pyx_v_recovered_grads.strides[0]) ) + __pyx_t_20 * __pyx_v_recovered_grads.strides[1]) )) = ((*((double *) ( /* dim=0 */ (__pyx_v_grad_sum.data + __pyx_t_22 * __pyx_v_grad_sum.strides[0]) ))) / __pyx_v_detJ_patch);
18325  }
18326 
18327  /* "mprans/cMoveMeshMonitor.pyx":1066
18328  * cdef double detJ_patch = 0.
18329  * cdef double[:] grad_sum = np.zeros(nd)
18330  * for node in range(len(nodeElementOffsets)-1): # <<<<<<<<<<<<<<
18331  * nb_el = 0
18332  * detJ_patch = 0.
18333  */
18334  }
18335  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18336 
18337  /* "mprans/cMoveMeshMonitor.pyx":1084
18338  * for ndi in range(nd):
18339  * recovered_grads[node, ndi] = grad_sum[ndi]/detJ_patch
18340  * return recovered_grads # <<<<<<<<<<<<<<
18341  *
18342  *
18343  */
18344  __PYX_INC_MEMVIEW(&__pyx_v_recovered_grads, 0);
18345  __pyx_r = __pyx_v_recovered_grads;
18346  goto __pyx_L0;
18347 
18348  /* "mprans/cMoveMeshMonitor.pyx":1057
18349  * nd=nd)
18350  *
18351  * cdef double[:,:] cppGradientRecoveryAtNodesWeighted(double[:,:,:] grads, # <<<<<<<<<<<<<<
18352  * int[:] nodeElementsArray,
18353  * int[:] nodeElementOffsets,
18354  */
18355 
18356  /* function exit code */
18357  __pyx_L1_error:;
18358  __Pyx_XDECREF(__pyx_t_1);
18359  __Pyx_XDECREF(__pyx_t_2);
18360  __Pyx_XDECREF(__pyx_t_3);
18361  __Pyx_XDECREF(__pyx_t_5);
18362  __Pyx_XDECREF(__pyx_t_6);
18363  __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
18364  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
18365  __pyx_r.data = NULL;
18366  __pyx_r.memview = NULL;
18367  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.cppGradientRecoveryAtNodesWeighted", __pyx_clineno, __pyx_lineno, __pyx_filename);
18368  goto __pyx_L2;
18369  __pyx_L0:;
18370  if (unlikely(!__pyx_r.memview)) {
18371  PyErr_SetString(PyExc_TypeError, "Memoryview return value is not initialized");
18372  }
18373  __pyx_L2:;
18374  __PYX_XDEC_MEMVIEW(&__pyx_v_recovered_grads, 1);
18375  __PYX_XDEC_MEMVIEW(&__pyx_v_grad_sum, 1);
18376  __Pyx_XDECREF(__pyx_v_node);
18377  __Pyx_XDECREF(__pyx_v_eOffset);
18378  __Pyx_XDECREF(__pyx_v_eN);
18379  __Pyx_RefNannyFinishContext();
18380  return __pyx_r;
18381 }
18382 
18383 /* "mprans/cMoveMeshMonitor.pyx":1171
18384  *
18385  *
18386  * def pyCheckOwnedVariable(int variable_nb_local, # <<<<<<<<<<<<<<
18387  * int rank,
18388  * int nVariables_owned,
18389  */
18390 
18391 /* Python wrapper */
18392 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_9pyCheckOwnedVariable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18393 static PyMethodDef __pyx_mdef_6mprans_16cMoveMeshMonitor_9pyCheckOwnedVariable = {"pyCheckOwnedVariable", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_16cMoveMeshMonitor_9pyCheckOwnedVariable, METH_VARARGS|METH_KEYWORDS, 0};
18394 static PyObject *__pyx_pw_6mprans_16cMoveMeshMonitor_9pyCheckOwnedVariable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18395  int __pyx_v_variable_nb_local;
18396  int __pyx_v_rank;
18397  int __pyx_v_nVariables_owned;
18398  __Pyx_memviewslice __pyx_v_variableNumbering_subdomain2global = { 0, 0, { 0 }, { 0 }, { 0 } };
18399  __Pyx_memviewslice __pyx_v_variableOffsets_subdomain_owned = { 0, 0, { 0 }, { 0 }, { 0 } };
18400  int __pyx_lineno = 0;
18401  const char *__pyx_filename = NULL;
18402  int __pyx_clineno = 0;
18403  PyObject *__pyx_r = 0;
18404  __Pyx_RefNannyDeclarations
18405  __Pyx_RefNannySetupContext("pyCheckOwnedVariable (wrapper)", 0);
18406  {
18407  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_variable_nb_local,&__pyx_n_s_rank,&__pyx_n_s_nVariables_owned,&__pyx_n_s_variableNumbering_subdomain2glob,&__pyx_n_s_variableOffsets_subdomain_owned,0};
18408  PyObject* values[5] = {0,0,0,0,0};
18409  if (unlikely(__pyx_kwds)) {
18410  Py_ssize_t kw_args;
18411  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18412  switch (pos_args) {
18413  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
18414  CYTHON_FALLTHROUGH;
18415  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
18416  CYTHON_FALLTHROUGH;
18417  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18418  CYTHON_FALLTHROUGH;
18419  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18420  CYTHON_FALLTHROUGH;
18421  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18422  CYTHON_FALLTHROUGH;
18423  case 0: break;
18424  default: goto __pyx_L5_argtuple_error;
18425  }
18426  kw_args = PyDict_Size(__pyx_kwds);
18427  switch (pos_args) {
18428  case 0:
18429  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_variable_nb_local)) != 0)) kw_args--;
18430  else goto __pyx_L5_argtuple_error;
18431  CYTHON_FALLTHROUGH;
18432  case 1:
18433  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rank)) != 0)) kw_args--;
18434  else {
18435  __Pyx_RaiseArgtupleInvalid("pyCheckOwnedVariable", 1, 5, 5, 1); __PYX_ERR(0, 1171, __pyx_L3_error)
18436  }
18437  CYTHON_FALLTHROUGH;
18438  case 2:
18439  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nVariables_owned)) != 0)) kw_args--;
18440  else {
18441  __Pyx_RaiseArgtupleInvalid("pyCheckOwnedVariable", 1, 5, 5, 2); __PYX_ERR(0, 1171, __pyx_L3_error)
18442  }
18443  CYTHON_FALLTHROUGH;
18444  case 3:
18445  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_variableNumbering_subdomain2glob)) != 0)) kw_args--;
18446  else {
18447  __Pyx_RaiseArgtupleInvalid("pyCheckOwnedVariable", 1, 5, 5, 3); __PYX_ERR(0, 1171, __pyx_L3_error)
18448  }
18449  CYTHON_FALLTHROUGH;
18450  case 4:
18451  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_variableOffsets_subdomain_owned)) != 0)) kw_args--;
18452  else {
18453  __Pyx_RaiseArgtupleInvalid("pyCheckOwnedVariable", 1, 5, 5, 4); __PYX_ERR(0, 1171, __pyx_L3_error)
18454  }
18455  }
18456  if (unlikely(kw_args > 0)) {
18457  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pyCheckOwnedVariable") < 0)) __PYX_ERR(0, 1171, __pyx_L3_error)
18458  }
18459  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
18460  goto __pyx_L5_argtuple_error;
18461  } else {
18462  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18463  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18464  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18465  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
18466  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
18467  }
18468  __pyx_v_variable_nb_local = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_variable_nb_local == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1171, __pyx_L3_error)
18469  __pyx_v_rank = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_rank == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1172, __pyx_L3_error)
18470  __pyx_v_nVariables_owned = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nVariables_owned == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1173, __pyx_L3_error)
18471  __pyx_v_variableNumbering_subdomain2global = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_variableNumbering_subdomain2global.memview)) __PYX_ERR(0, 1174, __pyx_L3_error)
18472  __pyx_v_variableOffsets_subdomain_owned = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_variableOffsets_subdomain_owned.memview)) __PYX_ERR(0, 1175, __pyx_L3_error)
18473  }
18474  goto __pyx_L4_argument_unpacking_done;
18475  __pyx_L5_argtuple_error:;
18476  __Pyx_RaiseArgtupleInvalid("pyCheckOwnedVariable", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1171, __pyx_L3_error)
18477  __pyx_L3_error:;
18478  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.pyCheckOwnedVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
18479  __Pyx_RefNannyFinishContext();
18480  return NULL;
18481  __pyx_L4_argument_unpacking_done:;
18482  __pyx_r = __pyx_pf_6mprans_16cMoveMeshMonitor_8pyCheckOwnedVariable(__pyx_self, __pyx_v_variable_nb_local, __pyx_v_rank, __pyx_v_nVariables_owned, __pyx_v_variableNumbering_subdomain2global, __pyx_v_variableOffsets_subdomain_owned);
18483 
18484  /* function exit code */
18485  __Pyx_RefNannyFinishContext();
18486  return __pyx_r;
18487 }
18488 
18489 static PyObject *__pyx_pf_6mprans_16cMoveMeshMonitor_8pyCheckOwnedVariable(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) {
18490  PyObject *__pyx_r = NULL;
18491  __Pyx_RefNannyDeclarations
18492  PyObject *__pyx_t_1 = NULL;
18493  int __pyx_lineno = 0;
18494  const char *__pyx_filename = NULL;
18495  int __pyx_clineno = 0;
18496  __Pyx_RefNannySetupContext("pyCheckOwnedVariable", 0);
18497 
18498  /* "mprans/cMoveMeshMonitor.pyx":1176
18499  * int[:] variableNumbering_subdomain2global,
18500  * int[:] variableOffsets_subdomain_owned):
18501  * return checkOwnedVariable(variable_nb_local=variable_nb_local, # <<<<<<<<<<<<<<
18502  * rank=rank,
18503  * nVariables_owned=nVariables_owned,
18504  */
18505  __Pyx_XDECREF(__pyx_r);
18506 
18507  /* "mprans/cMoveMeshMonitor.pyx":1180
18508  * nVariables_owned=nVariables_owned,
18509  * variableNumbering_subdomain2global=variableNumbering_subdomain2global,
18510  * variableOffsets_subdomain_owned=variableOffsets_subdomain_owned) # <<<<<<<<<<<<<<
18511  *
18512  * cdef tuple checkOwnedVariable(int variable_nb_local,
18513  */
18514  __pyx_t_1 = __pyx_f_6mprans_16cMoveMeshMonitor_checkOwnedVariable(__pyx_v_variable_nb_local, __pyx_v_rank, __pyx_v_nVariables_owned, __pyx_v_variableNumbering_subdomain2global, __pyx_v_variableOffsets_subdomain_owned); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L1_error)
18515  __Pyx_GOTREF(__pyx_t_1);
18516  __pyx_r = __pyx_t_1;
18517  __pyx_t_1 = 0;
18518  goto __pyx_L0;
18519 
18520  /* "mprans/cMoveMeshMonitor.pyx":1171
18521  *
18522  *
18523  * def pyCheckOwnedVariable(int variable_nb_local, # <<<<<<<<<<<<<<
18524  * int rank,
18525  * int nVariables_owned,
18526  */
18527 
18528  /* function exit code */
18529  __pyx_L1_error:;
18530  __Pyx_XDECREF(__pyx_t_1);
18531  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.pyCheckOwnedVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
18532  __pyx_r = NULL;
18533  __pyx_L0:;
18534  __PYX_XDEC_MEMVIEW(&__pyx_v_variableNumbering_subdomain2global, 1);
18535  __PYX_XDEC_MEMVIEW(&__pyx_v_variableOffsets_subdomain_owned, 1);
18536  __Pyx_XGIVEREF(__pyx_r);
18537  __Pyx_RefNannyFinishContext();
18538  return __pyx_r;
18539 }
18540 
18541 /* "mprans/cMoveMeshMonitor.pyx":1182
18542  * variableOffsets_subdomain_owned=variableOffsets_subdomain_owned)
18543  *
18544  * cdef tuple checkOwnedVariable(int variable_nb_local, # <<<<<<<<<<<<<<
18545  * int rank,
18546  * int nVariables_owned,
18547  */
18548 
18549 static PyObject *__pyx_f_6mprans_16cMoveMeshMonitor_checkOwnedVariable(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) {
18550  int __pyx_v_nSubdomains;
18551  int __pyx_v_variable_nb_global;
18552  int __pyx_v_new_variable_nb_local;
18553  int __pyx_v_new_rank;
18554  PyObject *__pyx_v_i = NULL;
18555  PyObject *__pyx_r = NULL;
18556  __Pyx_RefNannyDeclarations
18557  size_t __pyx_t_1;
18558  int __pyx_t_2;
18559  Py_ssize_t __pyx_t_3;
18560  Py_ssize_t __pyx_t_4;
18561  int __pyx_t_5;
18562  PyObject *__pyx_t_6 = NULL;
18563  PyObject *__pyx_t_7 = NULL;
18564  Py_ssize_t __pyx_t_8;
18565  PyObject *(*__pyx_t_9)(PyObject *);
18566  Py_ssize_t __pyx_t_10;
18567  int __pyx_t_11;
18568  PyObject *__pyx_t_12 = NULL;
18569  int __pyx_lineno = 0;
18570  const char *__pyx_filename = NULL;
18571  int __pyx_clineno = 0;
18572  __Pyx_RefNannySetupContext("checkOwnedVariable", 0);
18573 
18574  /* "mprans/cMoveMeshMonitor.pyx":1187
18575  * int[:] variableNumbering_subdomain2global,
18576  * int[:] variableOffsets_subdomain_owned):
18577  * cdef int nSubdomains = len(variableOffsets_subdomain_owned)-1 # <<<<<<<<<<<<<<
18578  * cdef int variable_nb_global
18579  * cdef int new_variable_nb_local
18580  */
18581  __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_variableOffsets_subdomain_owned);
18582  __pyx_v_nSubdomains = (__pyx_t_1 - 1);
18583 
18584  /* "mprans/cMoveMeshMonitor.pyx":1190
18585  * cdef int variable_nb_global
18586  * cdef int new_variable_nb_local
18587  * cdef int new_rank = -2 # initialised as fake rank # <<<<<<<<<<<<<<
18588  * if variable_nb_local >= nVariables_owned:
18589  * # change rank ownership
18590  */
18591  __pyx_v_new_rank = -2;
18592 
18593  /* "mprans/cMoveMeshMonitor.pyx":1191
18594  * cdef int new_variable_nb_local
18595  * cdef int new_rank = -2 # initialised as fake rank
18596  * if variable_nb_local >= nVariables_owned: # <<<<<<<<<<<<<<
18597  * # change rank ownership
18598  * variable_nb_global = variableNumbering_subdomain2global[variable_nb_local]
18599  */
18600  __pyx_t_2 = ((__pyx_v_variable_nb_local >= __pyx_v_nVariables_owned) != 0);
18601  if (__pyx_t_2) {
18602 
18603  /* "mprans/cMoveMeshMonitor.pyx":1193
18604  * if variable_nb_local >= nVariables_owned:
18605  * # change rank ownership
18606  * variable_nb_global = variableNumbering_subdomain2global[variable_nb_local] # <<<<<<<<<<<<<<
18607  * if not variableOffsets_subdomain_owned[rank] <= variable_nb_global < variableOffsets_subdomain_owned[rank+1]:
18608  * for i in range(nSubdomains+1):
18609  */
18610  __pyx_t_3 = __pyx_v_variable_nb_local;
18611  if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_variableNumbering_subdomain2global.shape[0];
18612  __pyx_v_variable_nb_global = (*((int *) ( /* dim=0 */ (__pyx_v_variableNumbering_subdomain2global.data + __pyx_t_3 * __pyx_v_variableNumbering_subdomain2global.strides[0]) )));
18613 
18614  /* "mprans/cMoveMeshMonitor.pyx":1194
18615  * # change rank ownership
18616  * variable_nb_global = variableNumbering_subdomain2global[variable_nb_local]
18617  * if not variableOffsets_subdomain_owned[rank] <= variable_nb_global < variableOffsets_subdomain_owned[rank+1]: # <<<<<<<<<<<<<<
18618  * for i in range(nSubdomains+1):
18619  * if variableOffsets_subdomain_owned[i] > variable_nb_global:
18620  */
18621  __pyx_t_3 = __pyx_v_rank;
18622  if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_variableOffsets_subdomain_owned.shape[0];
18623  __pyx_t_2 = ((*((int *) ( /* dim=0 */ (__pyx_v_variableOffsets_subdomain_owned.data + __pyx_t_3 * __pyx_v_variableOffsets_subdomain_owned.strides[0]) ))) <= __pyx_v_variable_nb_global);
18624  if (__pyx_t_2) {
18625  __pyx_t_4 = (__pyx_v_rank + 1);
18626  if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_variableOffsets_subdomain_owned.shape[0];
18627  __pyx_t_2 = (__pyx_v_variable_nb_global < (*((int *) ( /* dim=0 */ (__pyx_v_variableOffsets_subdomain_owned.data + __pyx_t_4 * __pyx_v_variableOffsets_subdomain_owned.strides[0]) ))));
18628  }
18629  __pyx_t_5 = ((!(__pyx_t_2 != 0)) != 0);
18630  if (__pyx_t_5) {
18631 
18632  /* "mprans/cMoveMeshMonitor.pyx":1195
18633  * variable_nb_global = variableNumbering_subdomain2global[variable_nb_local]
18634  * if not variableOffsets_subdomain_owned[rank] <= variable_nb_global < variableOffsets_subdomain_owned[rank+1]:
18635  * for i in range(nSubdomains+1): # <<<<<<<<<<<<<<
18636  * if variableOffsets_subdomain_owned[i] > variable_nb_global:
18637  * # changing processor
18638  */
18639  __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_v_nSubdomains + 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error)
18640  __Pyx_GOTREF(__pyx_t_6);
18641  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1195, __pyx_L1_error)
18642  __Pyx_GOTREF(__pyx_t_7);
18643  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18644  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
18645  __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
18646  __pyx_t_9 = NULL;
18647  } else {
18648  __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error)
18649  __Pyx_GOTREF(__pyx_t_6);
18650  __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1195, __pyx_L1_error)
18651  }
18652  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18653  for (;;) {
18654  if (likely(!__pyx_t_9)) {
18655  if (likely(PyList_CheckExact(__pyx_t_6))) {
18656  if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
18657  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18658  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1195, __pyx_L1_error)
18659  #else
18660  __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1195, __pyx_L1_error)
18661  __Pyx_GOTREF(__pyx_t_7);
18662  #endif
18663  } else {
18664  if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
18665  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18666  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1195, __pyx_L1_error)
18667  #else
18668  __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1195, __pyx_L1_error)
18669  __Pyx_GOTREF(__pyx_t_7);
18670  #endif
18671  }
18672  } else {
18673  __pyx_t_7 = __pyx_t_9(__pyx_t_6);
18674  if (unlikely(!__pyx_t_7)) {
18675  PyObject* exc_type = PyErr_Occurred();
18676  if (exc_type) {
18677  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18678  else __PYX_ERR(0, 1195, __pyx_L1_error)
18679  }
18680  break;
18681  }
18682  __Pyx_GOTREF(__pyx_t_7);
18683  }
18684  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
18685  __pyx_t_7 = 0;
18686 
18687  /* "mprans/cMoveMeshMonitor.pyx":1196
18688  * if not variableOffsets_subdomain_owned[rank] <= variable_nb_global < variableOffsets_subdomain_owned[rank+1]:
18689  * for i in range(nSubdomains+1):
18690  * if variableOffsets_subdomain_owned[i] > variable_nb_global: # <<<<<<<<<<<<<<
18691  * # changing processor
18692  * if new_rank == -2:
18693  */
18694  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L1_error)
18695  __pyx_t_3 = __pyx_t_10;
18696  if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_variableOffsets_subdomain_owned.shape[0];
18697  __pyx_t_5 = (((*((int *) ( /* dim=0 */ (__pyx_v_variableOffsets_subdomain_owned.data + __pyx_t_3 * __pyx_v_variableOffsets_subdomain_owned.strides[0]) ))) > __pyx_v_variable_nb_global) != 0);
18698  if (__pyx_t_5) {
18699 
18700  /* "mprans/cMoveMeshMonitor.pyx":1198
18701  * if variableOffsets_subdomain_owned[i] > variable_nb_global:
18702  * # changing processor
18703  * if new_rank == -2: # <<<<<<<<<<<<<<
18704  * new_rank = i-1
18705  * # getting nearest variable number on new rank
18706  */
18707  __pyx_t_5 = ((__pyx_v_new_rank == -2L) != 0);
18708  if (__pyx_t_5) {
18709 
18710  /* "mprans/cMoveMeshMonitor.pyx":1199
18711  * # changing processor
18712  * if new_rank == -2:
18713  * new_rank = i-1 # <<<<<<<<<<<<<<
18714  * # getting nearest variable number on new rank
18715  * if new_rank >= 0:
18716  */
18717  __pyx_t_7 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1199, __pyx_L1_error)
18718  __Pyx_GOTREF(__pyx_t_7);
18719  __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1199, __pyx_L1_error)
18720  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18721  __pyx_v_new_rank = __pyx_t_11;
18722 
18723  /* "mprans/cMoveMeshMonitor.pyx":1198
18724  * if variableOffsets_subdomain_owned[i] > variable_nb_global:
18725  * # changing processor
18726  * if new_rank == -2: # <<<<<<<<<<<<<<
18727  * new_rank = i-1
18728  * # getting nearest variable number on new rank
18729  */
18730  }
18731 
18732  /* "mprans/cMoveMeshMonitor.pyx":1196
18733  * if not variableOffsets_subdomain_owned[rank] <= variable_nb_global < variableOffsets_subdomain_owned[rank+1]:
18734  * for i in range(nSubdomains+1):
18735  * if variableOffsets_subdomain_owned[i] > variable_nb_global: # <<<<<<<<<<<<<<
18736  * # changing processor
18737  * if new_rank == -2:
18738  */
18739  }
18740 
18741  /* "mprans/cMoveMeshMonitor.pyx":1195
18742  * variable_nb_global = variableNumbering_subdomain2global[variable_nb_local]
18743  * if not variableOffsets_subdomain_owned[rank] <= variable_nb_global < variableOffsets_subdomain_owned[rank+1]:
18744  * for i in range(nSubdomains+1): # <<<<<<<<<<<<<<
18745  * if variableOffsets_subdomain_owned[i] > variable_nb_global:
18746  * # changing processor
18747  */
18748  }
18749  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18750 
18751  /* "mprans/cMoveMeshMonitor.pyx":1194
18752  * # change rank ownership
18753  * variable_nb_global = variableNumbering_subdomain2global[variable_nb_local]
18754  * if not variableOffsets_subdomain_owned[rank] <= variable_nb_global < variableOffsets_subdomain_owned[rank+1]: # <<<<<<<<<<<<<<
18755  * for i in range(nSubdomains+1):
18756  * if variableOffsets_subdomain_owned[i] > variable_nb_global:
18757  */
18758  }
18759 
18760  /* "mprans/cMoveMeshMonitor.pyx":1191
18761  * cdef int new_variable_nb_local
18762  * cdef int new_rank = -2 # initialised as fake rank
18763  * if variable_nb_local >= nVariables_owned: # <<<<<<<<<<<<<<
18764  * # change rank ownership
18765  * variable_nb_global = variableNumbering_subdomain2global[variable_nb_local]
18766  */
18767  }
18768 
18769  /* "mprans/cMoveMeshMonitor.pyx":1201
18770  * new_rank = i-1
18771  * # getting nearest variable number on new rank
18772  * if new_rank >= 0: # <<<<<<<<<<<<<<
18773  * new_variable_nb_local = variable_nb_global-variableOffsets_subdomain_owned[new_rank]
18774  * else:
18775  */
18776  __pyx_t_5 = ((__pyx_v_new_rank >= 0) != 0);
18777  if (__pyx_t_5) {
18778 
18779  /* "mprans/cMoveMeshMonitor.pyx":1202
18780  * # getting nearest variable number on new rank
18781  * if new_rank >= 0:
18782  * new_variable_nb_local = variable_nb_global-variableOffsets_subdomain_owned[new_rank] # <<<<<<<<<<<<<<
18783  * else:
18784  * new_rank = rank
18785  */
18786  __pyx_t_3 = __pyx_v_new_rank;
18787  if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_variableOffsets_subdomain_owned.shape[0];
18788  __pyx_v_new_variable_nb_local = (__pyx_v_variable_nb_global - (*((int *) ( /* dim=0 */ (__pyx_v_variableOffsets_subdomain_owned.data + __pyx_t_3 * __pyx_v_variableOffsets_subdomain_owned.strides[0]) ))));
18789 
18790  /* "mprans/cMoveMeshMonitor.pyx":1201
18791  * new_rank = i-1
18792  * # getting nearest variable number on new rank
18793  * if new_rank >= 0: # <<<<<<<<<<<<<<
18794  * new_variable_nb_local = variable_nb_global-variableOffsets_subdomain_owned[new_rank]
18795  * else:
18796  */
18797  goto __pyx_L9;
18798  }
18799 
18800  /* "mprans/cMoveMeshMonitor.pyx":1204
18801  * new_variable_nb_local = variable_nb_global-variableOffsets_subdomain_owned[new_rank]
18802  * else:
18803  * new_rank = rank # <<<<<<<<<<<<<<
18804  * new_variable_nb_local = variable_nb_local
18805  * return new_variable_nb_local, new_rank
18806  */
18807  /*else*/ {
18808  __pyx_v_new_rank = __pyx_v_rank;
18809 
18810  /* "mprans/cMoveMeshMonitor.pyx":1205
18811  * else:
18812  * new_rank = rank
18813  * new_variable_nb_local = variable_nb_local # <<<<<<<<<<<<<<
18814  * return new_variable_nb_local, new_rank
18815  *
18816  */
18817  __pyx_v_new_variable_nb_local = __pyx_v_variable_nb_local;
18818  }
18819  __pyx_L9:;
18820 
18821  /* "mprans/cMoveMeshMonitor.pyx":1206
18822  * new_rank = rank
18823  * new_variable_nb_local = variable_nb_local
18824  * return new_variable_nb_local, new_rank # <<<<<<<<<<<<<<
18825  *
18826  * # cdef retrieveSolution(double[:]x,
18827  */
18828  __Pyx_XDECREF(__pyx_r);
18829  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_new_variable_nb_local); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error)
18830  __Pyx_GOTREF(__pyx_t_6);
18831  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_new_rank); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1206, __pyx_L1_error)
18832  __Pyx_GOTREF(__pyx_t_7);
18833  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1206, __pyx_L1_error)
18834  __Pyx_GOTREF(__pyx_t_12);
18835  __Pyx_GIVEREF(__pyx_t_6);
18836  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6);
18837  __Pyx_GIVEREF(__pyx_t_7);
18838  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7);
18839  __pyx_t_6 = 0;
18840  __pyx_t_7 = 0;
18841  __pyx_r = ((PyObject*)__pyx_t_12);
18842  __pyx_t_12 = 0;
18843  goto __pyx_L0;
18844 
18845  /* "mprans/cMoveMeshMonitor.pyx":1182
18846  * variableOffsets_subdomain_owned=variableOffsets_subdomain_owned)
18847  *
18848  * cdef tuple checkOwnedVariable(int variable_nb_local, # <<<<<<<<<<<<<<
18849  * int rank,
18850  * int nVariables_owned,
18851  */
18852 
18853  /* function exit code */
18854  __pyx_L1_error:;
18855  __Pyx_XDECREF(__pyx_t_6);
18856  __Pyx_XDECREF(__pyx_t_7);
18857  __Pyx_XDECREF(__pyx_t_12);
18858  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.checkOwnedVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
18859  __pyx_r = 0;
18860  __pyx_L0:;
18861  __Pyx_XDECREF(__pyx_v_i);
18862  __Pyx_XGIVEREF(__pyx_r);
18863  __Pyx_RefNannyFinishContext();
18864  return __pyx_r;
18865 }
18866 
18867 /* "mprans/cMoveMeshMonitor.pyx":1630
18868  *
18869  *
18870  * cdef int[:] findN(double[:] coords, # <<<<<<<<<<<<<<
18871  * double[:,:] nodeArray,
18872  * int[:] nodeStarOffsets,
18873  */
18874 
18875 static __Pyx_memviewslice __pyx_f_6mprans_16cMoveMeshMonitor_findN(__Pyx_memviewslice __pyx_v_coords, __Pyx_memviewslice __pyx_v_nodeArray, __Pyx_memviewslice __pyx_v_nodeStarOffsets, __Pyx_memviewslice __pyx_v_nodeStarArray, int __pyx_v_nearestN, int __pyx_v_typeN, int __pyx_v_my_rank, int __pyx_v_nNodes_owned, __Pyx_memviewslice __pyx_v_nodeNumbering_subdomain2global, __Pyx_memviewslice __pyx_v_nodeOffsets_subdomain_owned, __Pyx_memviewslice __pyx_v_nodeElementOffsets, __Pyx_memviewslice __pyx_v_nodeElementsArray, __Pyx_memviewslice __pyx_v_elementBarycentersArray, __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_nElements_owned, __Pyx_memviewslice __pyx_v_elementNumbering_subdomain2global, __Pyx_memviewslice __pyx_v_elementOffsets_subdomain_owned, int __pyx_v_nElementBoundaries_owned, __Pyx_memviewslice __pyx_v_elementBoundaryNumbering_subdomain2global, __Pyx_memviewslice __pyx_v_elementBoundaryOffsets_subdomain_owned, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_elementNodesArray, CYTHON_UNUSED __Pyx_memviewslice __pyx_v_nodeMaterialTypes, CYTHON_UNUSED int __pyx_v_nNel) {
18876  __Pyx_memviewslice __pyx_v_result_in = { 0, 0, { 0 }, { 0 }, { 0 } };
18877  int __pyx_v_result_out[3];
18878  __Pyx_memviewslice __pyx_v_starting_coords = { 0, 0, { 0 }, { 0 }, { 0 } };
18879  int __pyx_v_rank;
18880  CYTHON_UNUSED bool __pyx_v_stop;
18881  __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } };
18882  __Pyx_RefNannyDeclarations
18883  PyObject *__pyx_t_1 = NULL;
18884  PyObject *__pyx_t_2 = NULL;
18885  PyObject *__pyx_t_3 = NULL;
18886  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
18887  int __pyx_t_5;
18888  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
18889  Py_ssize_t __pyx_t_7;
18890  Py_ssize_t __pyx_t_8;
18891  int __pyx_t_9;
18892  Py_ssize_t __pyx_t_10;
18893  struct __pyx_array_obj *__pyx_t_11 = NULL;
18894  int __pyx_lineno = 0;
18895  const char *__pyx_filename = NULL;
18896  int __pyx_clineno = 0;
18897  __Pyx_RefNannySetupContext("findN", 0);
18898 
18899  /* "mprans/cMoveMeshMonitor.pyx":1659
18900  * cdef int[:] result_in
18901  * cdef int[3] result_out
18902  * cdef double[:] starting_coords = np.zeros(3) # <<<<<<<<<<<<<<
18903  * cdef int rank = my_rank # rank of owning processor
18904  * cdef bool stop = False
18905  */
18906  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1659, __pyx_L1_error)
18907  __Pyx_GOTREF(__pyx_t_2);
18908  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1659, __pyx_L1_error)
18909  __Pyx_GOTREF(__pyx_t_3);
18910  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18911  __pyx_t_2 = NULL;
18912  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
18913  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
18914  if (likely(__pyx_t_2)) {
18915  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
18916  __Pyx_INCREF(__pyx_t_2);
18917  __Pyx_INCREF(function);
18918  __Pyx_DECREF_SET(__pyx_t_3, function);
18919  }
18920  }
18921  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
18922  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18923  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1659, __pyx_L1_error)
18924  __Pyx_GOTREF(__pyx_t_1);
18925  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18926  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 1659, __pyx_L1_error)
18927  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18928  __pyx_v_starting_coords = __pyx_t_4;
18929  __pyx_t_4.memview = NULL;
18930  __pyx_t_4.data = NULL;
18931 
18932  /* "mprans/cMoveMeshMonitor.pyx":1660
18933  * cdef int[3] result_out
18934  * cdef double[:] starting_coords = np.zeros(3)
18935  * cdef int rank = my_rank # rank of owning processor # <<<<<<<<<<<<<<
18936  * cdef bool stop = False
18937  * if typeN == 0: # node
18938  */
18939  __pyx_v_rank = __pyx_v_my_rank;
18940 
18941  /* "mprans/cMoveMeshMonitor.pyx":1661
18942  * cdef double[:] starting_coords = np.zeros(3)
18943  * cdef int rank = my_rank # rank of owning processor
18944  * cdef bool stop = False # <<<<<<<<<<<<<<
18945  * if typeN == 0: # node
18946  * # find closest node to coords
18947  */
18948  __pyx_v_stop = 0;
18949 
18950  /* "mprans/cMoveMeshMonitor.pyx":1662
18951  * cdef int rank = my_rank # rank of owning processor
18952  * cdef bool stop = False
18953  * if typeN == 0: # node # <<<<<<<<<<<<<<
18954  * # find closest node to coords
18955  * nearestN = ms.pyxGetLocalNearestNode(coords=coords,
18956  */
18957  __pyx_t_5 = ((__pyx_v_typeN == 0) != 0);
18958  if (__pyx_t_5) {
18959 
18960  /* "mprans/cMoveMeshMonitor.pyx":1664
18961  * if typeN == 0: # node
18962  * # find closest node to coords
18963  * nearestN = ms.pyxGetLocalNearestNode(coords=coords, # <<<<<<<<<<<<<<
18964  * nodeArray=nodeArray,
18965  * nodeStarOffsets=nodeStarOffsets,
18966  */
18967  __pyx_v_nearestN = __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestNode(__pyx_v_coords, __pyx_v_nodeArray, __pyx_v_nodeStarOffsets, __pyx_v_nodeStarArray, __pyx_v_nearestN);
18968 
18969  /* "mprans/cMoveMeshMonitor.pyx":1670
18970  * node=nearestN)
18971  * # check if closest node is owned
18972  * if nearestN >= nNodes_owned: # <<<<<<<<<<<<<<
18973  * result_in = ms.cyCheckOwnedVariable(variable_nb_local=nearestN,
18974  * rank=my_rank,
18975  */
18976  __pyx_t_5 = ((__pyx_v_nearestN >= __pyx_v_nNodes_owned) != 0);
18977  if (__pyx_t_5) {
18978 
18979  /* "mprans/cMoveMeshMonitor.pyx":1671
18980  * # check if closest node is owned
18981  * if nearestN >= nNodes_owned:
18982  * result_in = ms.cyCheckOwnedVariable(variable_nb_local=nearestN, # <<<<<<<<<<<<<<
18983  * rank=my_rank,
18984  * nVariables_owned=nNodes_owned,
18985  */
18986  __pyx_t_6 = __pyx_f_7proteus_6mprans_13MeshSmoothing_cyCheckOwnedVariable(__pyx_v_nearestN, __pyx_v_my_rank, __pyx_v_nNodes_owned, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_nodeOffsets_subdomain_owned); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1671, __pyx_L1_error)
18987  __pyx_v_result_in = __pyx_t_6;
18988  __pyx_t_6.memview = NULL;
18989  __pyx_t_6.data = NULL;
18990 
18991  /* "mprans/cMoveMeshMonitor.pyx":1676
18992  * variableNumbering_subdomain2global=nodeNumbering_subdomain2global,
18993  * variableOffsets_subdomain_owned=nodeOffsets_subdomain_owned)
18994  * nearestN = result_in[0] # <<<<<<<<<<<<<<
18995  * rank = result_in[1]
18996  * else:
18997  */
18998  __pyx_t_7 = 0;
18999  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19000  __pyx_v_nearestN = (*((int *) ( /* dim=0 */ (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19001 
19002  /* "mprans/cMoveMeshMonitor.pyx":1677
19003  * variableOffsets_subdomain_owned=nodeOffsets_subdomain_owned)
19004  * nearestN = result_in[0]
19005  * rank = result_in[1] # <<<<<<<<<<<<<<
19006  * else:
19007  * # if owned, find closest element barycenter to coords
19008  */
19009  __pyx_t_7 = 1;
19010  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19011  __pyx_v_rank = (*((int *) ( /* dim=0 */ (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19012 
19013  /* "mprans/cMoveMeshMonitor.pyx":1670
19014  * node=nearestN)
19015  * # check if closest node is owned
19016  * if nearestN >= nNodes_owned: # <<<<<<<<<<<<<<
19017  * result_in = ms.cyCheckOwnedVariable(variable_nb_local=nearestN,
19018  * rank=my_rank,
19019  */
19020  goto __pyx_L4;
19021  }
19022 
19023  /* "mprans/cMoveMeshMonitor.pyx":1680
19024  * else:
19025  * # if owned, find closest element barycenter to coords
19026  * nearestN = ms.pyxGetLocalNearestElementAroundNode(coords=coords, # <<<<<<<<<<<<<<
19027  * nodeElementOffsets=nodeElementOffsets,
19028  * nodeElementsArray=nodeElementsArray,
19029  */
19030  /*else*/ {
19031 
19032  /* "mprans/cMoveMeshMonitor.pyx":1684
19033  * nodeElementsArray=nodeElementsArray,
19034  * elementBarycentersArray=elementBarycentersArray,
19035  * node=nearestN) # <<<<<<<<<<<<<<
19036  * typeN = 1
19037  * if typeN == 2: # element boundary
19038  */
19039  __pyx_v_nearestN = __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestElementAroundNode(__pyx_v_coords, __pyx_v_nodeElementOffsets, __pyx_v_nodeElementsArray, __pyx_v_elementBarycentersArray, __pyx_v_nearestN);
19040 
19041  /* "mprans/cMoveMeshMonitor.pyx":1685
19042  * elementBarycentersArray=elementBarycentersArray,
19043  * node=nearestN)
19044  * typeN = 1 # <<<<<<<<<<<<<<
19045  * if typeN == 2: # element boundary
19046  * # get local number
19047  */
19048  __pyx_v_typeN = 1;
19049  }
19050  __pyx_L4:;
19051 
19052  /* "mprans/cMoveMeshMonitor.pyx":1662
19053  * cdef int rank = my_rank # rank of owning processor
19054  * cdef bool stop = False
19055  * if typeN == 0: # node # <<<<<<<<<<<<<<
19056  * # find closest node to coords
19057  * nearestN = ms.pyxGetLocalNearestNode(coords=coords,
19058  */
19059  }
19060 
19061  /* "mprans/cMoveMeshMonitor.pyx":1686
19062  * node=nearestN)
19063  * typeN = 1
19064  * if typeN == 2: # element boundary # <<<<<<<<<<<<<<
19065  * # get local number
19066  * nearestN = ms.cyGetLocalVariable(variable_nb_global=nearestN,
19067  */
19068  __pyx_t_5 = ((__pyx_v_typeN == 2) != 0);
19069  if (__pyx_t_5) {
19070 
19071  /* "mprans/cMoveMeshMonitor.pyx":1688
19072  * if typeN == 2: # element boundary
19073  * # get local number
19074  * nearestN = ms.cyGetLocalVariable(variable_nb_global=nearestN, # <<<<<<<<<<<<<<
19075  * rank=my_rank,
19076  * nVariables_owned=nElementBoundaries_owned,
19077  */
19078  __pyx_v_nearestN = __pyx_f_7proteus_6mprans_13MeshSmoothing_cyGetLocalVariable(__pyx_v_nearestN, __pyx_v_my_rank, __pyx_v_nElementBoundaries_owned, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_elementBoundaryOffsets_subdomain_owned);
19079 
19080  /* "mprans/cMoveMeshMonitor.pyx":1694
19081  * variableOffsets_subdomain_owned=elementBoundaryOffsets_subdomain_owned)
19082  * # get an element from there
19083  * if elementBoundaryElementsArray[nearestN, 0] == -1 or elementBoundaryElementsArray[nearestN, 0] >= nElements_owned: # <<<<<<<<<<<<<<
19084  * nearestN = elementBoundaryElementsArray[nearestN, 1]
19085  * typeN = 1
19086  */
19087  __pyx_t_7 = __pyx_v_nearestN;
19088  __pyx_t_8 = 0;
19089  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[0];
19090  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[1];
19091  __pyx_t_9 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) == -1L) != 0);
19092  if (!__pyx_t_9) {
19093  } else {
19094  __pyx_t_5 = __pyx_t_9;
19095  goto __pyx_L7_bool_binop_done;
19096  }
19097  __pyx_t_8 = __pyx_v_nearestN;
19098  __pyx_t_7 = 0;
19099  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[0];
19100  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[1];
19101  __pyx_t_9 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) >= __pyx_v_nElements_owned) != 0);
19102  __pyx_t_5 = __pyx_t_9;
19103  __pyx_L7_bool_binop_done:;
19104  if (__pyx_t_5) {
19105 
19106  /* "mprans/cMoveMeshMonitor.pyx":1695
19107  * # get an element from there
19108  * if elementBoundaryElementsArray[nearestN, 0] == -1 or elementBoundaryElementsArray[nearestN, 0] >= nElements_owned:
19109  * nearestN = elementBoundaryElementsArray[nearestN, 1] # <<<<<<<<<<<<<<
19110  * typeN = 1
19111  * elif elementBoundaryElementsArray[nearestN, 1] == -1 or elementBoundaryElementsArray[nearestN, 1] >= nElements_owned:
19112  */
19113  __pyx_t_7 = __pyx_v_nearestN;
19114  __pyx_t_8 = 1;
19115  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[0];
19116  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[1];
19117  __pyx_v_nearestN = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
19118 
19119  /* "mprans/cMoveMeshMonitor.pyx":1696
19120  * if elementBoundaryElementsArray[nearestN, 0] == -1 or elementBoundaryElementsArray[nearestN, 0] >= nElements_owned:
19121  * nearestN = elementBoundaryElementsArray[nearestN, 1]
19122  * typeN = 1 # <<<<<<<<<<<<<<
19123  * elif elementBoundaryElementsArray[nearestN, 1] == -1 or elementBoundaryElementsArray[nearestN, 1] >= nElements_owned:
19124  * nearestN = elementBoundaryElementsArray[nearestN, 0]
19125  */
19126  __pyx_v_typeN = 1;
19127 
19128  /* "mprans/cMoveMeshMonitor.pyx":1694
19129  * variableOffsets_subdomain_owned=elementBoundaryOffsets_subdomain_owned)
19130  * # get an element from there
19131  * if elementBoundaryElementsArray[nearestN, 0] == -1 or elementBoundaryElementsArray[nearestN, 0] >= nElements_owned: # <<<<<<<<<<<<<<
19132  * nearestN = elementBoundaryElementsArray[nearestN, 1]
19133  * typeN = 1
19134  */
19135  goto __pyx_L6;
19136  }
19137 
19138  /* "mprans/cMoveMeshMonitor.pyx":1697
19139  * nearestN = elementBoundaryElementsArray[nearestN, 1]
19140  * typeN = 1
19141  * elif elementBoundaryElementsArray[nearestN, 1] == -1 or elementBoundaryElementsArray[nearestN, 1] >= nElements_owned: # <<<<<<<<<<<<<<
19142  * nearestN = elementBoundaryElementsArray[nearestN, 0]
19143  * typeN = 1
19144  */
19145  __pyx_t_8 = __pyx_v_nearestN;
19146  __pyx_t_7 = 1;
19147  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[0];
19148  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[1];
19149  __pyx_t_9 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) == -1L) != 0);
19150  if (!__pyx_t_9) {
19151  } else {
19152  __pyx_t_5 = __pyx_t_9;
19153  goto __pyx_L9_bool_binop_done;
19154  }
19155  __pyx_t_7 = __pyx_v_nearestN;
19156  __pyx_t_8 = 1;
19157  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[0];
19158  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[1];
19159  __pyx_t_9 = (((*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[1]) ))) >= __pyx_v_nElements_owned) != 0);
19160  __pyx_t_5 = __pyx_t_9;
19161  __pyx_L9_bool_binop_done:;
19162  if (__pyx_t_5) {
19163 
19164  /* "mprans/cMoveMeshMonitor.pyx":1698
19165  * typeN = 1
19166  * elif elementBoundaryElementsArray[nearestN, 1] == -1 or elementBoundaryElementsArray[nearestN, 1] >= nElements_owned:
19167  * nearestN = elementBoundaryElementsArray[nearestN, 0] # <<<<<<<<<<<<<<
19168  * typeN = 1
19169  * else:
19170  */
19171  __pyx_t_8 = __pyx_v_nearestN;
19172  __pyx_t_7 = 0;
19173  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[0];
19174  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[1];
19175  __pyx_v_nearestN = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
19176 
19177  /* "mprans/cMoveMeshMonitor.pyx":1699
19178  * elif elementBoundaryElementsArray[nearestN, 1] == -1 or elementBoundaryElementsArray[nearestN, 1] >= nElements_owned:
19179  * nearestN = elementBoundaryElementsArray[nearestN, 0]
19180  * typeN = 1 # <<<<<<<<<<<<<<
19181  * else:
19182  * # hack
19183  */
19184  __pyx_v_typeN = 1;
19185 
19186  /* "mprans/cMoveMeshMonitor.pyx":1697
19187  * nearestN = elementBoundaryElementsArray[nearestN, 1]
19188  * typeN = 1
19189  * elif elementBoundaryElementsArray[nearestN, 1] == -1 or elementBoundaryElementsArray[nearestN, 1] >= nElements_owned: # <<<<<<<<<<<<<<
19190  * nearestN = elementBoundaryElementsArray[nearestN, 0]
19191  * typeN = 1
19192  */
19193  goto __pyx_L6;
19194  }
19195 
19196  /* "mprans/cMoveMeshMonitor.pyx":1704
19197  * # must be on element boundary between processors
19198  * # take arbitrary element sharing boundary
19199  * nearestN = elementBoundaryElementsArray[nearestN, 0] # <<<<<<<<<<<<<<
19200  * typeN = 1
19201  *
19202  */
19203  /*else*/ {
19204  __pyx_t_7 = __pyx_v_nearestN;
19205  __pyx_t_8 = 0;
19206  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBoundaryElementsArray.shape[0];
19207  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBoundaryElementsArray.shape[1];
19208  __pyx_v_nearestN = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBoundaryElementsArray.data + __pyx_t_7 * __pyx_v_elementBoundaryElementsArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBoundaryElementsArray.strides[1]) )));
19209 
19210  /* "mprans/cMoveMeshMonitor.pyx":1705
19211  * # take arbitrary element sharing boundary
19212  * nearestN = elementBoundaryElementsArray[nearestN, 0]
19213  * typeN = 1 # <<<<<<<<<<<<<<
19214  *
19215  * if nearestN >= nElements_owned:
19216  */
19217  __pyx_v_typeN = 1;
19218  }
19219  __pyx_L6:;
19220 
19221  /* "mprans/cMoveMeshMonitor.pyx":1707
19222  * typeN = 1
19223  *
19224  * if nearestN >= nElements_owned: # <<<<<<<<<<<<<<
19225  * result_in = ms.cyCheckOwnedVariable(variable_nb_local=nearestN,
19226  * rank=my_rank,
19227  */
19228  __pyx_t_5 = ((__pyx_v_nearestN >= __pyx_v_nElements_owned) != 0);
19229  if (__pyx_t_5) {
19230 
19231  /* "mprans/cMoveMeshMonitor.pyx":1708
19232  *
19233  * if nearestN >= nElements_owned:
19234  * result_in = ms.cyCheckOwnedVariable(variable_nb_local=nearestN, # <<<<<<<<<<<<<<
19235  * rank=my_rank,
19236  * nVariables_owned=nElements_owned,
19237  */
19238  __pyx_t_6 = __pyx_f_7proteus_6mprans_13MeshSmoothing_cyCheckOwnedVariable(__pyx_v_nearestN, __pyx_v_my_rank, __pyx_v_nElements_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_elementOffsets_subdomain_owned); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1708, __pyx_L1_error)
19239  __PYX_XDEC_MEMVIEW(&__pyx_v_result_in, 1);
19240  __pyx_v_result_in = __pyx_t_6;
19241  __pyx_t_6.memview = NULL;
19242  __pyx_t_6.data = NULL;
19243 
19244  /* "mprans/cMoveMeshMonitor.pyx":1713
19245  * variableNumbering_subdomain2global=elementNumbering_subdomain2global,
19246  * variableOffsets_subdomain_owned=elementOffsets_subdomain_owned)
19247  * nearestN = result_in[0] # <<<<<<<<<<<<<<
19248  * rank = result_in[1]
19249  * if typeN == 1: # element
19250  */
19251  __pyx_t_8 = 0;
19252  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_result_in.shape[0];
19253  __pyx_v_nearestN = (*((int *) ( /* dim=0 */ (__pyx_v_result_in.data + __pyx_t_8 * __pyx_v_result_in.strides[0]) )));
19254 
19255  /* "mprans/cMoveMeshMonitor.pyx":1714
19256  * variableOffsets_subdomain_owned=elementOffsets_subdomain_owned)
19257  * nearestN = result_in[0]
19258  * rank = result_in[1] # <<<<<<<<<<<<<<
19259  * if typeN == 1: # element
19260  * # find closest element through boundary intersection
19261  */
19262  __pyx_t_8 = 1;
19263  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_result_in.shape[0];
19264  __pyx_v_rank = (*((int *) ( /* dim=0 */ (__pyx_v_result_in.data + __pyx_t_8 * __pyx_v_result_in.strides[0]) )));
19265 
19266  /* "mprans/cMoveMeshMonitor.pyx":1707
19267  * typeN = 1
19268  *
19269  * if nearestN >= nElements_owned: # <<<<<<<<<<<<<<
19270  * result_in = ms.cyCheckOwnedVariable(variable_nb_local=nearestN,
19271  * rank=my_rank,
19272  */
19273  }
19274 
19275  /* "mprans/cMoveMeshMonitor.pyx":1686
19276  * node=nearestN)
19277  * typeN = 1
19278  * if typeN == 2: # element boundary # <<<<<<<<<<<<<<
19279  * # get local number
19280  * nearestN = ms.cyGetLocalVariable(variable_nb_global=nearestN,
19281  */
19282  }
19283 
19284  /* "mprans/cMoveMeshMonitor.pyx":1715
19285  * nearestN = result_in[0]
19286  * rank = result_in[1]
19287  * if typeN == 1: # element # <<<<<<<<<<<<<<
19288  * # find closest element through boundary intersection
19289  * starting_coords[0] = elementBarycentersArray[nearestN, 0]
19290  */
19291  __pyx_t_5 = ((__pyx_v_typeN == 1) != 0);
19292  if (__pyx_t_5) {
19293 
19294  /* "mprans/cMoveMeshMonitor.pyx":1717
19295  * if typeN == 1: # element
19296  * # find closest element through boundary intersection
19297  * starting_coords[0] = elementBarycentersArray[nearestN, 0] # <<<<<<<<<<<<<<
19298  * starting_coords[1] = elementBarycentersArray[nearestN, 1]
19299  * starting_coords[2] = elementBarycentersArray[nearestN, 2]
19300  */
19301  __pyx_t_8 = __pyx_v_nearestN;
19302  __pyx_t_7 = 0;
19303  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[0];
19304  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBarycentersArray.shape[1];
19305  __pyx_t_10 = 0;
19306  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_starting_coords.shape[0];
19307  *((double *) ( /* dim=0 */ (__pyx_v_starting_coords.data + __pyx_t_10 * __pyx_v_starting_coords.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_7 * __pyx_v_elementBarycentersArray.strides[1]) )));
19308 
19309  /* "mprans/cMoveMeshMonitor.pyx":1718
19310  * # find closest element through boundary intersection
19311  * starting_coords[0] = elementBarycentersArray[nearestN, 0]
19312  * starting_coords[1] = elementBarycentersArray[nearestN, 1] # <<<<<<<<<<<<<<
19313  * starting_coords[2] = elementBarycentersArray[nearestN, 2]
19314  * result_in = ms.pyxGetLocalNearestElementIntersection(coords=coords,
19315  */
19316  __pyx_t_7 = __pyx_v_nearestN;
19317  __pyx_t_8 = 1;
19318  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBarycentersArray.shape[0];
19319  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[1];
19320  __pyx_t_10 = 1;
19321  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_starting_coords.shape[0];
19322  *((double *) ( /* dim=0 */ (__pyx_v_starting_coords.data + __pyx_t_10 * __pyx_v_starting_coords.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_7 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[1]) )));
19323 
19324  /* "mprans/cMoveMeshMonitor.pyx":1719
19325  * starting_coords[0] = elementBarycentersArray[nearestN, 0]
19326  * starting_coords[1] = elementBarycentersArray[nearestN, 1]
19327  * starting_coords[2] = elementBarycentersArray[nearestN, 2] # <<<<<<<<<<<<<<
19328  * result_in = ms.pyxGetLocalNearestElementIntersection(coords=coords,
19329  * starting_coords=starting_coords,
19330  */
19331  __pyx_t_8 = __pyx_v_nearestN;
19332  __pyx_t_7 = 2;
19333  if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_elementBarycentersArray.shape[0];
19334  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_elementBarycentersArray.shape[1];
19335  __pyx_t_10 = 2;
19336  if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_starting_coords.shape[0];
19337  *((double *) ( /* dim=0 */ (__pyx_v_starting_coords.data + __pyx_t_10 * __pyx_v_starting_coords.strides[0]) )) = (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_elementBarycentersArray.data + __pyx_t_8 * __pyx_v_elementBarycentersArray.strides[0]) ) + __pyx_t_7 * __pyx_v_elementBarycentersArray.strides[1]) )));
19338 
19339  /* "mprans/cMoveMeshMonitor.pyx":1720
19340  * starting_coords[1] = elementBarycentersArray[nearestN, 1]
19341  * starting_coords[2] = elementBarycentersArray[nearestN, 2]
19342  * result_in = ms.pyxGetLocalNearestElementIntersection(coords=coords, # <<<<<<<<<<<<<<
19343  * starting_coords=starting_coords,
19344  * elementBoundaryNormalsArray=elementBoundaryNormalsArray,
19345  */
19346  __pyx_t_6 = __pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestElementIntersection(__pyx_v_coords, __pyx_v_starting_coords, __pyx_v_elementBoundaryNormalsArray, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryBarycentersArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_exteriorElementBoundariesBoolArray, __pyx_v_nearestN); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1720, __pyx_L1_error)
19347  __PYX_XDEC_MEMVIEW(&__pyx_v_result_in, 1);
19348  __pyx_v_result_in = __pyx_t_6;
19349  __pyx_t_6.memview = NULL;
19350  __pyx_t_6.data = NULL;
19351 
19352  /* "mprans/cMoveMeshMonitor.pyx":1728
19353  * exteriorElementBoundariesBoolArray=exteriorElementBoundariesBoolArray,
19354  * eN=nearestN)
19355  * nearestN = result_in[0] # <<<<<<<<<<<<<<
19356  * # check if owned
19357  * if nearestN >= nElements_owned:
19358  */
19359  __pyx_t_7 = 0;
19360  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19361  __pyx_v_nearestN = (*((int *) ( /* dim=0 */ (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19362 
19363  /* "mprans/cMoveMeshMonitor.pyx":1730
19364  * nearestN = result_in[0]
19365  * # check if owned
19366  * if nearestN >= nElements_owned: # <<<<<<<<<<<<<<
19367  * result_in = ms.cyCheckOwnedVariable(variable_nb_local=nearestN,
19368  * rank=my_rank,
19369  */
19370  __pyx_t_5 = ((__pyx_v_nearestN >= __pyx_v_nElements_owned) != 0);
19371  if (__pyx_t_5) {
19372 
19373  /* "mprans/cMoveMeshMonitor.pyx":1731
19374  * # check if owned
19375  * if nearestN >= nElements_owned:
19376  * result_in = ms.cyCheckOwnedVariable(variable_nb_local=nearestN, # <<<<<<<<<<<<<<
19377  * rank=my_rank,
19378  * nVariables_owned=nElements_owned,
19379  */
19380  __pyx_t_6 = __pyx_f_7proteus_6mprans_13MeshSmoothing_cyCheckOwnedVariable(__pyx_v_nearestN, __pyx_v_my_rank, __pyx_v_nElements_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_elementOffsets_subdomain_owned); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1731, __pyx_L1_error)
19381  __PYX_XDEC_MEMVIEW(&__pyx_v_result_in, 1);
19382  __pyx_v_result_in = __pyx_t_6;
19383  __pyx_t_6.memview = NULL;
19384  __pyx_t_6.data = NULL;
19385 
19386  /* "mprans/cMoveMeshMonitor.pyx":1736
19387  * variableNumbering_subdomain2global=elementNumbering_subdomain2global,
19388  * variableOffsets_subdomain_owned=elementOffsets_subdomain_owned)
19389  * nearestN = result_in[0] # <<<<<<<<<<<<<<
19390  * rank = result_in[1]
19391  * # return boundary if element was not found
19392  */
19393  __pyx_t_7 = 0;
19394  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19395  __pyx_v_nearestN = (*((int *) ( /* dim=0 */ (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19396 
19397  /* "mprans/cMoveMeshMonitor.pyx":1737
19398  * variableOffsets_subdomain_owned=elementOffsets_subdomain_owned)
19399  * nearestN = result_in[0]
19400  * rank = result_in[1] # <<<<<<<<<<<<<<
19401  * # return boundary if element was not found
19402  * elif nearestN == -1:
19403  */
19404  __pyx_t_7 = 1;
19405  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19406  __pyx_v_rank = (*((int *) ( /* dim=0 */ (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19407 
19408  /* "mprans/cMoveMeshMonitor.pyx":1730
19409  * nearestN = result_in[0]
19410  * # check if owned
19411  * if nearestN >= nElements_owned: # <<<<<<<<<<<<<<
19412  * result_in = ms.cyCheckOwnedVariable(variable_nb_local=nearestN,
19413  * rank=my_rank,
19414  */
19415  goto __pyx_L13;
19416  }
19417 
19418  /* "mprans/cMoveMeshMonitor.pyx":1739
19419  * rank = result_in[1]
19420  * # return boundary if element was not found
19421  * elif nearestN == -1: # <<<<<<<<<<<<<<
19422  * assert result_in[1] != -1, 'b_i and nearestN cannot be both -1'
19423  * nearestN = result_in[1] # boundary number
19424  */
19425  __pyx_t_5 = ((__pyx_v_nearestN == -1L) != 0);
19426  if (__pyx_t_5) {
19427 
19428  /* "mprans/cMoveMeshMonitor.pyx":1740
19429  * # return boundary if element was not found
19430  * elif nearestN == -1:
19431  * assert result_in[1] != -1, 'b_i and nearestN cannot be both -1' # <<<<<<<<<<<<<<
19432  * nearestN = result_in[1] # boundary number
19433  * typeN = 2
19434  */
19435  #ifndef CYTHON_WITHOUT_ASSERTIONS
19436  if (unlikely(!Py_OptimizeFlag)) {
19437  __pyx_t_7 = 1;
19438  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19439  if (unlikely(!(((*((int *) ( /* dim=0 */ (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) ))) != -1L) != 0))) {
19440  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_b_i_and_nearestN_cannot_be_both);
19441  __PYX_ERR(0, 1740, __pyx_L1_error)
19442  }
19443  }
19444  #endif
19445 
19446  /* "mprans/cMoveMeshMonitor.pyx":1741
19447  * elif nearestN == -1:
19448  * assert result_in[1] != -1, 'b_i and nearestN cannot be both -1'
19449  * nearestN = result_in[1] # boundary number # <<<<<<<<<<<<<<
19450  * typeN = 2
19451  * if nearestN >= nElementBoundaries_owned:
19452  */
19453  __pyx_t_7 = 1;
19454  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19455  __pyx_v_nearestN = (*((int *) ( /* dim=0 */ (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19456 
19457  /* "mprans/cMoveMeshMonitor.pyx":1742
19458  * assert result_in[1] != -1, 'b_i and nearestN cannot be both -1'
19459  * nearestN = result_in[1] # boundary number
19460  * typeN = 2 # <<<<<<<<<<<<<<
19461  * if nearestN >= nElementBoundaries_owned:
19462  * result_in = ms.cyGetGlobalVariable(variable_nb_local=nearestN,
19463  */
19464  __pyx_v_typeN = 2;
19465 
19466  /* "mprans/cMoveMeshMonitor.pyx":1743
19467  * nearestN = result_in[1] # boundary number
19468  * typeN = 2
19469  * if nearestN >= nElementBoundaries_owned: # <<<<<<<<<<<<<<
19470  * result_in = ms.cyGetGlobalVariable(variable_nb_local=nearestN,
19471  * nVariables_owned=nElementBoundaries_owned,
19472  */
19473  __pyx_t_5 = ((__pyx_v_nearestN >= __pyx_v_nElementBoundaries_owned) != 0);
19474  if (__pyx_t_5) {
19475 
19476  /* "mprans/cMoveMeshMonitor.pyx":1744
19477  * typeN = 2
19478  * if nearestN >= nElementBoundaries_owned:
19479  * result_in = ms.cyGetGlobalVariable(variable_nb_local=nearestN, # <<<<<<<<<<<<<<
19480  * nVariables_owned=nElementBoundaries_owned,
19481  * variableNumbering_subdomain2global=elementBoundaryNumbering_subdomain2global,
19482  */
19483  __pyx_t_6 = __pyx_f_7proteus_6mprans_13MeshSmoothing_cyGetGlobalVariable(__pyx_v_nearestN, __pyx_v_nElementBoundaries_owned, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_elementBoundaryOffsets_subdomain_owned); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1744, __pyx_L1_error)
19484  __PYX_XDEC_MEMVIEW(&__pyx_v_result_in, 1);
19485  __pyx_v_result_in = __pyx_t_6;
19486  __pyx_t_6.memview = NULL;
19487  __pyx_t_6.data = NULL;
19488 
19489  /* "mprans/cMoveMeshMonitor.pyx":1748
19490  * variableNumbering_subdomain2global=elementBoundaryNumbering_subdomain2global,
19491  * variableOffsets_subdomain_owned=elementBoundaryOffsets_subdomain_owned)
19492  * nearestN = result_in[0] # <<<<<<<<<<<<<<
19493  * rank = result_in[1]
19494  * # return results
19495  */
19496  __pyx_t_7 = 0;
19497  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19498  __pyx_v_nearestN = (*((int *) ( /* dim=0 */ (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19499 
19500  /* "mprans/cMoveMeshMonitor.pyx":1749
19501  * variableOffsets_subdomain_owned=elementBoundaryOffsets_subdomain_owned)
19502  * nearestN = result_in[0]
19503  * rank = result_in[1] # <<<<<<<<<<<<<<
19504  * # return results
19505  * result_out[0] = nearestN
19506  */
19507  __pyx_t_7 = 1;
19508  if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_result_in.shape[0];
19509  __pyx_v_rank = (*((int *) ( /* dim=0 */ (__pyx_v_result_in.data + __pyx_t_7 * __pyx_v_result_in.strides[0]) )));
19510 
19511  /* "mprans/cMoveMeshMonitor.pyx":1743
19512  * nearestN = result_in[1] # boundary number
19513  * typeN = 2
19514  * if nearestN >= nElementBoundaries_owned: # <<<<<<<<<<<<<<
19515  * result_in = ms.cyGetGlobalVariable(variable_nb_local=nearestN,
19516  * nVariables_owned=nElementBoundaries_owned,
19517  */
19518  }
19519 
19520  /* "mprans/cMoveMeshMonitor.pyx":1739
19521  * rank = result_in[1]
19522  * # return boundary if element was not found
19523  * elif nearestN == -1: # <<<<<<<<<<<<<<
19524  * assert result_in[1] != -1, 'b_i and nearestN cannot be both -1'
19525  * nearestN = result_in[1] # boundary number
19526  */
19527  }
19528  __pyx_L13:;
19529 
19530  /* "mprans/cMoveMeshMonitor.pyx":1715
19531  * nearestN = result_in[0]
19532  * rank = result_in[1]
19533  * if typeN == 1: # element # <<<<<<<<<<<<<<
19534  * # find closest element through boundary intersection
19535  * starting_coords[0] = elementBarycentersArray[nearestN, 0]
19536  */
19537  }
19538 
19539  /* "mprans/cMoveMeshMonitor.pyx":1751
19540  * rank = result_in[1]
19541  * # return results
19542  * result_out[0] = nearestN # <<<<<<<<<<<<<<
19543  * result_out[1] = typeN
19544  * result_out[2] = rank
19545  */
19546  (__pyx_v_result_out[0]) = __pyx_v_nearestN;
19547 
19548  /* "mprans/cMoveMeshMonitor.pyx":1752
19549  * # return results
19550  * result_out[0] = nearestN
19551  * result_out[1] = typeN # <<<<<<<<<<<<<<
19552  * result_out[2] = rank
19553  * return result_out
19554  */
19555  (__pyx_v_result_out[1]) = __pyx_v_typeN;
19556 
19557  /* "mprans/cMoveMeshMonitor.pyx":1753
19558  * result_out[0] = nearestN
19559  * result_out[1] = typeN
19560  * result_out[2] = rank # <<<<<<<<<<<<<<
19561  * return result_out
19562  *
19563  */
19564  (__pyx_v_result_out[2]) = __pyx_v_rank;
19565 
19566  /* "mprans/cMoveMeshMonitor.pyx":1754
19567  * result_out[1] = typeN
19568  * result_out[2] = rank
19569  * return result_out # <<<<<<<<<<<<<<
19570  *
19571  * # def mpicomm(dict_2rank, ):
19572  */
19573  __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1754, __pyx_L1_error)
19574  __Pyx_GOTREF(__pyx_t_3);
19575  __pyx_t_1 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1754, __pyx_L1_error)
19576  __Pyx_GOTREF(__pyx_t_1);
19577  __pyx_t_11 = __pyx_array_new(__pyx_t_1, sizeof(int), PyBytes_AS_STRING(__pyx_t_3), (char *) "fortran", (char *) __pyx_v_result_out);
19578  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1754, __pyx_L1_error)
19579  __Pyx_GOTREF(__pyx_t_11);
19580  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19581  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19582  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(((PyObject *)__pyx_t_11), PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1754, __pyx_L1_error)
19583  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
19584  __pyx_r = __pyx_t_6;
19585  __pyx_t_6.memview = NULL;
19586  __pyx_t_6.data = NULL;
19587  goto __pyx_L0;
19588 
19589  /* "mprans/cMoveMeshMonitor.pyx":1630
19590  *
19591  *
19592  * cdef int[:] findN(double[:] coords, # <<<<<<<<<<<<<<
19593  * double[:,:] nodeArray,
19594  * int[:] nodeStarOffsets,
19595  */
19596 
19597  /* function exit code */
19598  __pyx_L1_error:;
19599  __Pyx_XDECREF(__pyx_t_1);
19600  __Pyx_XDECREF(__pyx_t_2);
19601  __Pyx_XDECREF(__pyx_t_3);
19602  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
19603  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
19604  __Pyx_XDECREF(((PyObject *)__pyx_t_11));
19605  __pyx_r.data = NULL;
19606  __pyx_r.memview = NULL;
19607  __Pyx_AddTraceback("mprans.cMoveMeshMonitor.findN", __pyx_clineno, __pyx_lineno, __pyx_filename);
19608  goto __pyx_L2;
19609  __pyx_L0:;
19610  if (unlikely(!__pyx_r.memview)) {
19611  PyErr_SetString(PyExc_TypeError, "Memoryview return value is not initialized");
19612  }
19613  __pyx_L2:;
19614  __PYX_XDEC_MEMVIEW(&__pyx_v_result_in, 1);
19615  __PYX_XDEC_MEMVIEW(&__pyx_v_starting_coords, 1);
19616  __Pyx_RefNannyFinishContext();
19617  return __pyx_r;
19618 }
19619 
19620 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
19621  * ctypedef npy_cdouble complex_t
19622  *
19623  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19624  * return PyArray_MultiIterNew(1, <void*>a)
19625  *
19626  */
19627 
19628 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19629  PyObject *__pyx_r = NULL;
19630  __Pyx_RefNannyDeclarations
19631  PyObject *__pyx_t_1 = NULL;
19632  int __pyx_lineno = 0;
19633  const char *__pyx_filename = NULL;
19634  int __pyx_clineno = 0;
19635  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
19636 
19637  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":736
19638  *
19639  * cdef inline object PyArray_MultiIterNew1(a):
19640  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
19641  *
19642  * cdef inline object PyArray_MultiIterNew2(a, b):
19643  */
19644  __Pyx_XDECREF(__pyx_r);
19645  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
19646  __Pyx_GOTREF(__pyx_t_1);
19647  __pyx_r = __pyx_t_1;
19648  __pyx_t_1 = 0;
19649  goto __pyx_L0;
19650 
19651  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
19652  * ctypedef npy_cdouble complex_t
19653  *
19654  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19655  * return PyArray_MultiIterNew(1, <void*>a)
19656  *
19657  */
19658 
19659  /* function exit code */
19660  __pyx_L1_error:;
19661  __Pyx_XDECREF(__pyx_t_1);
19662  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19663  __pyx_r = 0;
19664  __pyx_L0:;
19665  __Pyx_XGIVEREF(__pyx_r);
19666  __Pyx_RefNannyFinishContext();
19667  return __pyx_r;
19668 }
19669 
19670 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
19671  * return PyArray_MultiIterNew(1, <void*>a)
19672  *
19673  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19674  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19675  *
19676  */
19677 
19678 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19679  PyObject *__pyx_r = NULL;
19680  __Pyx_RefNannyDeclarations
19681  PyObject *__pyx_t_1 = NULL;
19682  int __pyx_lineno = 0;
19683  const char *__pyx_filename = NULL;
19684  int __pyx_clineno = 0;
19685  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
19686 
19687  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":739
19688  *
19689  * cdef inline object PyArray_MultiIterNew2(a, b):
19690  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
19691  *
19692  * cdef inline object PyArray_MultiIterNew3(a, b, c):
19693  */
19694  __Pyx_XDECREF(__pyx_r);
19695  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
19696  __Pyx_GOTREF(__pyx_t_1);
19697  __pyx_r = __pyx_t_1;
19698  __pyx_t_1 = 0;
19699  goto __pyx_L0;
19700 
19701  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
19702  * return PyArray_MultiIterNew(1, <void*>a)
19703  *
19704  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19705  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19706  *
19707  */
19708 
19709  /* function exit code */
19710  __pyx_L1_error:;
19711  __Pyx_XDECREF(__pyx_t_1);
19712  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19713  __pyx_r = 0;
19714  __pyx_L0:;
19715  __Pyx_XGIVEREF(__pyx_r);
19716  __Pyx_RefNannyFinishContext();
19717  return __pyx_r;
19718 }
19719 
19720 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
19721  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19722  *
19723  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19724  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19725  *
19726  */
19727 
19728 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19729  PyObject *__pyx_r = NULL;
19730  __Pyx_RefNannyDeclarations
19731  PyObject *__pyx_t_1 = NULL;
19732  int __pyx_lineno = 0;
19733  const char *__pyx_filename = NULL;
19734  int __pyx_clineno = 0;
19735  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
19736 
19737  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":742
19738  *
19739  * cdef inline object PyArray_MultiIterNew3(a, b, c):
19740  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
19741  *
19742  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19743  */
19744  __Pyx_XDECREF(__pyx_r);
19745  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error)
19746  __Pyx_GOTREF(__pyx_t_1);
19747  __pyx_r = __pyx_t_1;
19748  __pyx_t_1 = 0;
19749  goto __pyx_L0;
19750 
19751  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
19752  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19753  *
19754  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19755  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19756  *
19757  */
19758 
19759  /* function exit code */
19760  __pyx_L1_error:;
19761  __Pyx_XDECREF(__pyx_t_1);
19762  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19763  __pyx_r = 0;
19764  __pyx_L0:;
19765  __Pyx_XGIVEREF(__pyx_r);
19766  __Pyx_RefNannyFinishContext();
19767  return __pyx_r;
19768 }
19769 
19770 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
19771  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19772  *
19773  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19774  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19775  *
19776  */
19777 
19778 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
19779  PyObject *__pyx_r = NULL;
19780  __Pyx_RefNannyDeclarations
19781  PyObject *__pyx_t_1 = NULL;
19782  int __pyx_lineno = 0;
19783  const char *__pyx_filename = NULL;
19784  int __pyx_clineno = 0;
19785  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
19786 
19787  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":745
19788  *
19789  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19790  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
19791  *
19792  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19793  */
19794  __Pyx_XDECREF(__pyx_r);
19795  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error)
19796  __Pyx_GOTREF(__pyx_t_1);
19797  __pyx_r = __pyx_t_1;
19798  __pyx_t_1 = 0;
19799  goto __pyx_L0;
19800 
19801  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
19802  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19803  *
19804  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19805  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19806  *
19807  */
19808 
19809  /* function exit code */
19810  __pyx_L1_error:;
19811  __Pyx_XDECREF(__pyx_t_1);
19812  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19813  __pyx_r = 0;
19814  __pyx_L0:;
19815  __Pyx_XGIVEREF(__pyx_r);
19816  __Pyx_RefNannyFinishContext();
19817  return __pyx_r;
19818 }
19819 
19820 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
19821  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19822  *
19823  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19824  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19825  *
19826  */
19827 
19828 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
19829  PyObject *__pyx_r = NULL;
19830  __Pyx_RefNannyDeclarations
19831  PyObject *__pyx_t_1 = NULL;
19832  int __pyx_lineno = 0;
19833  const char *__pyx_filename = NULL;
19834  int __pyx_clineno = 0;
19835  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
19836 
19837  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":748
19838  *
19839  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19840  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
19841  *
19842  * cdef inline tuple PyDataType_SHAPE(dtype d):
19843  */
19844  __Pyx_XDECREF(__pyx_r);
19845  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error)
19846  __Pyx_GOTREF(__pyx_t_1);
19847  __pyx_r = __pyx_t_1;
19848  __pyx_t_1 = 0;
19849  goto __pyx_L0;
19850 
19851  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
19852  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19853  *
19854  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19855  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19856  *
19857  */
19858 
19859  /* function exit code */
19860  __pyx_L1_error:;
19861  __Pyx_XDECREF(__pyx_t_1);
19862  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
19863  __pyx_r = 0;
19864  __pyx_L0:;
19865  __Pyx_XGIVEREF(__pyx_r);
19866  __Pyx_RefNannyFinishContext();
19867  return __pyx_r;
19868 }
19869 
19870 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
19871  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19872  *
19873  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
19874  * if PyDataType_HASSUBARRAY(d):
19875  * return <tuple>d.subarray.shape
19876  */
19877 
19878 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
19879  PyObject *__pyx_r = NULL;
19880  __Pyx_RefNannyDeclarations
19881  int __pyx_t_1;
19882  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
19883 
19884  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
19885  *
19886  * cdef inline tuple PyDataType_SHAPE(dtype d):
19887  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
19888  * return <tuple>d.subarray.shape
19889  * else:
19890  */
19891  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
19892  if (__pyx_t_1) {
19893 
19894  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":752
19895  * cdef inline tuple PyDataType_SHAPE(dtype d):
19896  * if PyDataType_HASSUBARRAY(d):
19897  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
19898  * else:
19899  * return ()
19900  */
19901  __Pyx_XDECREF(__pyx_r);
19902  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
19903  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
19904  goto __pyx_L0;
19905 
19906  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
19907  *
19908  * cdef inline tuple PyDataType_SHAPE(dtype d):
19909  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
19910  * return <tuple>d.subarray.shape
19911  * else:
19912  */
19913  }
19914 
19915  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":754
19916  * return <tuple>d.subarray.shape
19917  * else:
19918  * return () # <<<<<<<<<<<<<<
19919  *
19920  *
19921  */
19922  /*else*/ {
19923  __Pyx_XDECREF(__pyx_r);
19924  __Pyx_INCREF(__pyx_empty_tuple);
19925  __pyx_r = __pyx_empty_tuple;
19926  goto __pyx_L0;
19927  }
19928 
19929  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
19930  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19931  *
19932  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
19933  * if PyDataType_HASSUBARRAY(d):
19934  * return <tuple>d.subarray.shape
19935  */
19936 
19937  /* function exit code */
19938  __pyx_L0:;
19939  __Pyx_XGIVEREF(__pyx_r);
19940  __Pyx_RefNannyFinishContext();
19941  return __pyx_r;
19942 }
19943 
19944 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
19945  * int _import_umath() except -1
19946  *
19947  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
19948  * Py_INCREF(base) # important to do this before stealing the reference below!
19949  * PyArray_SetBaseObject(arr, base)
19950  */
19951 
19952 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
19953  __Pyx_RefNannyDeclarations
19954  __Pyx_RefNannySetupContext("set_array_base", 0);
19955 
19956  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":930
19957  *
19958  * cdef inline void set_array_base(ndarray arr, object base):
19959  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
19960  * PyArray_SetBaseObject(arr, base)
19961  *
19962  */
19963  Py_INCREF(__pyx_v_base);
19964 
19965  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":931
19966  * cdef inline void set_array_base(ndarray arr, object base):
19967  * Py_INCREF(base) # important to do this before stealing the reference below!
19968  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
19969  *
19970  * cdef inline object get_array_base(ndarray arr):
19971  */
19972  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
19973 
19974  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
19975  * int _import_umath() except -1
19976  *
19977  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
19978  * Py_INCREF(base) # important to do this before stealing the reference below!
19979  * PyArray_SetBaseObject(arr, base)
19980  */
19981 
19982  /* function exit code */
19983  __Pyx_RefNannyFinishContext();
19984 }
19985 
19986 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
19987  * PyArray_SetBaseObject(arr, base)
19988  *
19989  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
19990  * base = PyArray_BASE(arr)
19991  * if base is NULL:
19992  */
19993 
19994 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
19995  PyObject *__pyx_v_base;
19996  PyObject *__pyx_r = NULL;
19997  __Pyx_RefNannyDeclarations
19998  int __pyx_t_1;
19999  __Pyx_RefNannySetupContext("get_array_base", 0);
20000 
20001  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":934
20002  *
20003  * cdef inline object get_array_base(ndarray arr):
20004  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
20005  * if base is NULL:
20006  * return None
20007  */
20008  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
20009 
20010  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
20011  * cdef inline object get_array_base(ndarray arr):
20012  * base = PyArray_BASE(arr)
20013  * if base is NULL: # <<<<<<<<<<<<<<
20014  * return None
20015  * return <object>base
20016  */
20017  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
20018  if (__pyx_t_1) {
20019 
20020  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":936
20021  * base = PyArray_BASE(arr)
20022  * if base is NULL:
20023  * return None # <<<<<<<<<<<<<<
20024  * return <object>base
20025  *
20026  */
20027  __Pyx_XDECREF(__pyx_r);
20028  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20029  goto __pyx_L0;
20030 
20031  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
20032  * cdef inline object get_array_base(ndarray arr):
20033  * base = PyArray_BASE(arr)
20034  * if base is NULL: # <<<<<<<<<<<<<<
20035  * return None
20036  * return <object>base
20037  */
20038  }
20039 
20040  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":937
20041  * if base is NULL:
20042  * return None
20043  * return <object>base # <<<<<<<<<<<<<<
20044  *
20045  * # Versions of the import_* functions which are more suitable for
20046  */
20047  __Pyx_XDECREF(__pyx_r);
20048  __Pyx_INCREF(((PyObject *)__pyx_v_base));
20049  __pyx_r = ((PyObject *)__pyx_v_base);
20050  goto __pyx_L0;
20051 
20052  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
20053  * PyArray_SetBaseObject(arr, base)
20054  *
20055  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20056  * base = PyArray_BASE(arr)
20057  * if base is NULL:
20058  */
20059 
20060  /* function exit code */
20061  __pyx_L0:;
20062  __Pyx_XGIVEREF(__pyx_r);
20063  __Pyx_RefNannyFinishContext();
20064  return __pyx_r;
20065 }
20066 
20067 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
20068  * # Versions of the import_* functions which are more suitable for
20069  * # Cython code.
20070  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20071  * try:
20072  * __pyx_import_array()
20073  */
20074 
20075 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20076  int __pyx_r;
20077  __Pyx_RefNannyDeclarations
20078  PyObject *__pyx_t_1 = NULL;
20079  PyObject *__pyx_t_2 = NULL;
20080  PyObject *__pyx_t_3 = NULL;
20081  int __pyx_t_4;
20082  PyObject *__pyx_t_5 = NULL;
20083  PyObject *__pyx_t_6 = NULL;
20084  PyObject *__pyx_t_7 = NULL;
20085  PyObject *__pyx_t_8 = NULL;
20086  int __pyx_lineno = 0;
20087  const char *__pyx_filename = NULL;
20088  int __pyx_clineno = 0;
20089  __Pyx_RefNannySetupContext("import_array", 0);
20090 
20091  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
20092  * # Cython code.
20093  * cdef inline int import_array() except -1:
20094  * try: # <<<<<<<<<<<<<<
20095  * __pyx_import_array()
20096  * except Exception:
20097  */
20098  {
20099  __Pyx_PyThreadState_declare
20100  __Pyx_PyThreadState_assign
20101  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20102  __Pyx_XGOTREF(__pyx_t_1);
20103  __Pyx_XGOTREF(__pyx_t_2);
20104  __Pyx_XGOTREF(__pyx_t_3);
20105  /*try:*/ {
20106 
20107  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":943
20108  * cdef inline int import_array() except -1:
20109  * try:
20110  * __pyx_import_array() # <<<<<<<<<<<<<<
20111  * except Exception:
20112  * raise ImportError("numpy.core.multiarray failed to import")
20113  */
20114  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
20115 
20116  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
20117  * # Cython code.
20118  * cdef inline int import_array() except -1:
20119  * try: # <<<<<<<<<<<<<<
20120  * __pyx_import_array()
20121  * except Exception:
20122  */
20123  }
20124  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20125  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20126  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20127  goto __pyx_L8_try_end;
20128  __pyx_L3_error:;
20129 
20130  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":944
20131  * try:
20132  * __pyx_import_array()
20133  * except Exception: # <<<<<<<<<<<<<<
20134  * raise ImportError("numpy.core.multiarray failed to import")
20135  *
20136  */
20137  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20138  if (__pyx_t_4) {
20139  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20140  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
20141  __Pyx_GOTREF(__pyx_t_5);
20142  __Pyx_GOTREF(__pyx_t_6);
20143  __Pyx_GOTREF(__pyx_t_7);
20144 
20145  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
20146  * __pyx_import_array()
20147  * except Exception:
20148  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
20149  *
20150  * cdef inline int import_umath() except -1:
20151  */
20152  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
20153  __Pyx_GOTREF(__pyx_t_8);
20154  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20155  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20156  __PYX_ERR(2, 945, __pyx_L5_except_error)
20157  }
20158  goto __pyx_L5_except_error;
20159  __pyx_L5_except_error:;
20160 
20161  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
20162  * # Cython code.
20163  * cdef inline int import_array() except -1:
20164  * try: # <<<<<<<<<<<<<<
20165  * __pyx_import_array()
20166  * except Exception:
20167  */
20168  __Pyx_XGIVEREF(__pyx_t_1);
20169  __Pyx_XGIVEREF(__pyx_t_2);
20170  __Pyx_XGIVEREF(__pyx_t_3);
20171  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20172  goto __pyx_L1_error;
20173  __pyx_L8_try_end:;
20174  }
20175 
20176  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
20177  * # Versions of the import_* functions which are more suitable for
20178  * # Cython code.
20179  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20180  * try:
20181  * __pyx_import_array()
20182  */
20183 
20184  /* function exit code */
20185  __pyx_r = 0;
20186  goto __pyx_L0;
20187  __pyx_L1_error:;
20188  __Pyx_XDECREF(__pyx_t_5);
20189  __Pyx_XDECREF(__pyx_t_6);
20190  __Pyx_XDECREF(__pyx_t_7);
20191  __Pyx_XDECREF(__pyx_t_8);
20192  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20193  __pyx_r = -1;
20194  __pyx_L0:;
20195  __Pyx_RefNannyFinishContext();
20196  return __pyx_r;
20197 }
20198 
20199 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
20200  * raise ImportError("numpy.core.multiarray failed to import")
20201  *
20202  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
20203  * try:
20204  * _import_umath()
20205  */
20206 
20207 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20208  int __pyx_r;
20209  __Pyx_RefNannyDeclarations
20210  PyObject *__pyx_t_1 = NULL;
20211  PyObject *__pyx_t_2 = NULL;
20212  PyObject *__pyx_t_3 = NULL;
20213  int __pyx_t_4;
20214  PyObject *__pyx_t_5 = NULL;
20215  PyObject *__pyx_t_6 = NULL;
20216  PyObject *__pyx_t_7 = NULL;
20217  PyObject *__pyx_t_8 = NULL;
20218  int __pyx_lineno = 0;
20219  const char *__pyx_filename = NULL;
20220  int __pyx_clineno = 0;
20221  __Pyx_RefNannySetupContext("import_umath", 0);
20222 
20223  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
20224  *
20225  * cdef inline int import_umath() except -1:
20226  * try: # <<<<<<<<<<<<<<
20227  * _import_umath()
20228  * except Exception:
20229  */
20230  {
20231  __Pyx_PyThreadState_declare
20232  __Pyx_PyThreadState_assign
20233  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20234  __Pyx_XGOTREF(__pyx_t_1);
20235  __Pyx_XGOTREF(__pyx_t_2);
20236  __Pyx_XGOTREF(__pyx_t_3);
20237  /*try:*/ {
20238 
20239  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":949
20240  * cdef inline int import_umath() except -1:
20241  * try:
20242  * _import_umath() # <<<<<<<<<<<<<<
20243  * except Exception:
20244  * raise ImportError("numpy.core.umath failed to import")
20245  */
20246  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
20247 
20248  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
20249  *
20250  * cdef inline int import_umath() except -1:
20251  * try: # <<<<<<<<<<<<<<
20252  * _import_umath()
20253  * except Exception:
20254  */
20255  }
20256  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20257  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20258  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20259  goto __pyx_L8_try_end;
20260  __pyx_L3_error:;
20261 
20262  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":950
20263  * try:
20264  * _import_umath()
20265  * except Exception: # <<<<<<<<<<<<<<
20266  * raise ImportError("numpy.core.umath failed to import")
20267  *
20268  */
20269  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20270  if (__pyx_t_4) {
20271  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20272  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
20273  __Pyx_GOTREF(__pyx_t_5);
20274  __Pyx_GOTREF(__pyx_t_6);
20275  __Pyx_GOTREF(__pyx_t_7);
20276 
20277  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
20278  * _import_umath()
20279  * except Exception:
20280  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
20281  *
20282  * cdef inline int import_ufunc() except -1:
20283  */
20284  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
20285  __Pyx_GOTREF(__pyx_t_8);
20286  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20287  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20288  __PYX_ERR(2, 951, __pyx_L5_except_error)
20289  }
20290  goto __pyx_L5_except_error;
20291  __pyx_L5_except_error:;
20292 
20293  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
20294  *
20295  * cdef inline int import_umath() except -1:
20296  * try: # <<<<<<<<<<<<<<
20297  * _import_umath()
20298  * except Exception:
20299  */
20300  __Pyx_XGIVEREF(__pyx_t_1);
20301  __Pyx_XGIVEREF(__pyx_t_2);
20302  __Pyx_XGIVEREF(__pyx_t_3);
20303  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20304  goto __pyx_L1_error;
20305  __pyx_L8_try_end:;
20306  }
20307 
20308  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
20309  * raise ImportError("numpy.core.multiarray failed to import")
20310  *
20311  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
20312  * try:
20313  * _import_umath()
20314  */
20315 
20316  /* function exit code */
20317  __pyx_r = 0;
20318  goto __pyx_L0;
20319  __pyx_L1_error:;
20320  __Pyx_XDECREF(__pyx_t_5);
20321  __Pyx_XDECREF(__pyx_t_6);
20322  __Pyx_XDECREF(__pyx_t_7);
20323  __Pyx_XDECREF(__pyx_t_8);
20324  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20325  __pyx_r = -1;
20326  __pyx_L0:;
20327  __Pyx_RefNannyFinishContext();
20328  return __pyx_r;
20329 }
20330 
20331 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
20332  * raise ImportError("numpy.core.umath failed to import")
20333  *
20334  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
20335  * try:
20336  * _import_umath()
20337  */
20338 
20339 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20340  int __pyx_r;
20341  __Pyx_RefNannyDeclarations
20342  PyObject *__pyx_t_1 = NULL;
20343  PyObject *__pyx_t_2 = NULL;
20344  PyObject *__pyx_t_3 = NULL;
20345  int __pyx_t_4;
20346  PyObject *__pyx_t_5 = NULL;
20347  PyObject *__pyx_t_6 = NULL;
20348  PyObject *__pyx_t_7 = NULL;
20349  PyObject *__pyx_t_8 = NULL;
20350  int __pyx_lineno = 0;
20351  const char *__pyx_filename = NULL;
20352  int __pyx_clineno = 0;
20353  __Pyx_RefNannySetupContext("import_ufunc", 0);
20354 
20355  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
20356  *
20357  * cdef inline int import_ufunc() except -1:
20358  * try: # <<<<<<<<<<<<<<
20359  * _import_umath()
20360  * except Exception:
20361  */
20362  {
20363  __Pyx_PyThreadState_declare
20364  __Pyx_PyThreadState_assign
20365  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20366  __Pyx_XGOTREF(__pyx_t_1);
20367  __Pyx_XGOTREF(__pyx_t_2);
20368  __Pyx_XGOTREF(__pyx_t_3);
20369  /*try:*/ {
20370 
20371  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":955
20372  * cdef inline int import_ufunc() except -1:
20373  * try:
20374  * _import_umath() # <<<<<<<<<<<<<<
20375  * except Exception:
20376  * raise ImportError("numpy.core.umath failed to import")
20377  */
20378  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
20379 
20380  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
20381  *
20382  * cdef inline int import_ufunc() except -1:
20383  * try: # <<<<<<<<<<<<<<
20384  * _import_umath()
20385  * except Exception:
20386  */
20387  }
20388  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20389  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20390  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20391  goto __pyx_L8_try_end;
20392  __pyx_L3_error:;
20393 
20394  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":956
20395  * try:
20396  * _import_umath()
20397  * except Exception: # <<<<<<<<<<<<<<
20398  * raise ImportError("numpy.core.umath failed to import")
20399  *
20400  */
20401  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20402  if (__pyx_t_4) {
20403  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20404  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
20405  __Pyx_GOTREF(__pyx_t_5);
20406  __Pyx_GOTREF(__pyx_t_6);
20407  __Pyx_GOTREF(__pyx_t_7);
20408 
20409  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":957
20410  * _import_umath()
20411  * except Exception:
20412  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
20413  *
20414  * cdef extern from *:
20415  */
20416  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
20417  __Pyx_GOTREF(__pyx_t_8);
20418  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20419  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20420  __PYX_ERR(2, 957, __pyx_L5_except_error)
20421  }
20422  goto __pyx_L5_except_error;
20423  __pyx_L5_except_error:;
20424 
20425  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
20426  *
20427  * cdef inline int import_ufunc() except -1:
20428  * try: # <<<<<<<<<<<<<<
20429  * _import_umath()
20430  * except Exception:
20431  */
20432  __Pyx_XGIVEREF(__pyx_t_1);
20433  __Pyx_XGIVEREF(__pyx_t_2);
20434  __Pyx_XGIVEREF(__pyx_t_3);
20435  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20436  goto __pyx_L1_error;
20437  __pyx_L8_try_end:;
20438  }
20439 
20440  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
20441  * raise ImportError("numpy.core.umath failed to import")
20442  *
20443  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
20444  * try:
20445  * _import_umath()
20446  */
20447 
20448  /* function exit code */
20449  __pyx_r = 0;
20450  goto __pyx_L0;
20451  __pyx_L1_error:;
20452  __Pyx_XDECREF(__pyx_t_5);
20453  __Pyx_XDECREF(__pyx_t_6);
20454  __Pyx_XDECREF(__pyx_t_7);
20455  __Pyx_XDECREF(__pyx_t_8);
20456  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20457  __pyx_r = -1;
20458  __pyx_L0:;
20459  __Pyx_RefNannyFinishContext();
20460  return __pyx_r;
20461 }
20462 
20463 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
20464  *
20465  *
20466  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
20467  * """
20468  * Cython equivalent of `isinstance(obj, np.timedelta64)`
20469  */
20470 
20471 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
20472  int __pyx_r;
20473  __Pyx_RefNannyDeclarations
20474  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
20475 
20476  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":979
20477  * bool
20478  * """
20479  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
20480  *
20481  *
20482  */
20483  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
20484  goto __pyx_L0;
20485 
20486  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
20487  *
20488  *
20489  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
20490  * """
20491  * Cython equivalent of `isinstance(obj, np.timedelta64)`
20492  */
20493 
20494  /* function exit code */
20495  __pyx_L0:;
20496  __Pyx_RefNannyFinishContext();
20497  return __pyx_r;
20498 }
20499 
20500 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
20501  *
20502  *
20503  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
20504  * """
20505  * Cython equivalent of `isinstance(obj, np.datetime64)`
20506  */
20507 
20508 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
20509  int __pyx_r;
20510  __Pyx_RefNannyDeclarations
20511  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
20512 
20513  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":994
20514  * bool
20515  * """
20516  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
20517  *
20518  *
20519  */
20520  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
20521  goto __pyx_L0;
20522 
20523  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
20524  *
20525  *
20526  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
20527  * """
20528  * Cython equivalent of `isinstance(obj, np.datetime64)`
20529  */
20530 
20531  /* function exit code */
20532  __pyx_L0:;
20533  __Pyx_RefNannyFinishContext();
20534  return __pyx_r;
20535 }
20536 
20537 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
20538  *
20539  *
20540  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
20541  * """
20542  * returns the int64 value underlying scalar numpy datetime64 object
20543  */
20544 
20545 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
20546  npy_datetime __pyx_r;
20547 
20548  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1004
20549  * also needed. That can be found using `get_datetime64_unit`.
20550  * """
20551  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
20552  *
20553  *
20554  */
20555  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
20556  goto __pyx_L0;
20557 
20558  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
20559  *
20560  *
20561  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
20562  * """
20563  * returns the int64 value underlying scalar numpy datetime64 object
20564  */
20565 
20566  /* function exit code */
20567  __pyx_L0:;
20568  return __pyx_r;
20569 }
20570 
20571 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
20572  *
20573  *
20574  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
20575  * """
20576  * returns the int64 value underlying scalar numpy timedelta64 object
20577  */
20578 
20579 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
20580  npy_timedelta __pyx_r;
20581 
20582  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1011
20583  * returns the int64 value underlying scalar numpy timedelta64 object
20584  * """
20585  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
20586  *
20587  *
20588  */
20589  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
20590  goto __pyx_L0;
20591 
20592  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
20593  *
20594  *
20595  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
20596  * """
20597  * returns the int64 value underlying scalar numpy timedelta64 object
20598  */
20599 
20600  /* function exit code */
20601  __pyx_L0:;
20602  return __pyx_r;
20603 }
20604 
20605 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
20606  *
20607  *
20608  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
20609  * """
20610  * returns the unit part of the dtype for a numpy datetime64 object.
20611  */
20612 
20613 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
20614  NPY_DATETIMEUNIT __pyx_r;
20615 
20616  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1018
20617  * returns the unit part of the dtype for a numpy datetime64 object.
20618  * """
20619  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
20620  */
20621  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
20622  goto __pyx_L0;
20623 
20624  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
20625  *
20626  *
20627  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
20628  * """
20629  * returns the unit part of the dtype for a numpy datetime64 object.
20630  */
20631 
20632  /* function exit code */
20633  __pyx_L0:;
20634  return __pyx_r;
20635 }
20636 
20637 /* "View.MemoryView":122
20638  * cdef bint dtype_is_object
20639  *
20640  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
20641  * mode="c", bint allocate_buffer=True):
20642  *
20643  */
20644 
20645 /* Python wrapper */
20646 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20647 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20648  PyObject *__pyx_v_shape = 0;
20649  Py_ssize_t __pyx_v_itemsize;
20650  PyObject *__pyx_v_format = 0;
20651  PyObject *__pyx_v_mode = 0;
20652  int __pyx_v_allocate_buffer;
20653  int __pyx_lineno = 0;
20654  const char *__pyx_filename = NULL;
20655  int __pyx_clineno = 0;
20656  int __pyx_r;
20657  __Pyx_RefNannyDeclarations
20658  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
20659  {
20660  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
20661  PyObject* values[5] = {0,0,0,0,0};
20662  values[3] = ((PyObject *)__pyx_n_s_c);
20663  if (unlikely(__pyx_kwds)) {
20664  Py_ssize_t kw_args;
20665  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20666  switch (pos_args) {
20667  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
20668  CYTHON_FALLTHROUGH;
20669  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
20670  CYTHON_FALLTHROUGH;
20671  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20672  CYTHON_FALLTHROUGH;
20673  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20674  CYTHON_FALLTHROUGH;
20675  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20676  CYTHON_FALLTHROUGH;
20677  case 0: break;
20678  default: goto __pyx_L5_argtuple_error;
20679  }
20680  kw_args = PyDict_Size(__pyx_kwds);
20681  switch (pos_args) {
20682  case 0:
20683  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
20684  else goto __pyx_L5_argtuple_error;
20685  CYTHON_FALLTHROUGH;
20686  case 1:
20687  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
20688  else {
20689  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
20690  }
20691  CYTHON_FALLTHROUGH;
20692  case 2:
20693  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
20694  else {
20695  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
20696  }
20697  CYTHON_FALLTHROUGH;
20698  case 3:
20699  if (kw_args > 0) {
20700  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
20701  if (value) { values[3] = value; kw_args--; }
20702  }
20703  CYTHON_FALLTHROUGH;
20704  case 4:
20705  if (kw_args > 0) {
20706  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
20707  if (value) { values[4] = value; kw_args--; }
20708  }
20709  }
20710  if (unlikely(kw_args > 0)) {
20711  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
20712  }
20713  } else {
20714  switch (PyTuple_GET_SIZE(__pyx_args)) {
20715  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
20716  CYTHON_FALLTHROUGH;
20717  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
20718  CYTHON_FALLTHROUGH;
20719  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20720  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20721  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20722  break;
20723  default: goto __pyx_L5_argtuple_error;
20724  }
20725  }
20726  __pyx_v_shape = ((PyObject*)values[0]);
20727  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
20728  __pyx_v_format = values[2];
20729  __pyx_v_mode = values[3];
20730  if (values[4]) {
20731  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
20732  } else {
20733 
20734  /* "View.MemoryView":123
20735  *
20736  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
20737  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
20738  *
20739  * cdef int idx
20740  */
20741  __pyx_v_allocate_buffer = ((int)1);
20742  }
20743  }
20744  goto __pyx_L4_argument_unpacking_done;
20745  __pyx_L5_argtuple_error:;
20746  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
20747  __pyx_L3_error:;
20748  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20749  __Pyx_RefNannyFinishContext();
20750  return -1;
20751  __pyx_L4_argument_unpacking_done:;
20752  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
20753  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
20754  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
20755  }
20756  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
20757 
20758  /* "View.MemoryView":122
20759  * cdef bint dtype_is_object
20760  *
20761  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
20762  * mode="c", bint allocate_buffer=True):
20763  *
20764  */
20765 
20766  /* function exit code */
20767  goto __pyx_L0;
20768  __pyx_L1_error:;
20769  __pyx_r = -1;
20770  __pyx_L0:;
20771  __Pyx_RefNannyFinishContext();
20772  return __pyx_r;
20773 }
20774 
20775 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) {
20776  int __pyx_v_idx;
20777  Py_ssize_t __pyx_v_i;
20778  Py_ssize_t __pyx_v_dim;
20779  PyObject **__pyx_v_p;
20780  char __pyx_v_order;
20781  int __pyx_r;
20782  __Pyx_RefNannyDeclarations
20783  Py_ssize_t __pyx_t_1;
20784  int __pyx_t_2;
20785  PyObject *__pyx_t_3 = NULL;
20786  int __pyx_t_4;
20787  PyObject *__pyx_t_5 = NULL;
20788  PyObject *__pyx_t_6 = NULL;
20789  char *__pyx_t_7;
20790  int __pyx_t_8;
20791  Py_ssize_t __pyx_t_9;
20792  PyObject *__pyx_t_10 = NULL;
20793  Py_ssize_t __pyx_t_11;
20794  int __pyx_lineno = 0;
20795  const char *__pyx_filename = NULL;
20796  int __pyx_clineno = 0;
20797  __Pyx_RefNannySetupContext("__cinit__", 0);
20798  __Pyx_INCREF(__pyx_v_format);
20799 
20800  /* "View.MemoryView":129
20801  * cdef PyObject **p
20802  *
20803  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
20804  * self.itemsize = itemsize
20805  *
20806  */
20807  if (unlikely(__pyx_v_shape == Py_None)) {
20808  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
20809  __PYX_ERR(1, 129, __pyx_L1_error)
20810  }
20811  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
20812  __pyx_v_self->ndim = ((int)__pyx_t_1);
20813 
20814  /* "View.MemoryView":130
20815  *
20816  * self.ndim = <int> len(shape)
20817  * self.itemsize = itemsize # <<<<<<<<<<<<<<
20818  *
20819  * if not self.ndim:
20820  */
20821  __pyx_v_self->itemsize = __pyx_v_itemsize;
20822 
20823  /* "View.MemoryView":132
20824  * self.itemsize = itemsize
20825  *
20826  * if not self.ndim: # <<<<<<<<<<<<<<
20827  * raise ValueError("Empty shape tuple for cython.array")
20828  *
20829  */
20830  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
20831  if (unlikely(__pyx_t_2)) {
20832 
20833  /* "View.MemoryView":133
20834  *
20835  * if not self.ndim:
20836  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
20837  *
20838  * if itemsize <= 0:
20839  */
20840  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
20841  __Pyx_GOTREF(__pyx_t_3);
20842  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20843  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20844  __PYX_ERR(1, 133, __pyx_L1_error)
20845 
20846  /* "View.MemoryView":132
20847  * self.itemsize = itemsize
20848  *
20849  * if not self.ndim: # <<<<<<<<<<<<<<
20850  * raise ValueError("Empty shape tuple for cython.array")
20851  *
20852  */
20853  }
20854 
20855  /* "View.MemoryView":135
20856  * raise ValueError("Empty shape tuple for cython.array")
20857  *
20858  * if itemsize <= 0: # <<<<<<<<<<<<<<
20859  * raise ValueError("itemsize <= 0 for cython.array")
20860  *
20861  */
20862  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
20863  if (unlikely(__pyx_t_2)) {
20864 
20865  /* "View.MemoryView":136
20866  *
20867  * if itemsize <= 0:
20868  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
20869  *
20870  * if not isinstance(format, bytes):
20871  */
20872  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
20873  __Pyx_GOTREF(__pyx_t_3);
20874  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20875  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20876  __PYX_ERR(1, 136, __pyx_L1_error)
20877 
20878  /* "View.MemoryView":135
20879  * raise ValueError("Empty shape tuple for cython.array")
20880  *
20881  * if itemsize <= 0: # <<<<<<<<<<<<<<
20882  * raise ValueError("itemsize <= 0 for cython.array")
20883  *
20884  */
20885  }
20886 
20887  /* "View.MemoryView":138
20888  * raise ValueError("itemsize <= 0 for cython.array")
20889  *
20890  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
20891  * format = format.encode('ASCII')
20892  * self._format = format # keep a reference to the byte string
20893  */
20894  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
20895  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
20896  if (__pyx_t_4) {
20897 
20898  /* "View.MemoryView":139
20899  *
20900  * if not isinstance(format, bytes):
20901  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
20902  * self._format = format # keep a reference to the byte string
20903  * self.format = self._format
20904  */
20905  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
20906  __Pyx_GOTREF(__pyx_t_5);
20907  __pyx_t_6 = NULL;
20908  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
20909  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
20910  if (likely(__pyx_t_6)) {
20911  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
20912  __Pyx_INCREF(__pyx_t_6);
20913  __Pyx_INCREF(function);
20914  __Pyx_DECREF_SET(__pyx_t_5, function);
20915  }
20916  }
20917  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
20918  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20919  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
20920  __Pyx_GOTREF(__pyx_t_3);
20921  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20922  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
20923  __pyx_t_3 = 0;
20924 
20925  /* "View.MemoryView":138
20926  * raise ValueError("itemsize <= 0 for cython.array")
20927  *
20928  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
20929  * format = format.encode('ASCII')
20930  * self._format = format # keep a reference to the byte string
20931  */
20932  }
20933 
20934  /* "View.MemoryView":140
20935  * if not isinstance(format, bytes):
20936  * format = format.encode('ASCII')
20937  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
20938  * self.format = self._format
20939  *
20940  */
20941  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
20942  __pyx_t_3 = __pyx_v_format;
20943  __Pyx_INCREF(__pyx_t_3);
20944  __Pyx_GIVEREF(__pyx_t_3);
20945  __Pyx_GOTREF(__pyx_v_self->_format);
20946  __Pyx_DECREF(__pyx_v_self->_format);
20947  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
20948  __pyx_t_3 = 0;
20949 
20950  /* "View.MemoryView":141
20951  * format = format.encode('ASCII')
20952  * self._format = format # keep a reference to the byte string
20953  * self.format = self._format # <<<<<<<<<<<<<<
20954  *
20955  *
20956  */
20957  if (unlikely(__pyx_v_self->_format == Py_None)) {
20958  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
20959  __PYX_ERR(1, 141, __pyx_L1_error)
20960  }
20961  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
20962  __pyx_v_self->format = __pyx_t_7;
20963 
20964  /* "View.MemoryView":144
20965  *
20966  *
20967  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
20968  * self._strides = self._shape + self.ndim
20969  *
20970  */
20971  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
20972 
20973  /* "View.MemoryView":145
20974  *
20975  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
20976  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
20977  *
20978  * if not self._shape:
20979  */
20980  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
20981 
20982  /* "View.MemoryView":147
20983  * self._strides = self._shape + self.ndim
20984  *
20985  * if not self._shape: # <<<<<<<<<<<<<<
20986  * raise MemoryError("unable to allocate shape and strides.")
20987  *
20988  */
20989  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
20990  if (unlikely(__pyx_t_4)) {
20991 
20992  /* "View.MemoryView":148
20993  *
20994  * if not self._shape:
20995  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
20996  *
20997  *
20998  */
20999  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
21000  __Pyx_GOTREF(__pyx_t_3);
21001  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21002  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21003  __PYX_ERR(1, 148, __pyx_L1_error)
21004 
21005  /* "View.MemoryView":147
21006  * self._strides = self._shape + self.ndim
21007  *
21008  * if not self._shape: # <<<<<<<<<<<<<<
21009  * raise MemoryError("unable to allocate shape and strides.")
21010  *
21011  */
21012  }
21013 
21014  /* "View.MemoryView":151
21015  *
21016  *
21017  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
21018  * if dim <= 0:
21019  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
21020  */
21021  __pyx_t_8 = 0;
21022  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
21023  for (;;) {
21024  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
21025  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21026  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
21027  #else
21028  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
21029  __Pyx_GOTREF(__pyx_t_5);
21030  #endif
21031  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
21032  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21033  __pyx_v_dim = __pyx_t_9;
21034  __pyx_v_idx = __pyx_t_8;
21035  __pyx_t_8 = (__pyx_t_8 + 1);
21036 
21037  /* "View.MemoryView":152
21038  *
21039  * for idx, dim in enumerate(shape):
21040  * if dim <= 0: # <<<<<<<<<<<<<<
21041  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
21042  * self._shape[idx] = dim
21043  */
21044  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
21045  if (unlikely(__pyx_t_4)) {
21046 
21047  /* "View.MemoryView":153
21048  * for idx, dim in enumerate(shape):
21049  * if dim <= 0:
21050  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
21051  * self._shape[idx] = dim
21052  *
21053  */
21054  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
21055  __Pyx_GOTREF(__pyx_t_5);
21056  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
21057  __Pyx_GOTREF(__pyx_t_6);
21058  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
21059  __Pyx_GOTREF(__pyx_t_10);
21060  __Pyx_GIVEREF(__pyx_t_5);
21061  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
21062  __Pyx_GIVEREF(__pyx_t_6);
21063  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
21064  __pyx_t_5 = 0;
21065  __pyx_t_6 = 0;
21066  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
21067  __Pyx_GOTREF(__pyx_t_6);
21068  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21069  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
21070  __Pyx_GOTREF(__pyx_t_10);
21071  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21072  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
21073  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21074  __PYX_ERR(1, 153, __pyx_L1_error)
21075 
21076  /* "View.MemoryView":152
21077  *
21078  * for idx, dim in enumerate(shape):
21079  * if dim <= 0: # <<<<<<<<<<<<<<
21080  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
21081  * self._shape[idx] = dim
21082  */
21083  }
21084 
21085  /* "View.MemoryView":154
21086  * if dim <= 0:
21087  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
21088  * self._shape[idx] = dim # <<<<<<<<<<<<<<
21089  *
21090  * cdef char order
21091  */
21092  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
21093 
21094  /* "View.MemoryView":151
21095  *
21096  *
21097  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
21098  * if dim <= 0:
21099  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
21100  */
21101  }
21102  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21103 
21104  /* "View.MemoryView":157
21105  *
21106  * cdef char order
21107  * if mode == 'fortran': # <<<<<<<<<<<<<<
21108  * order = b'F'
21109  * self.mode = u'fortran'
21110  */
21111  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
21112  if (__pyx_t_4) {
21113 
21114  /* "View.MemoryView":158
21115  * cdef char order
21116  * if mode == 'fortran':
21117  * order = b'F' # <<<<<<<<<<<<<<
21118  * self.mode = u'fortran'
21119  * elif mode == 'c':
21120  */
21121  __pyx_v_order = 'F';
21122 
21123  /* "View.MemoryView":159
21124  * if mode == 'fortran':
21125  * order = b'F'
21126  * self.mode = u'fortran' # <<<<<<<<<<<<<<
21127  * elif mode == 'c':
21128  * order = b'C'
21129  */
21130  __Pyx_INCREF(__pyx_n_u_fortran);
21131  __Pyx_GIVEREF(__pyx_n_u_fortran);
21132  __Pyx_GOTREF(__pyx_v_self->mode);
21133  __Pyx_DECREF(__pyx_v_self->mode);
21134  __pyx_v_self->mode = __pyx_n_u_fortran;
21135 
21136  /* "View.MemoryView":157
21137  *
21138  * cdef char order
21139  * if mode == 'fortran': # <<<<<<<<<<<<<<
21140  * order = b'F'
21141  * self.mode = u'fortran'
21142  */
21143  goto __pyx_L10;
21144  }
21145 
21146  /* "View.MemoryView":160
21147  * order = b'F'
21148  * self.mode = u'fortran'
21149  * elif mode == 'c': # <<<<<<<<<<<<<<
21150  * order = b'C'
21151  * self.mode = u'c'
21152  */
21153  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
21154  if (likely(__pyx_t_4)) {
21155 
21156  /* "View.MemoryView":161
21157  * self.mode = u'fortran'
21158  * elif mode == 'c':
21159  * order = b'C' # <<<<<<<<<<<<<<
21160  * self.mode = u'c'
21161  * else:
21162  */
21163  __pyx_v_order = 'C';
21164 
21165  /* "View.MemoryView":162
21166  * elif mode == 'c':
21167  * order = b'C'
21168  * self.mode = u'c' # <<<<<<<<<<<<<<
21169  * else:
21170  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
21171  */
21172  __Pyx_INCREF(__pyx_n_u_c);
21173  __Pyx_GIVEREF(__pyx_n_u_c);
21174  __Pyx_GOTREF(__pyx_v_self->mode);
21175  __Pyx_DECREF(__pyx_v_self->mode);
21176  __pyx_v_self->mode = __pyx_n_u_c;
21177 
21178  /* "View.MemoryView":160
21179  * order = b'F'
21180  * self.mode = u'fortran'
21181  * elif mode == 'c': # <<<<<<<<<<<<<<
21182  * order = b'C'
21183  * self.mode = u'c'
21184  */
21185  goto __pyx_L10;
21186  }
21187 
21188  /* "View.MemoryView":164
21189  * self.mode = u'c'
21190  * else:
21191  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
21192  *
21193  * self.len = fill_contig_strides_array(self._shape, self._strides,
21194  */
21195  /*else*/ {
21196  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
21197  __Pyx_GOTREF(__pyx_t_3);
21198  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
21199  __Pyx_GOTREF(__pyx_t_10);
21200  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21201  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
21202  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21203  __PYX_ERR(1, 164, __pyx_L1_error)
21204  }
21205  __pyx_L10:;
21206 
21207  /* "View.MemoryView":166
21208  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
21209  *
21210  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
21211  * itemsize, self.ndim, order)
21212  *
21213  */
21214  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
21215 
21216  /* "View.MemoryView":169
21217  * itemsize, self.ndim, order)
21218  *
21219  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
21220  * self.dtype_is_object = format == b'O'
21221  * if allocate_buffer:
21222  */
21223  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
21224 
21225  /* "View.MemoryView":170
21226  *
21227  * self.free_data = allocate_buffer
21228  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
21229  * if allocate_buffer:
21230  *
21231  */
21232  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
21233  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
21234  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21235  __pyx_v_self->dtype_is_object = __pyx_t_4;
21236 
21237  /* "View.MemoryView":171
21238  * self.free_data = allocate_buffer
21239  * self.dtype_is_object = format == b'O'
21240  * if allocate_buffer: # <<<<<<<<<<<<<<
21241  *
21242  *
21243  */
21244  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
21245  if (__pyx_t_4) {
21246 
21247  /* "View.MemoryView":174
21248  *
21249  *
21250  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
21251  * if not self.data:
21252  * raise MemoryError("unable to allocate array data.")
21253  */
21254  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
21255 
21256  /* "View.MemoryView":175
21257  *
21258  * self.data = <char *>malloc(self.len)
21259  * if not self.data: # <<<<<<<<<<<<<<
21260  * raise MemoryError("unable to allocate array data.")
21261  *
21262  */
21263  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
21264  if (unlikely(__pyx_t_4)) {
21265 
21266  /* "View.MemoryView":176
21267  * self.data = <char *>malloc(self.len)
21268  * if not self.data:
21269  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
21270  *
21271  * if self.dtype_is_object:
21272  */
21273  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
21274  __Pyx_GOTREF(__pyx_t_10);
21275  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
21276  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21277  __PYX_ERR(1, 176, __pyx_L1_error)
21278 
21279  /* "View.MemoryView":175
21280  *
21281  * self.data = <char *>malloc(self.len)
21282  * if not self.data: # <<<<<<<<<<<<<<
21283  * raise MemoryError("unable to allocate array data.")
21284  *
21285  */
21286  }
21287 
21288  /* "View.MemoryView":178
21289  * raise MemoryError("unable to allocate array data.")
21290  *
21291  * if self.dtype_is_object: # <<<<<<<<<<<<<<
21292  * p = <PyObject **> self.data
21293  * for i in range(self.len / itemsize):
21294  */
21295  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
21296  if (__pyx_t_4) {
21297 
21298  /* "View.MemoryView":179
21299  *
21300  * if self.dtype_is_object:
21301  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
21302  * for i in range(self.len / itemsize):
21303  * p[i] = Py_None
21304  */
21305  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
21306 
21307  /* "View.MemoryView":180
21308  * if self.dtype_is_object:
21309  * p = <PyObject **> self.data
21310  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
21311  * p[i] = Py_None
21312  * Py_INCREF(Py_None)
21313  */
21314  if (unlikely(__pyx_v_itemsize == 0)) {
21315  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
21316  __PYX_ERR(1, 180, __pyx_L1_error)
21317  }
21318  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
21319  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
21320  __PYX_ERR(1, 180, __pyx_L1_error)
21321  }
21322  __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
21323  __pyx_t_9 = __pyx_t_1;
21324  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
21325  __pyx_v_i = __pyx_t_11;
21326 
21327  /* "View.MemoryView":181
21328  * p = <PyObject **> self.data
21329  * for i in range(self.len / itemsize):
21330  * p[i] = Py_None # <<<<<<<<<<<<<<
21331  * Py_INCREF(Py_None)
21332  *
21333  */
21334  (__pyx_v_p[__pyx_v_i]) = Py_None;
21335 
21336  /* "View.MemoryView":182
21337  * for i in range(self.len / itemsize):
21338  * p[i] = Py_None
21339  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
21340  *
21341  * @cname('getbuffer')
21342  */
21343  Py_INCREF(Py_None);
21344  }
21345 
21346  /* "View.MemoryView":178
21347  * raise MemoryError("unable to allocate array data.")
21348  *
21349  * if self.dtype_is_object: # <<<<<<<<<<<<<<
21350  * p = <PyObject **> self.data
21351  * for i in range(self.len / itemsize):
21352  */
21353  }
21354 
21355  /* "View.MemoryView":171
21356  * self.free_data = allocate_buffer
21357  * self.dtype_is_object = format == b'O'
21358  * if allocate_buffer: # <<<<<<<<<<<<<<
21359  *
21360  *
21361  */
21362  }
21363 
21364  /* "View.MemoryView":122
21365  * cdef bint dtype_is_object
21366  *
21367  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
21368  * mode="c", bint allocate_buffer=True):
21369  *
21370  */
21371 
21372  /* function exit code */
21373  __pyx_r = 0;
21374  goto __pyx_L0;
21375  __pyx_L1_error:;
21376  __Pyx_XDECREF(__pyx_t_3);
21377  __Pyx_XDECREF(__pyx_t_5);
21378  __Pyx_XDECREF(__pyx_t_6);
21379  __Pyx_XDECREF(__pyx_t_10);
21380  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21381  __pyx_r = -1;
21382  __pyx_L0:;
21383  __Pyx_XDECREF(__pyx_v_format);
21384  __Pyx_RefNannyFinishContext();
21385  return __pyx_r;
21386 }
21387 
21388 /* "View.MemoryView":185
21389  *
21390  * @cname('getbuffer')
21391  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
21392  * cdef int bufmode = -1
21393  * if self.mode == u"c":
21394  */
21395 
21396 /* Python wrapper */
21397 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
21398 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
21399  int __pyx_r;
21400  __Pyx_RefNannyDeclarations
21401  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
21402  __pyx_r = __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));
21403 
21404  /* function exit code */
21405  __Pyx_RefNannyFinishContext();
21406  return __pyx_r;
21407 }
21408 
21409 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) {
21410  int __pyx_v_bufmode;
21411  int __pyx_r;
21412  __Pyx_RefNannyDeclarations
21413  int __pyx_t_1;
21414  int __pyx_t_2;
21415  PyObject *__pyx_t_3 = NULL;
21416  char *__pyx_t_4;
21417  Py_ssize_t __pyx_t_5;
21418  int __pyx_t_6;
21419  Py_ssize_t *__pyx_t_7;
21420  int __pyx_lineno = 0;
21421  const char *__pyx_filename = NULL;
21422  int __pyx_clineno = 0;
21423  if (__pyx_v_info == NULL) {
21424  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
21425  return -1;
21426  }
21427  __Pyx_RefNannySetupContext("__getbuffer__", 0);
21428  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
21429  __Pyx_GIVEREF(__pyx_v_info->obj);
21430 
21431  /* "View.MemoryView":186
21432  * @cname('getbuffer')
21433  * def __getbuffer__(self, Py_buffer *info, int flags):
21434  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
21435  * if self.mode == u"c":
21436  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21437  */
21438  __pyx_v_bufmode = -1;
21439 
21440  /* "View.MemoryView":187
21441  * def __getbuffer__(self, Py_buffer *info, int flags):
21442  * cdef int bufmode = -1
21443  * if self.mode == u"c": # <<<<<<<<<<<<<<
21444  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21445  * elif self.mode == u"fortran":
21446  */
21447  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
21448  __pyx_t_2 = (__pyx_t_1 != 0);
21449  if (__pyx_t_2) {
21450 
21451  /* "View.MemoryView":188
21452  * cdef int bufmode = -1
21453  * if self.mode == u"c":
21454  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
21455  * elif self.mode == u"fortran":
21456  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21457  */
21458  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
21459 
21460  /* "View.MemoryView":187
21461  * def __getbuffer__(self, Py_buffer *info, int flags):
21462  * cdef int bufmode = -1
21463  * if self.mode == u"c": # <<<<<<<<<<<<<<
21464  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21465  * elif self.mode == u"fortran":
21466  */
21467  goto __pyx_L3;
21468  }
21469 
21470  /* "View.MemoryView":189
21471  * if self.mode == u"c":
21472  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21473  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
21474  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21475  * if not (flags & bufmode):
21476  */
21477  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
21478  __pyx_t_1 = (__pyx_t_2 != 0);
21479  if (__pyx_t_1) {
21480 
21481  /* "View.MemoryView":190
21482  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21483  * elif self.mode == u"fortran":
21484  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
21485  * if not (flags & bufmode):
21486  * raise ValueError("Can only create a buffer that is contiguous in memory.")
21487  */
21488  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
21489 
21490  /* "View.MemoryView":189
21491  * if self.mode == u"c":
21492  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21493  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
21494  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21495  * if not (flags & bufmode):
21496  */
21497  }
21498  __pyx_L3:;
21499 
21500  /* "View.MemoryView":191
21501  * elif self.mode == u"fortran":
21502  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21503  * if not (flags & bufmode): # <<<<<<<<<<<<<<
21504  * raise ValueError("Can only create a buffer that is contiguous in memory.")
21505  * info.buf = self.data
21506  */
21507  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
21508  if (unlikely(__pyx_t_1)) {
21509 
21510  /* "View.MemoryView":192
21511  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21512  * if not (flags & bufmode):
21513  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
21514  * info.buf = self.data
21515  * info.len = self.len
21516  */
21517  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
21518  __Pyx_GOTREF(__pyx_t_3);
21519  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21520  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21521  __PYX_ERR(1, 192, __pyx_L1_error)
21522 
21523  /* "View.MemoryView":191
21524  * elif self.mode == u"fortran":
21525  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21526  * if not (flags & bufmode): # <<<<<<<<<<<<<<
21527  * raise ValueError("Can only create a buffer that is contiguous in memory.")
21528  * info.buf = self.data
21529  */
21530  }
21531 
21532  /* "View.MemoryView":193
21533  * if not (flags & bufmode):
21534  * raise ValueError("Can only create a buffer that is contiguous in memory.")
21535  * info.buf = self.data # <<<<<<<<<<<<<<
21536  * info.len = self.len
21537  * info.ndim = self.ndim
21538  */
21539  __pyx_t_4 = __pyx_v_self->data;
21540  __pyx_v_info->buf = __pyx_t_4;
21541 
21542  /* "View.MemoryView":194
21543  * raise ValueError("Can only create a buffer that is contiguous in memory.")
21544  * info.buf = self.data
21545  * info.len = self.len # <<<<<<<<<<<<<<
21546  * info.ndim = self.ndim
21547  * info.shape = self._shape
21548  */
21549  __pyx_t_5 = __pyx_v_self->len;
21550  __pyx_v_info->len = __pyx_t_5;
21551 
21552  /* "View.MemoryView":195
21553  * info.buf = self.data
21554  * info.len = self.len
21555  * info.ndim = self.ndim # <<<<<<<<<<<<<<
21556  * info.shape = self._shape
21557  * info.strides = self._strides
21558  */
21559  __pyx_t_6 = __pyx_v_self->ndim;
21560  __pyx_v_info->ndim = __pyx_t_6;
21561 
21562  /* "View.MemoryView":196
21563  * info.len = self.len
21564  * info.ndim = self.ndim
21565  * info.shape = self._shape # <<<<<<<<<<<<<<
21566  * info.strides = self._strides
21567  * info.suboffsets = NULL
21568  */
21569  __pyx_t_7 = __pyx_v_self->_shape;
21570  __pyx_v_info->shape = __pyx_t_7;
21571 
21572  /* "View.MemoryView":197
21573  * info.ndim = self.ndim
21574  * info.shape = self._shape
21575  * info.strides = self._strides # <<<<<<<<<<<<<<
21576  * info.suboffsets = NULL
21577  * info.itemsize = self.itemsize
21578  */
21579  __pyx_t_7 = __pyx_v_self->_strides;
21580  __pyx_v_info->strides = __pyx_t_7;
21581 
21582  /* "View.MemoryView":198
21583  * info.shape = self._shape
21584  * info.strides = self._strides
21585  * info.suboffsets = NULL # <<<<<<<<<<<<<<
21586  * info.itemsize = self.itemsize
21587  * info.readonly = 0
21588  */
21589  __pyx_v_info->suboffsets = NULL;
21590 
21591  /* "View.MemoryView":199
21592  * info.strides = self._strides
21593  * info.suboffsets = NULL
21594  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
21595  * info.readonly = 0
21596  *
21597  */
21598  __pyx_t_5 = __pyx_v_self->itemsize;
21599  __pyx_v_info->itemsize = __pyx_t_5;
21600 
21601  /* "View.MemoryView":200
21602  * info.suboffsets = NULL
21603  * info.itemsize = self.itemsize
21604  * info.readonly = 0 # <<<<<<<<<<<<<<
21605  *
21606  * if flags & PyBUF_FORMAT:
21607  */
21608  __pyx_v_info->readonly = 0;
21609 
21610  /* "View.MemoryView":202
21611  * info.readonly = 0
21612  *
21613  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
21614  * info.format = self.format
21615  * else:
21616  */
21617  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
21618  if (__pyx_t_1) {
21619 
21620  /* "View.MemoryView":203
21621  *
21622  * if flags & PyBUF_FORMAT:
21623  * info.format = self.format # <<<<<<<<<<<<<<
21624  * else:
21625  * info.format = NULL
21626  */
21627  __pyx_t_4 = __pyx_v_self->format;
21628  __pyx_v_info->format = __pyx_t_4;
21629 
21630  /* "View.MemoryView":202
21631  * info.readonly = 0
21632  *
21633  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
21634  * info.format = self.format
21635  * else:
21636  */
21637  goto __pyx_L5;
21638  }
21639 
21640  /* "View.MemoryView":205
21641  * info.format = self.format
21642  * else:
21643  * info.format = NULL # <<<<<<<<<<<<<<
21644  *
21645  * info.obj = self
21646  */
21647  /*else*/ {
21648  __pyx_v_info->format = NULL;
21649  }
21650  __pyx_L5:;
21651 
21652  /* "View.MemoryView":207
21653  * info.format = NULL
21654  *
21655  * info.obj = self # <<<<<<<<<<<<<<
21656  *
21657  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
21658  */
21659  __Pyx_INCREF(((PyObject *)__pyx_v_self));
21660  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
21661  __Pyx_GOTREF(__pyx_v_info->obj);
21662  __Pyx_DECREF(__pyx_v_info->obj);
21663  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
21664 
21665  /* "View.MemoryView":185
21666  *
21667  * @cname('getbuffer')
21668  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
21669  * cdef int bufmode = -1
21670  * if self.mode == u"c":
21671  */
21672 
21673  /* function exit code */
21674  __pyx_r = 0;
21675  goto __pyx_L0;
21676  __pyx_L1_error:;
21677  __Pyx_XDECREF(__pyx_t_3);
21678  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21679  __pyx_r = -1;
21680  if (__pyx_v_info->obj != NULL) {
21681  __Pyx_GOTREF(__pyx_v_info->obj);
21682  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
21683  }
21684  goto __pyx_L2;
21685  __pyx_L0:;
21686  if (__pyx_v_info->obj == Py_None) {
21687  __Pyx_GOTREF(__pyx_v_info->obj);
21688  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
21689  }
21690  __pyx_L2:;
21691  __Pyx_RefNannyFinishContext();
21692  return __pyx_r;
21693 }
21694 
21695 /* "View.MemoryView":211
21696  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
21697  *
21698  * def __dealloc__(array self): # <<<<<<<<<<<<<<
21699  * if self.callback_free_data != NULL:
21700  * self.callback_free_data(self.data)
21701  */
21702 
21703 /* Python wrapper */
21704 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
21705 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
21706  __Pyx_RefNannyDeclarations
21707  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
21708  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
21709 
21710  /* function exit code */
21711  __Pyx_RefNannyFinishContext();
21712 }
21713 
21714 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
21715  __Pyx_RefNannyDeclarations
21716  int __pyx_t_1;
21717  __Pyx_RefNannySetupContext("__dealloc__", 0);
21718 
21719  /* "View.MemoryView":212
21720  *
21721  * def __dealloc__(array self):
21722  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
21723  * self.callback_free_data(self.data)
21724  * elif self.free_data:
21725  */
21726  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
21727  if (__pyx_t_1) {
21728 
21729  /* "View.MemoryView":213
21730  * def __dealloc__(array self):
21731  * if self.callback_free_data != NULL:
21732  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
21733  * elif self.free_data:
21734  * if self.dtype_is_object:
21735  */
21736  __pyx_v_self->callback_free_data(__pyx_v_self->data);
21737 
21738  /* "View.MemoryView":212
21739  *
21740  * def __dealloc__(array self):
21741  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
21742  * self.callback_free_data(self.data)
21743  * elif self.free_data:
21744  */
21745  goto __pyx_L3;
21746  }
21747 
21748  /* "View.MemoryView":214
21749  * if self.callback_free_data != NULL:
21750  * self.callback_free_data(self.data)
21751  * elif self.free_data: # <<<<<<<<<<<<<<
21752  * if self.dtype_is_object:
21753  * refcount_objects_in_slice(self.data, self._shape,
21754  */
21755  __pyx_t_1 = (__pyx_v_self->free_data != 0);
21756  if (__pyx_t_1) {
21757 
21758  /* "View.MemoryView":215
21759  * self.callback_free_data(self.data)
21760  * elif self.free_data:
21761  * if self.dtype_is_object: # <<<<<<<<<<<<<<
21762  * refcount_objects_in_slice(self.data, self._shape,
21763  * self._strides, self.ndim, False)
21764  */
21765  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
21766  if (__pyx_t_1) {
21767 
21768  /* "View.MemoryView":216
21769  * elif self.free_data:
21770  * if self.dtype_is_object:
21771  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
21772  * self._strides, self.ndim, False)
21773  * free(self.data)
21774  */
21775  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
21776 
21777  /* "View.MemoryView":215
21778  * self.callback_free_data(self.data)
21779  * elif self.free_data:
21780  * if self.dtype_is_object: # <<<<<<<<<<<<<<
21781  * refcount_objects_in_slice(self.data, self._shape,
21782  * self._strides, self.ndim, False)
21783  */
21784  }
21785 
21786  /* "View.MemoryView":218
21787  * refcount_objects_in_slice(self.data, self._shape,
21788  * self._strides, self.ndim, False)
21789  * free(self.data) # <<<<<<<<<<<<<<
21790  * PyObject_Free(self._shape)
21791  *
21792  */
21793  free(__pyx_v_self->data);
21794 
21795  /* "View.MemoryView":214
21796  * if self.callback_free_data != NULL:
21797  * self.callback_free_data(self.data)
21798  * elif self.free_data: # <<<<<<<<<<<<<<
21799  * if self.dtype_is_object:
21800  * refcount_objects_in_slice(self.data, self._shape,
21801  */
21802  }
21803  __pyx_L3:;
21804 
21805  /* "View.MemoryView":219
21806  * self._strides, self.ndim, False)
21807  * free(self.data)
21808  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
21809  *
21810  * @property
21811  */
21812  PyObject_Free(__pyx_v_self->_shape);
21813 
21814  /* "View.MemoryView":211
21815  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
21816  *
21817  * def __dealloc__(array self): # <<<<<<<<<<<<<<
21818  * if self.callback_free_data != NULL:
21819  * self.callback_free_data(self.data)
21820  */
21821 
21822  /* function exit code */
21823  __Pyx_RefNannyFinishContext();
21824 }
21825 
21826 /* "View.MemoryView":222
21827  *
21828  * @property
21829  * def memview(self): # <<<<<<<<<<<<<<
21830  * return self.get_memview()
21831  *
21832  */
21833 
21834 /* Python wrapper */
21835 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
21836 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
21837  PyObject *__pyx_r = 0;
21838  __Pyx_RefNannyDeclarations
21839  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
21840  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
21841 
21842  /* function exit code */
21843  __Pyx_RefNannyFinishContext();
21844  return __pyx_r;
21845 }
21846 
21847 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
21848  PyObject *__pyx_r = NULL;
21849  __Pyx_RefNannyDeclarations
21850  PyObject *__pyx_t_1 = NULL;
21851  int __pyx_lineno = 0;
21852  const char *__pyx_filename = NULL;
21853  int __pyx_clineno = 0;
21854  __Pyx_RefNannySetupContext("__get__", 0);
21855 
21856  /* "View.MemoryView":223
21857  * @property
21858  * def memview(self):
21859  * return self.get_memview() # <<<<<<<<<<<<<<
21860  *
21861  * @cname('get_memview')
21862  */
21863  __Pyx_XDECREF(__pyx_r);
21864  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
21865  __Pyx_GOTREF(__pyx_t_1);
21866  __pyx_r = __pyx_t_1;
21867  __pyx_t_1 = 0;
21868  goto __pyx_L0;
21869 
21870  /* "View.MemoryView":222
21871  *
21872  * @property
21873  * def memview(self): # <<<<<<<<<<<<<<
21874  * return self.get_memview()
21875  *
21876  */
21877 
21878  /* function exit code */
21879  __pyx_L1_error:;
21880  __Pyx_XDECREF(__pyx_t_1);
21881  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21882  __pyx_r = NULL;
21883  __pyx_L0:;
21884  __Pyx_XGIVEREF(__pyx_r);
21885  __Pyx_RefNannyFinishContext();
21886  return __pyx_r;
21887 }
21888 
21889 /* "View.MemoryView":226
21890  *
21891  * @cname('get_memview')
21892  * cdef get_memview(self): # <<<<<<<<<<<<<<
21893  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
21894  * return memoryview(self, flags, self.dtype_is_object)
21895  */
21896 
21897 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
21898  int __pyx_v_flags;
21899  PyObject *__pyx_r = NULL;
21900  __Pyx_RefNannyDeclarations
21901  PyObject *__pyx_t_1 = NULL;
21902  PyObject *__pyx_t_2 = NULL;
21903  PyObject *__pyx_t_3 = NULL;
21904  int __pyx_lineno = 0;
21905  const char *__pyx_filename = NULL;
21906  int __pyx_clineno = 0;
21907  __Pyx_RefNannySetupContext("get_memview", 0);
21908 
21909  /* "View.MemoryView":227
21910  * @cname('get_memview')
21911  * cdef get_memview(self):
21912  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
21913  * return memoryview(self, flags, self.dtype_is_object)
21914  *
21915  */
21916  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
21917 
21918  /* "View.MemoryView":228
21919  * cdef get_memview(self):
21920  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
21921  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
21922  *
21923  * def __len__(self):
21924  */
21925  __Pyx_XDECREF(__pyx_r);
21926  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
21927  __Pyx_GOTREF(__pyx_t_1);
21928  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
21929  __Pyx_GOTREF(__pyx_t_2);
21930  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
21931  __Pyx_GOTREF(__pyx_t_3);
21932  __Pyx_INCREF(((PyObject *)__pyx_v_self));
21933  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
21934  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
21935  __Pyx_GIVEREF(__pyx_t_1);
21936  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
21937  __Pyx_GIVEREF(__pyx_t_2);
21938  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
21939  __pyx_t_1 = 0;
21940  __pyx_t_2 = 0;
21941  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
21942  __Pyx_GOTREF(__pyx_t_2);
21943  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21944  __pyx_r = __pyx_t_2;
21945  __pyx_t_2 = 0;
21946  goto __pyx_L0;
21947 
21948  /* "View.MemoryView":226
21949  *
21950  * @cname('get_memview')
21951  * cdef get_memview(self): # <<<<<<<<<<<<<<
21952  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
21953  * return memoryview(self, flags, self.dtype_is_object)
21954  */
21955 
21956  /* function exit code */
21957  __pyx_L1_error:;
21958  __Pyx_XDECREF(__pyx_t_1);
21959  __Pyx_XDECREF(__pyx_t_2);
21960  __Pyx_XDECREF(__pyx_t_3);
21961  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
21962  __pyx_r = 0;
21963  __pyx_L0:;
21964  __Pyx_XGIVEREF(__pyx_r);
21965  __Pyx_RefNannyFinishContext();
21966  return __pyx_r;
21967 }
21968 
21969 /* "View.MemoryView":230
21970  * return memoryview(self, flags, self.dtype_is_object)
21971  *
21972  * def __len__(self): # <<<<<<<<<<<<<<
21973  * return self._shape[0]
21974  *
21975  */
21976 
21977 /* Python wrapper */
21978 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
21979 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
21980  Py_ssize_t __pyx_r;
21981  __Pyx_RefNannyDeclarations
21982  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
21983  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
21984 
21985  /* function exit code */
21986  __Pyx_RefNannyFinishContext();
21987  return __pyx_r;
21988 }
21989 
21990 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
21991  Py_ssize_t __pyx_r;
21992  __Pyx_RefNannyDeclarations
21993  __Pyx_RefNannySetupContext("__len__", 0);
21994 
21995  /* "View.MemoryView":231
21996  *
21997  * def __len__(self):
21998  * return self._shape[0] # <<<<<<<<<<<<<<
21999  *
22000  * def __getattr__(self, attr):
22001  */
22002  __pyx_r = (__pyx_v_self->_shape[0]);
22003  goto __pyx_L0;
22004 
22005  /* "View.MemoryView":230
22006  * return memoryview(self, flags, self.dtype_is_object)
22007  *
22008  * def __len__(self): # <<<<<<<<<<<<<<
22009  * return self._shape[0]
22010  *
22011  */
22012 
22013  /* function exit code */
22014  __pyx_L0:;
22015  __Pyx_RefNannyFinishContext();
22016  return __pyx_r;
22017 }
22018 
22019 /* "View.MemoryView":233
22020  * return self._shape[0]
22021  *
22022  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
22023  * return getattr(self.memview, attr)
22024  *
22025  */
22026 
22027 /* Python wrapper */
22028 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
22029 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
22030  PyObject *__pyx_r = 0;
22031  __Pyx_RefNannyDeclarations
22032  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
22033  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
22034 
22035  /* function exit code */
22036  __Pyx_RefNannyFinishContext();
22037  return __pyx_r;
22038 }
22039 
22040 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
22041  PyObject *__pyx_r = NULL;
22042  __Pyx_RefNannyDeclarations
22043  PyObject *__pyx_t_1 = NULL;
22044  PyObject *__pyx_t_2 = NULL;
22045  int __pyx_lineno = 0;
22046  const char *__pyx_filename = NULL;
22047  int __pyx_clineno = 0;
22048  __Pyx_RefNannySetupContext("__getattr__", 0);
22049 
22050  /* "View.MemoryView":234
22051  *
22052  * def __getattr__(self, attr):
22053  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
22054  *
22055  * def __getitem__(self, item):
22056  */
22057  __Pyx_XDECREF(__pyx_r);
22058  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
22059  __Pyx_GOTREF(__pyx_t_1);
22060  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
22061  __Pyx_GOTREF(__pyx_t_2);
22062  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22063  __pyx_r = __pyx_t_2;
22064  __pyx_t_2 = 0;
22065  goto __pyx_L0;
22066 
22067  /* "View.MemoryView":233
22068  * return self._shape[0]
22069  *
22070  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
22071  * return getattr(self.memview, attr)
22072  *
22073  */
22074 
22075  /* function exit code */
22076  __pyx_L1_error:;
22077  __Pyx_XDECREF(__pyx_t_1);
22078  __Pyx_XDECREF(__pyx_t_2);
22079  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22080  __pyx_r = NULL;
22081  __pyx_L0:;
22082  __Pyx_XGIVEREF(__pyx_r);
22083  __Pyx_RefNannyFinishContext();
22084  return __pyx_r;
22085 }
22086 
22087 /* "View.MemoryView":236
22088  * return getattr(self.memview, attr)
22089  *
22090  * def __getitem__(self, item): # <<<<<<<<<<<<<<
22091  * return self.memview[item]
22092  *
22093  */
22094 
22095 /* Python wrapper */
22096 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
22097 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
22098  PyObject *__pyx_r = 0;
22099  __Pyx_RefNannyDeclarations
22100  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
22101  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
22102 
22103  /* function exit code */
22104  __Pyx_RefNannyFinishContext();
22105  return __pyx_r;
22106 }
22107 
22108 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
22109  PyObject *__pyx_r = NULL;
22110  __Pyx_RefNannyDeclarations
22111  PyObject *__pyx_t_1 = NULL;
22112  PyObject *__pyx_t_2 = NULL;
22113  int __pyx_lineno = 0;
22114  const char *__pyx_filename = NULL;
22115  int __pyx_clineno = 0;
22116  __Pyx_RefNannySetupContext("__getitem__", 0);
22117 
22118  /* "View.MemoryView":237
22119  *
22120  * def __getitem__(self, item):
22121  * return self.memview[item] # <<<<<<<<<<<<<<
22122  *
22123  * def __setitem__(self, item, value):
22124  */
22125  __Pyx_XDECREF(__pyx_r);
22126  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
22127  __Pyx_GOTREF(__pyx_t_1);
22128  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
22129  __Pyx_GOTREF(__pyx_t_2);
22130  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22131  __pyx_r = __pyx_t_2;
22132  __pyx_t_2 = 0;
22133  goto __pyx_L0;
22134 
22135  /* "View.MemoryView":236
22136  * return getattr(self.memview, attr)
22137  *
22138  * def __getitem__(self, item): # <<<<<<<<<<<<<<
22139  * return self.memview[item]
22140  *
22141  */
22142 
22143  /* function exit code */
22144  __pyx_L1_error:;
22145  __Pyx_XDECREF(__pyx_t_1);
22146  __Pyx_XDECREF(__pyx_t_2);
22147  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22148  __pyx_r = NULL;
22149  __pyx_L0:;
22150  __Pyx_XGIVEREF(__pyx_r);
22151  __Pyx_RefNannyFinishContext();
22152  return __pyx_r;
22153 }
22154 
22155 /* "View.MemoryView":239
22156  * return self.memview[item]
22157  *
22158  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
22159  * self.memview[item] = value
22160  *
22161  */
22162 
22163 /* Python wrapper */
22164 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
22165 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
22166  int __pyx_r;
22167  __Pyx_RefNannyDeclarations
22168  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
22169  __pyx_r = __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));
22170 
22171  /* function exit code */
22172  __Pyx_RefNannyFinishContext();
22173  return __pyx_r;
22174 }
22175 
22176 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) {
22177  int __pyx_r;
22178  __Pyx_RefNannyDeclarations
22179  PyObject *__pyx_t_1 = NULL;
22180  int __pyx_lineno = 0;
22181  const char *__pyx_filename = NULL;
22182  int __pyx_clineno = 0;
22183  __Pyx_RefNannySetupContext("__setitem__", 0);
22184 
22185  /* "View.MemoryView":240
22186  *
22187  * def __setitem__(self, item, value):
22188  * self.memview[item] = value # <<<<<<<<<<<<<<
22189  *
22190  *
22191  */
22192  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
22193  __Pyx_GOTREF(__pyx_t_1);
22194  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
22195  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22196 
22197  /* "View.MemoryView":239
22198  * return self.memview[item]
22199  *
22200  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
22201  * self.memview[item] = value
22202  *
22203  */
22204 
22205  /* function exit code */
22206  __pyx_r = 0;
22207  goto __pyx_L0;
22208  __pyx_L1_error:;
22209  __Pyx_XDECREF(__pyx_t_1);
22210  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22211  __pyx_r = -1;
22212  __pyx_L0:;
22213  __Pyx_RefNannyFinishContext();
22214  return __pyx_r;
22215 }
22216 
22217 /* "(tree fragment)":1
22218  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22219  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22220  * def __setstate_cython__(self, __pyx_state):
22221  */
22222 
22223 /* Python wrapper */
22224 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
22225 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
22226  PyObject *__pyx_r = 0;
22227  __Pyx_RefNannyDeclarations
22228  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
22229  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
22230 
22231  /* function exit code */
22232  __Pyx_RefNannyFinishContext();
22233  return __pyx_r;
22234 }
22235 
22236 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
22237  PyObject *__pyx_r = NULL;
22238  __Pyx_RefNannyDeclarations
22239  PyObject *__pyx_t_1 = NULL;
22240  int __pyx_lineno = 0;
22241  const char *__pyx_filename = NULL;
22242  int __pyx_clineno = 0;
22243  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
22244 
22245  /* "(tree fragment)":2
22246  * def __reduce_cython__(self):
22247  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22248  * def __setstate_cython__(self, __pyx_state):
22249  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22250  */
22251  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
22252  __Pyx_GOTREF(__pyx_t_1);
22253  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
22254  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22255  __PYX_ERR(1, 2, __pyx_L1_error)
22256 
22257  /* "(tree fragment)":1
22258  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22259  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22260  * def __setstate_cython__(self, __pyx_state):
22261  */
22262 
22263  /* function exit code */
22264  __pyx_L1_error:;
22265  __Pyx_XDECREF(__pyx_t_1);
22266  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22267  __pyx_r = NULL;
22268  __Pyx_XGIVEREF(__pyx_r);
22269  __Pyx_RefNannyFinishContext();
22270  return __pyx_r;
22271 }
22272 
22273 /* "(tree fragment)":3
22274  * def __reduce_cython__(self):
22275  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22276  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22277  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22278  */
22279 
22280 /* Python wrapper */
22281 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
22282 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
22283  PyObject *__pyx_r = 0;
22284  __Pyx_RefNannyDeclarations
22285  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
22286  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
22287 
22288  /* function exit code */
22289  __Pyx_RefNannyFinishContext();
22290  return __pyx_r;
22291 }
22292 
22293 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) {
22294  PyObject *__pyx_r = NULL;
22295  __Pyx_RefNannyDeclarations
22296  PyObject *__pyx_t_1 = NULL;
22297  int __pyx_lineno = 0;
22298  const char *__pyx_filename = NULL;
22299  int __pyx_clineno = 0;
22300  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
22301 
22302  /* "(tree fragment)":4
22303  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22304  * def __setstate_cython__(self, __pyx_state):
22305  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22306  */
22307  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
22308  __Pyx_GOTREF(__pyx_t_1);
22309  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
22310  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22311  __PYX_ERR(1, 4, __pyx_L1_error)
22312 
22313  /* "(tree fragment)":3
22314  * def __reduce_cython__(self):
22315  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22316  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22317  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22318  */
22319 
22320  /* function exit code */
22321  __pyx_L1_error:;
22322  __Pyx_XDECREF(__pyx_t_1);
22323  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22324  __pyx_r = NULL;
22325  __Pyx_XGIVEREF(__pyx_r);
22326  __Pyx_RefNannyFinishContext();
22327  return __pyx_r;
22328 }
22329 
22330 /* "View.MemoryView":244
22331  *
22332  * @cname("__pyx_array_new")
22333  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
22334  * char *mode, char *buf):
22335  * cdef array result
22336  */
22337 
22338 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
22339  struct __pyx_array_obj *__pyx_v_result = 0;
22340  struct __pyx_array_obj *__pyx_r = NULL;
22341  __Pyx_RefNannyDeclarations
22342  int __pyx_t_1;
22343  PyObject *__pyx_t_2 = NULL;
22344  PyObject *__pyx_t_3 = NULL;
22345  PyObject *__pyx_t_4 = NULL;
22346  PyObject *__pyx_t_5 = NULL;
22347  int __pyx_lineno = 0;
22348  const char *__pyx_filename = NULL;
22349  int __pyx_clineno = 0;
22350  __Pyx_RefNannySetupContext("array_cwrapper", 0);
22351 
22352  /* "View.MemoryView":248
22353  * cdef array result
22354  *
22355  * if buf == NULL: # <<<<<<<<<<<<<<
22356  * result = array(shape, itemsize, format, mode.decode('ASCII'))
22357  * else:
22358  */
22359  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
22360  if (__pyx_t_1) {
22361 
22362  /* "View.MemoryView":249
22363  *
22364  * if buf == NULL:
22365  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
22366  * else:
22367  * result = array(shape, itemsize, format, mode.decode('ASCII'),
22368  */
22369  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
22370  __Pyx_GOTREF(__pyx_t_2);
22371  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
22372  __Pyx_GOTREF(__pyx_t_3);
22373  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
22374  __Pyx_GOTREF(__pyx_t_4);
22375  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
22376  __Pyx_GOTREF(__pyx_t_5);
22377  __Pyx_INCREF(__pyx_v_shape);
22378  __Pyx_GIVEREF(__pyx_v_shape);
22379  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
22380  __Pyx_GIVEREF(__pyx_t_2);
22381  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
22382  __Pyx_GIVEREF(__pyx_t_3);
22383  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
22384  __Pyx_GIVEREF(__pyx_t_4);
22385  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
22386  __pyx_t_2 = 0;
22387  __pyx_t_3 = 0;
22388  __pyx_t_4 = 0;
22389  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
22390  __Pyx_GOTREF(__pyx_t_4);
22391  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22392  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
22393  __pyx_t_4 = 0;
22394 
22395  /* "View.MemoryView":248
22396  * cdef array result
22397  *
22398  * if buf == NULL: # <<<<<<<<<<<<<<
22399  * result = array(shape, itemsize, format, mode.decode('ASCII'))
22400  * else:
22401  */
22402  goto __pyx_L3;
22403  }
22404 
22405  /* "View.MemoryView":251
22406  * result = array(shape, itemsize, format, mode.decode('ASCII'))
22407  * else:
22408  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
22409  * allocate_buffer=False)
22410  * result.data = buf
22411  */
22412  /*else*/ {
22413  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
22414  __Pyx_GOTREF(__pyx_t_4);
22415  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
22416  __Pyx_GOTREF(__pyx_t_5);
22417  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
22418  __Pyx_GOTREF(__pyx_t_3);
22419  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
22420  __Pyx_GOTREF(__pyx_t_2);
22421  __Pyx_INCREF(__pyx_v_shape);
22422  __Pyx_GIVEREF(__pyx_v_shape);
22423  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
22424  __Pyx_GIVEREF(__pyx_t_4);
22425  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
22426  __Pyx_GIVEREF(__pyx_t_5);
22427  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
22428  __Pyx_GIVEREF(__pyx_t_3);
22429  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
22430  __pyx_t_4 = 0;
22431  __pyx_t_5 = 0;
22432  __pyx_t_3 = 0;
22433 
22434  /* "View.MemoryView":252
22435  * else:
22436  * result = array(shape, itemsize, format, mode.decode('ASCII'),
22437  * allocate_buffer=False) # <<<<<<<<<<<<<<
22438  * result.data = buf
22439  *
22440  */
22441  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
22442  __Pyx_GOTREF(__pyx_t_3);
22443  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
22444 
22445  /* "View.MemoryView":251
22446  * result = array(shape, itemsize, format, mode.decode('ASCII'))
22447  * else:
22448  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
22449  * allocate_buffer=False)
22450  * result.data = buf
22451  */
22452  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
22453  __Pyx_GOTREF(__pyx_t_5);
22454  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22455  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22456  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
22457  __pyx_t_5 = 0;
22458 
22459  /* "View.MemoryView":253
22460  * result = array(shape, itemsize, format, mode.decode('ASCII'),
22461  * allocate_buffer=False)
22462  * result.data = buf # <<<<<<<<<<<<<<
22463  *
22464  * return result
22465  */
22466  __pyx_v_result->data = __pyx_v_buf;
22467  }
22468  __pyx_L3:;
22469 
22470  /* "View.MemoryView":255
22471  * result.data = buf
22472  *
22473  * return result # <<<<<<<<<<<<<<
22474  *
22475  *
22476  */
22477  __Pyx_XDECREF(((PyObject *)__pyx_r));
22478  __Pyx_INCREF(((PyObject *)__pyx_v_result));
22479  __pyx_r = __pyx_v_result;
22480  goto __pyx_L0;
22481 
22482  /* "View.MemoryView":244
22483  *
22484  * @cname("__pyx_array_new")
22485  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
22486  * char *mode, char *buf):
22487  * cdef array result
22488  */
22489 
22490  /* function exit code */
22491  __pyx_L1_error:;
22492  __Pyx_XDECREF(__pyx_t_2);
22493  __Pyx_XDECREF(__pyx_t_3);
22494  __Pyx_XDECREF(__pyx_t_4);
22495  __Pyx_XDECREF(__pyx_t_5);
22496  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
22497  __pyx_r = 0;
22498  __pyx_L0:;
22499  __Pyx_XDECREF((PyObject *)__pyx_v_result);
22500  __Pyx_XGIVEREF((PyObject *)__pyx_r);
22501  __Pyx_RefNannyFinishContext();
22502  return __pyx_r;
22503 }
22504 
22505 /* "View.MemoryView":281
22506  * cdef class Enum(object):
22507  * cdef object name
22508  * def __init__(self, name): # <<<<<<<<<<<<<<
22509  * self.name = name
22510  * def __repr__(self):
22511  */
22512 
22513 /* Python wrapper */
22514 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
22515 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
22516  PyObject *__pyx_v_name = 0;
22517  int __pyx_lineno = 0;
22518  const char *__pyx_filename = NULL;
22519  int __pyx_clineno = 0;
22520  int __pyx_r;
22521  __Pyx_RefNannyDeclarations
22522  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
22523  {
22524  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
22525  PyObject* values[1] = {0};
22526  if (unlikely(__pyx_kwds)) {
22527  Py_ssize_t kw_args;
22528  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
22529  switch (pos_args) {
22530  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22531  CYTHON_FALLTHROUGH;
22532  case 0: break;
22533  default: goto __pyx_L5_argtuple_error;
22534  }
22535  kw_args = PyDict_Size(__pyx_kwds);
22536  switch (pos_args) {
22537  case 0:
22538  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
22539  else goto __pyx_L5_argtuple_error;
22540  }
22541  if (unlikely(kw_args > 0)) {
22542  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
22543  }
22544  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
22545  goto __pyx_L5_argtuple_error;
22546  } else {
22547  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22548  }
22549  __pyx_v_name = values[0];
22550  }
22551  goto __pyx_L4_argument_unpacking_done;
22552  __pyx_L5_argtuple_error:;
22553  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
22554  __pyx_L3_error:;
22555  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22556  __Pyx_RefNannyFinishContext();
22557  return -1;
22558  __pyx_L4_argument_unpacking_done:;
22559  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
22560 
22561  /* function exit code */
22562  __Pyx_RefNannyFinishContext();
22563  return __pyx_r;
22564 }
22565 
22566 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
22567  int __pyx_r;
22568  __Pyx_RefNannyDeclarations
22569  __Pyx_RefNannySetupContext("__init__", 0);
22570 
22571  /* "View.MemoryView":282
22572  * cdef object name
22573  * def __init__(self, name):
22574  * self.name = name # <<<<<<<<<<<<<<
22575  * def __repr__(self):
22576  * return self.name
22577  */
22578  __Pyx_INCREF(__pyx_v_name);
22579  __Pyx_GIVEREF(__pyx_v_name);
22580  __Pyx_GOTREF(__pyx_v_self->name);
22581  __Pyx_DECREF(__pyx_v_self->name);
22582  __pyx_v_self->name = __pyx_v_name;
22583 
22584  /* "View.MemoryView":281
22585  * cdef class Enum(object):
22586  * cdef object name
22587  * def __init__(self, name): # <<<<<<<<<<<<<<
22588  * self.name = name
22589  * def __repr__(self):
22590  */
22591 
22592  /* function exit code */
22593  __pyx_r = 0;
22594  __Pyx_RefNannyFinishContext();
22595  return __pyx_r;
22596 }
22597 
22598 /* "View.MemoryView":283
22599  * def __init__(self, name):
22600  * self.name = name
22601  * def __repr__(self): # <<<<<<<<<<<<<<
22602  * return self.name
22603  *
22604  */
22605 
22606 /* Python wrapper */
22607 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
22608 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
22609  PyObject *__pyx_r = 0;
22610  __Pyx_RefNannyDeclarations
22611  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
22612  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
22613 
22614  /* function exit code */
22615  __Pyx_RefNannyFinishContext();
22616  return __pyx_r;
22617 }
22618 
22619 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
22620  PyObject *__pyx_r = NULL;
22621  __Pyx_RefNannyDeclarations
22622  __Pyx_RefNannySetupContext("__repr__", 0);
22623 
22624  /* "View.MemoryView":284
22625  * self.name = name
22626  * def __repr__(self):
22627  * return self.name # <<<<<<<<<<<<<<
22628  *
22629  * cdef generic = Enum("<strided and direct or indirect>")
22630  */
22631  __Pyx_XDECREF(__pyx_r);
22632  __Pyx_INCREF(__pyx_v_self->name);
22633  __pyx_r = __pyx_v_self->name;
22634  goto __pyx_L0;
22635 
22636  /* "View.MemoryView":283
22637  * def __init__(self, name):
22638  * self.name = name
22639  * def __repr__(self): # <<<<<<<<<<<<<<
22640  * return self.name
22641  *
22642  */
22643 
22644  /* function exit code */
22645  __pyx_L0:;
22646  __Pyx_XGIVEREF(__pyx_r);
22647  __Pyx_RefNannyFinishContext();
22648  return __pyx_r;
22649 }
22650 
22651 /* "(tree fragment)":1
22652  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22653  * cdef tuple state
22654  * cdef object _dict
22655  */
22656 
22657 /* Python wrapper */
22658 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
22659 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
22660  PyObject *__pyx_r = 0;
22661  __Pyx_RefNannyDeclarations
22662  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
22663  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
22664 
22665  /* function exit code */
22666  __Pyx_RefNannyFinishContext();
22667  return __pyx_r;
22668 }
22669 
22670 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
22671  PyObject *__pyx_v_state = 0;
22672  PyObject *__pyx_v__dict = 0;
22673  int __pyx_v_use_setstate;
22674  PyObject *__pyx_r = NULL;
22675  __Pyx_RefNannyDeclarations
22676  PyObject *__pyx_t_1 = NULL;
22677  int __pyx_t_2;
22678  int __pyx_t_3;
22679  PyObject *__pyx_t_4 = NULL;
22680  PyObject *__pyx_t_5 = NULL;
22681  int __pyx_lineno = 0;
22682  const char *__pyx_filename = NULL;
22683  int __pyx_clineno = 0;
22684  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
22685 
22686  /* "(tree fragment)":5
22687  * cdef object _dict
22688  * cdef bint use_setstate
22689  * state = (self.name,) # <<<<<<<<<<<<<<
22690  * _dict = getattr(self, '__dict__', None)
22691  * if _dict is not None:
22692  */
22693  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
22694  __Pyx_GOTREF(__pyx_t_1);
22695  __Pyx_INCREF(__pyx_v_self->name);
22696  __Pyx_GIVEREF(__pyx_v_self->name);
22697  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
22698  __pyx_v_state = ((PyObject*)__pyx_t_1);
22699  __pyx_t_1 = 0;
22700 
22701  /* "(tree fragment)":6
22702  * cdef bint use_setstate
22703  * state = (self.name,)
22704  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
22705  * if _dict is not None:
22706  * state += (_dict,)
22707  */
22708  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
22709  __Pyx_GOTREF(__pyx_t_1);
22710  __pyx_v__dict = __pyx_t_1;
22711  __pyx_t_1 = 0;
22712 
22713  /* "(tree fragment)":7
22714  * state = (self.name,)
22715  * _dict = getattr(self, '__dict__', None)
22716  * if _dict is not None: # <<<<<<<<<<<<<<
22717  * state += (_dict,)
22718  * use_setstate = True
22719  */
22720  __pyx_t_2 = (__pyx_v__dict != Py_None);
22721  __pyx_t_3 = (__pyx_t_2 != 0);
22722  if (__pyx_t_3) {
22723 
22724  /* "(tree fragment)":8
22725  * _dict = getattr(self, '__dict__', None)
22726  * if _dict is not None:
22727  * state += (_dict,) # <<<<<<<<<<<<<<
22728  * use_setstate = True
22729  * else:
22730  */
22731  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
22732  __Pyx_GOTREF(__pyx_t_1);
22733  __Pyx_INCREF(__pyx_v__dict);
22734  __Pyx_GIVEREF(__pyx_v__dict);
22735  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
22736  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
22737  __Pyx_GOTREF(__pyx_t_4);
22738  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22739  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
22740  __pyx_t_4 = 0;
22741 
22742  /* "(tree fragment)":9
22743  * if _dict is not None:
22744  * state += (_dict,)
22745  * use_setstate = True # <<<<<<<<<<<<<<
22746  * else:
22747  * use_setstate = self.name is not None
22748  */
22749  __pyx_v_use_setstate = 1;
22750 
22751  /* "(tree fragment)":7
22752  * state = (self.name,)
22753  * _dict = getattr(self, '__dict__', None)
22754  * if _dict is not None: # <<<<<<<<<<<<<<
22755  * state += (_dict,)
22756  * use_setstate = True
22757  */
22758  goto __pyx_L3;
22759  }
22760 
22761  /* "(tree fragment)":11
22762  * use_setstate = True
22763  * else:
22764  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
22765  * if use_setstate:
22766  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
22767  */
22768  /*else*/ {
22769  __pyx_t_3 = (__pyx_v_self->name != Py_None);
22770  __pyx_v_use_setstate = __pyx_t_3;
22771  }
22772  __pyx_L3:;
22773 
22774  /* "(tree fragment)":12
22775  * else:
22776  * use_setstate = self.name is not None
22777  * if use_setstate: # <<<<<<<<<<<<<<
22778  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
22779  * else:
22780  */
22781  __pyx_t_3 = (__pyx_v_use_setstate != 0);
22782  if (__pyx_t_3) {
22783 
22784  /* "(tree fragment)":13
22785  * use_setstate = self.name is not None
22786  * if use_setstate:
22787  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
22788  * else:
22789  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
22790  */
22791  __Pyx_XDECREF(__pyx_r);
22792  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
22793  __Pyx_GOTREF(__pyx_t_4);
22794  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
22795  __Pyx_GOTREF(__pyx_t_1);
22796  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22797  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22798  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22799  __Pyx_INCREF(__pyx_int_184977713);
22800  __Pyx_GIVEREF(__pyx_int_184977713);
22801  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
22802  __Pyx_INCREF(Py_None);
22803  __Pyx_GIVEREF(Py_None);
22804  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
22805  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
22806  __Pyx_GOTREF(__pyx_t_5);
22807  __Pyx_GIVEREF(__pyx_t_4);
22808  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
22809  __Pyx_GIVEREF(__pyx_t_1);
22810  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
22811  __Pyx_INCREF(__pyx_v_state);
22812  __Pyx_GIVEREF(__pyx_v_state);
22813  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
22814  __pyx_t_4 = 0;
22815  __pyx_t_1 = 0;
22816  __pyx_r = __pyx_t_5;
22817  __pyx_t_5 = 0;
22818  goto __pyx_L0;
22819 
22820  /* "(tree fragment)":12
22821  * else:
22822  * use_setstate = self.name is not None
22823  * if use_setstate: # <<<<<<<<<<<<<<
22824  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
22825  * else:
22826  */
22827  }
22828 
22829  /* "(tree fragment)":15
22830  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
22831  * else:
22832  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
22833  * def __setstate_cython__(self, __pyx_state):
22834  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
22835  */
22836  /*else*/ {
22837  __Pyx_XDECREF(__pyx_r);
22838  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
22839  __Pyx_GOTREF(__pyx_t_5);
22840  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
22841  __Pyx_GOTREF(__pyx_t_1);
22842  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22843  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22844  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
22845  __Pyx_INCREF(__pyx_int_184977713);
22846  __Pyx_GIVEREF(__pyx_int_184977713);
22847  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
22848  __Pyx_INCREF(__pyx_v_state);
22849  __Pyx_GIVEREF(__pyx_v_state);
22850  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
22851  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
22852  __Pyx_GOTREF(__pyx_t_4);
22853  __Pyx_GIVEREF(__pyx_t_5);
22854  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
22855  __Pyx_GIVEREF(__pyx_t_1);
22856  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
22857  __pyx_t_5 = 0;
22858  __pyx_t_1 = 0;
22859  __pyx_r = __pyx_t_4;
22860  __pyx_t_4 = 0;
22861  goto __pyx_L0;
22862  }
22863 
22864  /* "(tree fragment)":1
22865  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22866  * cdef tuple state
22867  * cdef object _dict
22868  */
22869 
22870  /* function exit code */
22871  __pyx_L1_error:;
22872  __Pyx_XDECREF(__pyx_t_1);
22873  __Pyx_XDECREF(__pyx_t_4);
22874  __Pyx_XDECREF(__pyx_t_5);
22875  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22876  __pyx_r = NULL;
22877  __pyx_L0:;
22878  __Pyx_XDECREF(__pyx_v_state);
22879  __Pyx_XDECREF(__pyx_v__dict);
22880  __Pyx_XGIVEREF(__pyx_r);
22881  __Pyx_RefNannyFinishContext();
22882  return __pyx_r;
22883 }
22884 
22885 /* "(tree fragment)":16
22886  * else:
22887  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
22888  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22889  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
22890  */
22891 
22892 /* Python wrapper */
22893 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
22894 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
22895  PyObject *__pyx_r = 0;
22896  __Pyx_RefNannyDeclarations
22897  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
22898  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
22899 
22900  /* function exit code */
22901  __Pyx_RefNannyFinishContext();
22902  return __pyx_r;
22903 }
22904 
22905 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
22906  PyObject *__pyx_r = NULL;
22907  __Pyx_RefNannyDeclarations
22908  PyObject *__pyx_t_1 = NULL;
22909  int __pyx_lineno = 0;
22910  const char *__pyx_filename = NULL;
22911  int __pyx_clineno = 0;
22912  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
22913 
22914  /* "(tree fragment)":17
22915  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
22916  * def __setstate_cython__(self, __pyx_state):
22917  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
22918  */
22919  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
22920  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
22921  __Pyx_GOTREF(__pyx_t_1);
22922  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22923 
22924  /* "(tree fragment)":16
22925  * else:
22926  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
22927  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22928  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
22929  */
22930 
22931  /* function exit code */
22932  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22933  goto __pyx_L0;
22934  __pyx_L1_error:;
22935  __Pyx_XDECREF(__pyx_t_1);
22936  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22937  __pyx_r = NULL;
22938  __pyx_L0:;
22939  __Pyx_XGIVEREF(__pyx_r);
22940  __Pyx_RefNannyFinishContext();
22941  return __pyx_r;
22942 }
22943 
22944 /* "View.MemoryView":298
22945  *
22946  * @cname('__pyx_align_pointer')
22947  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
22948  * "Align pointer memory on a given boundary"
22949  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
22950  */
22951 
22952 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
22953  Py_intptr_t __pyx_v_aligned_p;
22954  size_t __pyx_v_offset;
22955  void *__pyx_r;
22956  int __pyx_t_1;
22957 
22958  /* "View.MemoryView":300
22959  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
22960  * "Align pointer memory on a given boundary"
22961  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
22962  * cdef size_t offset
22963  *
22964  */
22965  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
22966 
22967  /* "View.MemoryView":304
22968  *
22969  * with cython.cdivision(True):
22970  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
22971  *
22972  * if offset > 0:
22973  */
22974  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
22975 
22976  /* "View.MemoryView":306
22977  * offset = aligned_p % alignment
22978  *
22979  * if offset > 0: # <<<<<<<<<<<<<<
22980  * aligned_p += alignment - offset
22981  *
22982  */
22983  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
22984  if (__pyx_t_1) {
22985 
22986  /* "View.MemoryView":307
22987  *
22988  * if offset > 0:
22989  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
22990  *
22991  * return <void *> aligned_p
22992  */
22993  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
22994 
22995  /* "View.MemoryView":306
22996  * offset = aligned_p % alignment
22997  *
22998  * if offset > 0: # <<<<<<<<<<<<<<
22999  * aligned_p += alignment - offset
23000  *
23001  */
23002  }
23003 
23004  /* "View.MemoryView":309
23005  * aligned_p += alignment - offset
23006  *
23007  * return <void *> aligned_p # <<<<<<<<<<<<<<
23008  *
23009  *
23010  */
23011  __pyx_r = ((void *)__pyx_v_aligned_p);
23012  goto __pyx_L0;
23013 
23014  /* "View.MemoryView":298
23015  *
23016  * @cname('__pyx_align_pointer')
23017  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
23018  * "Align pointer memory on a given boundary"
23019  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
23020  */
23021 
23022  /* function exit code */
23023  __pyx_L0:;
23024  return __pyx_r;
23025 }
23026 
23027 /* "View.MemoryView":345
23028  * cdef __Pyx_TypeInfo *typeinfo
23029  *
23030  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
23031  * self.obj = obj
23032  * self.flags = flags
23033  */
23034 
23035 /* Python wrapper */
23036 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
23037 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23038  PyObject *__pyx_v_obj = 0;
23039  int __pyx_v_flags;
23040  int __pyx_v_dtype_is_object;
23041  int __pyx_lineno = 0;
23042  const char *__pyx_filename = NULL;
23043  int __pyx_clineno = 0;
23044  int __pyx_r;
23045  __Pyx_RefNannyDeclarations
23046  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
23047  {
23048  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
23049  PyObject* values[3] = {0,0,0};
23050  if (unlikely(__pyx_kwds)) {
23051  Py_ssize_t kw_args;
23052  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
23053  switch (pos_args) {
23054  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
23055  CYTHON_FALLTHROUGH;
23056  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
23057  CYTHON_FALLTHROUGH;
23058  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23059  CYTHON_FALLTHROUGH;
23060  case 0: break;
23061  default: goto __pyx_L5_argtuple_error;
23062  }
23063  kw_args = PyDict_Size(__pyx_kwds);
23064  switch (pos_args) {
23065  case 0:
23066  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
23067  else goto __pyx_L5_argtuple_error;
23068  CYTHON_FALLTHROUGH;
23069  case 1:
23070  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
23071  else {
23072  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
23073  }
23074  CYTHON_FALLTHROUGH;
23075  case 2:
23076  if (kw_args > 0) {
23077  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
23078  if (value) { values[2] = value; kw_args--; }
23079  }
23080  }
23081  if (unlikely(kw_args > 0)) {
23082  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
23083  }
23084  } else {
23085  switch (PyTuple_GET_SIZE(__pyx_args)) {
23086  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
23087  CYTHON_FALLTHROUGH;
23088  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
23089  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23090  break;
23091  default: goto __pyx_L5_argtuple_error;
23092  }
23093  }
23094  __pyx_v_obj = values[0];
23095  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
23096  if (values[2]) {
23097  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
23098  } else {
23099  __pyx_v_dtype_is_object = ((int)0);
23100  }
23101  }
23102  goto __pyx_L4_argument_unpacking_done;
23103  __pyx_L5_argtuple_error:;
23104  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
23105  __pyx_L3_error:;
23106  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23107  __Pyx_RefNannyFinishContext();
23108  return -1;
23109  __pyx_L4_argument_unpacking_done:;
23110  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
23111 
23112  /* function exit code */
23113  __Pyx_RefNannyFinishContext();
23114  return __pyx_r;
23115 }
23116 
23117 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) {
23118  int __pyx_r;
23119  __Pyx_RefNannyDeclarations
23120  int __pyx_t_1;
23121  int __pyx_t_2;
23122  int __pyx_t_3;
23123  int __pyx_t_4;
23124  int __pyx_lineno = 0;
23125  const char *__pyx_filename = NULL;
23126  int __pyx_clineno = 0;
23127  __Pyx_RefNannySetupContext("__cinit__", 0);
23128 
23129  /* "View.MemoryView":346
23130  *
23131  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
23132  * self.obj = obj # <<<<<<<<<<<<<<
23133  * self.flags = flags
23134  * if type(self) is memoryview or obj is not None:
23135  */
23136  __Pyx_INCREF(__pyx_v_obj);
23137  __Pyx_GIVEREF(__pyx_v_obj);
23138  __Pyx_GOTREF(__pyx_v_self->obj);
23139  __Pyx_DECREF(__pyx_v_self->obj);
23140  __pyx_v_self->obj = __pyx_v_obj;
23141 
23142  /* "View.MemoryView":347
23143  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
23144  * self.obj = obj
23145  * self.flags = flags # <<<<<<<<<<<<<<
23146  * if type(self) is memoryview or obj is not None:
23147  * __Pyx_GetBuffer(obj, &self.view, flags)
23148  */
23149  __pyx_v_self->flags = __pyx_v_flags;
23150 
23151  /* "View.MemoryView":348
23152  * self.obj = obj
23153  * self.flags = flags
23154  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
23155  * __Pyx_GetBuffer(obj, &self.view, flags)
23156  * if <PyObject *> self.view.obj == NULL:
23157  */
23158  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
23159  __pyx_t_3 = (__pyx_t_2 != 0);
23160  if (!__pyx_t_3) {
23161  } else {
23162  __pyx_t_1 = __pyx_t_3;
23163  goto __pyx_L4_bool_binop_done;
23164  }
23165  __pyx_t_3 = (__pyx_v_obj != Py_None);
23166  __pyx_t_2 = (__pyx_t_3 != 0);
23167  __pyx_t_1 = __pyx_t_2;
23168  __pyx_L4_bool_binop_done:;
23169  if (__pyx_t_1) {
23170 
23171  /* "View.MemoryView":349
23172  * self.flags = flags
23173  * if type(self) is memoryview or obj is not None:
23174  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
23175  * if <PyObject *> self.view.obj == NULL:
23176  * (<__pyx_buffer *> &self.view).obj = Py_None
23177  */
23178  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
23179 
23180  /* "View.MemoryView":350
23181  * if type(self) is memoryview or obj is not None:
23182  * __Pyx_GetBuffer(obj, &self.view, flags)
23183  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
23184  * (<__pyx_buffer *> &self.view).obj = Py_None
23185  * Py_INCREF(Py_None)
23186  */
23187  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
23188  if (__pyx_t_1) {
23189 
23190  /* "View.MemoryView":351
23191  * __Pyx_GetBuffer(obj, &self.view, flags)
23192  * if <PyObject *> self.view.obj == NULL:
23193  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
23194  * Py_INCREF(Py_None)
23195  *
23196  */
23197  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
23198 
23199  /* "View.MemoryView":352
23200  * if <PyObject *> self.view.obj == NULL:
23201  * (<__pyx_buffer *> &self.view).obj = Py_None
23202  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
23203  *
23204  * global __pyx_memoryview_thread_locks_used
23205  */
23206  Py_INCREF(Py_None);
23207 
23208  /* "View.MemoryView":350
23209  * if type(self) is memoryview or obj is not None:
23210  * __Pyx_GetBuffer(obj, &self.view, flags)
23211  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
23212  * (<__pyx_buffer *> &self.view).obj = Py_None
23213  * Py_INCREF(Py_None)
23214  */
23215  }
23216 
23217  /* "View.MemoryView":348
23218  * self.obj = obj
23219  * self.flags = flags
23220  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
23221  * __Pyx_GetBuffer(obj, &self.view, flags)
23222  * if <PyObject *> self.view.obj == NULL:
23223  */
23224  }
23225 
23226  /* "View.MemoryView":355
23227  *
23228  * global __pyx_memoryview_thread_locks_used
23229  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
23230  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
23231  * __pyx_memoryview_thread_locks_used += 1
23232  */
23233  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
23234  if (__pyx_t_1) {
23235 
23236  /* "View.MemoryView":356
23237  * global __pyx_memoryview_thread_locks_used
23238  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
23239  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
23240  * __pyx_memoryview_thread_locks_used += 1
23241  * if self.lock is NULL:
23242  */
23243  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
23244 
23245  /* "View.MemoryView":357
23246  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
23247  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
23248  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
23249  * if self.lock is NULL:
23250  * self.lock = PyThread_allocate_lock()
23251  */
23252  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
23253 
23254  /* "View.MemoryView":355
23255  *
23256  * global __pyx_memoryview_thread_locks_used
23257  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
23258  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
23259  * __pyx_memoryview_thread_locks_used += 1
23260  */
23261  }
23262 
23263  /* "View.MemoryView":358
23264  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
23265  * __pyx_memoryview_thread_locks_used += 1
23266  * if self.lock is NULL: # <<<<<<<<<<<<<<
23267  * self.lock = PyThread_allocate_lock()
23268  * if self.lock is NULL:
23269  */
23270  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
23271  if (__pyx_t_1) {
23272 
23273  /* "View.MemoryView":359
23274  * __pyx_memoryview_thread_locks_used += 1
23275  * if self.lock is NULL:
23276  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
23277  * if self.lock is NULL:
23278  * raise MemoryError
23279  */
23280  __pyx_v_self->lock = PyThread_allocate_lock();
23281 
23282  /* "View.MemoryView":360
23283  * if self.lock is NULL:
23284  * self.lock = PyThread_allocate_lock()
23285  * if self.lock is NULL: # <<<<<<<<<<<<<<
23286  * raise MemoryError
23287  *
23288  */
23289  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
23290  if (unlikely(__pyx_t_1)) {
23291 
23292  /* "View.MemoryView":361
23293  * self.lock = PyThread_allocate_lock()
23294  * if self.lock is NULL:
23295  * raise MemoryError # <<<<<<<<<<<<<<
23296  *
23297  * if flags & PyBUF_FORMAT:
23298  */
23299  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
23300 
23301  /* "View.MemoryView":360
23302  * if self.lock is NULL:
23303  * self.lock = PyThread_allocate_lock()
23304  * if self.lock is NULL: # <<<<<<<<<<<<<<
23305  * raise MemoryError
23306  *
23307  */
23308  }
23309 
23310  /* "View.MemoryView":358
23311  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
23312  * __pyx_memoryview_thread_locks_used += 1
23313  * if self.lock is NULL: # <<<<<<<<<<<<<<
23314  * self.lock = PyThread_allocate_lock()
23315  * if self.lock is NULL:
23316  */
23317  }
23318 
23319  /* "View.MemoryView":363
23320  * raise MemoryError
23321  *
23322  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
23323  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
23324  * else:
23325  */
23326  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
23327  if (__pyx_t_1) {
23328 
23329  /* "View.MemoryView":364
23330  *
23331  * if flags & PyBUF_FORMAT:
23332  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
23333  * else:
23334  * self.dtype_is_object = dtype_is_object
23335  */
23336  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
23337  if (__pyx_t_2) {
23338  } else {
23339  __pyx_t_1 = __pyx_t_2;
23340  goto __pyx_L11_bool_binop_done;
23341  }
23342  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
23343  __pyx_t_1 = __pyx_t_2;
23344  __pyx_L11_bool_binop_done:;
23345  __pyx_v_self->dtype_is_object = __pyx_t_1;
23346 
23347  /* "View.MemoryView":363
23348  * raise MemoryError
23349  *
23350  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
23351  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
23352  * else:
23353  */
23354  goto __pyx_L10;
23355  }
23356 
23357  /* "View.MemoryView":366
23358  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
23359  * else:
23360  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
23361  *
23362  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
23363  */
23364  /*else*/ {
23365  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
23366  }
23367  __pyx_L10:;
23368 
23369  /* "View.MemoryView":368
23370  * self.dtype_is_object = dtype_is_object
23371  *
23372  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
23373  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
23374  * self.typeinfo = NULL
23375  */
23376  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
23377 
23378  /* "View.MemoryView":370
23379  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
23380  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
23381  * self.typeinfo = NULL # <<<<<<<<<<<<<<
23382  *
23383  * def __dealloc__(memoryview self):
23384  */
23385  __pyx_v_self->typeinfo = NULL;
23386 
23387  /* "View.MemoryView":345
23388  * cdef __Pyx_TypeInfo *typeinfo
23389  *
23390  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
23391  * self.obj = obj
23392  * self.flags = flags
23393  */
23394 
23395  /* function exit code */
23396  __pyx_r = 0;
23397  goto __pyx_L0;
23398  __pyx_L1_error:;
23399  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23400  __pyx_r = -1;
23401  __pyx_L0:;
23402  __Pyx_RefNannyFinishContext();
23403  return __pyx_r;
23404 }
23405 
23406 /* "View.MemoryView":372
23407  * self.typeinfo = NULL
23408  *
23409  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
23410  * if self.obj is not None:
23411  * __Pyx_ReleaseBuffer(&self.view)
23412  */
23413 
23414 /* Python wrapper */
23415 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
23416 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
23417  __Pyx_RefNannyDeclarations
23418  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
23419  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
23420 
23421  /* function exit code */
23422  __Pyx_RefNannyFinishContext();
23423 }
23424 
23425 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
23426  int __pyx_v_i;
23427  __Pyx_RefNannyDeclarations
23428  int __pyx_t_1;
23429  int __pyx_t_2;
23430  int __pyx_t_3;
23431  int __pyx_t_4;
23432  int __pyx_t_5;
23433  PyThread_type_lock __pyx_t_6;
23434  PyThread_type_lock __pyx_t_7;
23435  __Pyx_RefNannySetupContext("__dealloc__", 0);
23436 
23437  /* "View.MemoryView":373
23438  *
23439  * def __dealloc__(memoryview self):
23440  * if self.obj is not None: # <<<<<<<<<<<<<<
23441  * __Pyx_ReleaseBuffer(&self.view)
23442  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
23443  */
23444  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
23445  __pyx_t_2 = (__pyx_t_1 != 0);
23446  if (__pyx_t_2) {
23447 
23448  /* "View.MemoryView":374
23449  * def __dealloc__(memoryview self):
23450  * if self.obj is not None:
23451  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
23452  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
23453  *
23454  */
23455  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
23456 
23457  /* "View.MemoryView":373
23458  *
23459  * def __dealloc__(memoryview self):
23460  * if self.obj is not None: # <<<<<<<<<<<<<<
23461  * __Pyx_ReleaseBuffer(&self.view)
23462  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
23463  */
23464  goto __pyx_L3;
23465  }
23466 
23467  /* "View.MemoryView":375
23468  * if self.obj is not None:
23469  * __Pyx_ReleaseBuffer(&self.view)
23470  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
23471  *
23472  * (<__pyx_buffer *> &self.view).obj = NULL
23473  */
23474  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
23475  if (__pyx_t_2) {
23476 
23477  /* "View.MemoryView":377
23478  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
23479  *
23480  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
23481  * Py_DECREF(Py_None)
23482  *
23483  */
23484  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
23485 
23486  /* "View.MemoryView":378
23487  *
23488  * (<__pyx_buffer *> &self.view).obj = NULL
23489  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
23490  *
23491  * cdef int i
23492  */
23493  Py_DECREF(Py_None);
23494 
23495  /* "View.MemoryView":375
23496  * if self.obj is not None:
23497  * __Pyx_ReleaseBuffer(&self.view)
23498  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
23499  *
23500  * (<__pyx_buffer *> &self.view).obj = NULL
23501  */
23502  }
23503  __pyx_L3:;
23504 
23505  /* "View.MemoryView":382
23506  * cdef int i
23507  * global __pyx_memoryview_thread_locks_used
23508  * if self.lock != NULL: # <<<<<<<<<<<<<<
23509  * for i in range(__pyx_memoryview_thread_locks_used):
23510  * if __pyx_memoryview_thread_locks[i] is self.lock:
23511  */
23512  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
23513  if (__pyx_t_2) {
23514 
23515  /* "View.MemoryView":383
23516  * global __pyx_memoryview_thread_locks_used
23517  * if self.lock != NULL:
23518  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
23519  * if __pyx_memoryview_thread_locks[i] is self.lock:
23520  * __pyx_memoryview_thread_locks_used -= 1
23521  */
23522  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
23523  __pyx_t_4 = __pyx_t_3;
23524  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
23525  __pyx_v_i = __pyx_t_5;
23526 
23527  /* "View.MemoryView":384
23528  * if self.lock != NULL:
23529  * for i in range(__pyx_memoryview_thread_locks_used):
23530  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
23531  * __pyx_memoryview_thread_locks_used -= 1
23532  * if i != __pyx_memoryview_thread_locks_used:
23533  */
23534  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
23535  if (__pyx_t_2) {
23536 
23537  /* "View.MemoryView":385
23538  * for i in range(__pyx_memoryview_thread_locks_used):
23539  * if __pyx_memoryview_thread_locks[i] is self.lock:
23540  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
23541  * if i != __pyx_memoryview_thread_locks_used:
23542  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
23543  */
23544  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
23545 
23546  /* "View.MemoryView":386
23547  * if __pyx_memoryview_thread_locks[i] is self.lock:
23548  * __pyx_memoryview_thread_locks_used -= 1
23549  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
23550  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
23551  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
23552  */
23553  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
23554  if (__pyx_t_2) {
23555 
23556  /* "View.MemoryView":388
23557  * if i != __pyx_memoryview_thread_locks_used:
23558  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
23559  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
23560  * break
23561  * else:
23562  */
23563  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
23564  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
23565 
23566  /* "View.MemoryView":387
23567  * __pyx_memoryview_thread_locks_used -= 1
23568  * if i != __pyx_memoryview_thread_locks_used:
23569  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
23570  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
23571  * break
23572  */
23573  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
23574  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
23575 
23576  /* "View.MemoryView":386
23577  * if __pyx_memoryview_thread_locks[i] is self.lock:
23578  * __pyx_memoryview_thread_locks_used -= 1
23579  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
23580  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
23581  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
23582  */
23583  }
23584 
23585  /* "View.MemoryView":389
23586  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
23587  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
23588  * break # <<<<<<<<<<<<<<
23589  * else:
23590  * PyThread_free_lock(self.lock)
23591  */
23592  goto __pyx_L6_break;
23593 
23594  /* "View.MemoryView":384
23595  * if self.lock != NULL:
23596  * for i in range(__pyx_memoryview_thread_locks_used):
23597  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
23598  * __pyx_memoryview_thread_locks_used -= 1
23599  * if i != __pyx_memoryview_thread_locks_used:
23600  */
23601  }
23602  }
23603  /*else*/ {
23604 
23605  /* "View.MemoryView":391
23606  * break
23607  * else:
23608  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
23609  *
23610  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
23611  */
23612  PyThread_free_lock(__pyx_v_self->lock);
23613  }
23614  __pyx_L6_break:;
23615 
23616  /* "View.MemoryView":382
23617  * cdef int i
23618  * global __pyx_memoryview_thread_locks_used
23619  * if self.lock != NULL: # <<<<<<<<<<<<<<
23620  * for i in range(__pyx_memoryview_thread_locks_used):
23621  * if __pyx_memoryview_thread_locks[i] is self.lock:
23622  */
23623  }
23624 
23625  /* "View.MemoryView":372
23626  * self.typeinfo = NULL
23627  *
23628  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
23629  * if self.obj is not None:
23630  * __Pyx_ReleaseBuffer(&self.view)
23631  */
23632 
23633  /* function exit code */
23634  __Pyx_RefNannyFinishContext();
23635 }
23636 
23637 /* "View.MemoryView":393
23638  * PyThread_free_lock(self.lock)
23639  *
23640  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
23641  * cdef Py_ssize_t dim
23642  * cdef char *itemp = <char *> self.view.buf
23643  */
23644 
23645 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
23646  Py_ssize_t __pyx_v_dim;
23647  char *__pyx_v_itemp;
23648  PyObject *__pyx_v_idx = NULL;
23649  char *__pyx_r;
23650  __Pyx_RefNannyDeclarations
23651  Py_ssize_t __pyx_t_1;
23652  PyObject *__pyx_t_2 = NULL;
23653  Py_ssize_t __pyx_t_3;
23654  PyObject *(*__pyx_t_4)(PyObject *);
23655  PyObject *__pyx_t_5 = NULL;
23656  Py_ssize_t __pyx_t_6;
23657  char *__pyx_t_7;
23658  int __pyx_lineno = 0;
23659  const char *__pyx_filename = NULL;
23660  int __pyx_clineno = 0;
23661  __Pyx_RefNannySetupContext("get_item_pointer", 0);
23662 
23663  /* "View.MemoryView":395
23664  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
23665  * cdef Py_ssize_t dim
23666  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
23667  *
23668  * for dim, idx in enumerate(index):
23669  */
23670  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
23671 
23672  /* "View.MemoryView":397
23673  * cdef char *itemp = <char *> self.view.buf
23674  *
23675  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
23676  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
23677  *
23678  */
23679  __pyx_t_1 = 0;
23680  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
23681  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
23682  __pyx_t_4 = NULL;
23683  } else {
23684  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
23685  __Pyx_GOTREF(__pyx_t_2);
23686  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
23687  }
23688  for (;;) {
23689  if (likely(!__pyx_t_4)) {
23690  if (likely(PyList_CheckExact(__pyx_t_2))) {
23691  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
23692  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23693  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
23694  #else
23695  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
23696  __Pyx_GOTREF(__pyx_t_5);
23697  #endif
23698  } else {
23699  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
23700  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23701  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
23702  #else
23703  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
23704  __Pyx_GOTREF(__pyx_t_5);
23705  #endif
23706  }
23707  } else {
23708  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
23709  if (unlikely(!__pyx_t_5)) {
23710  PyObject* exc_type = PyErr_Occurred();
23711  if (exc_type) {
23712  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
23713  else __PYX_ERR(1, 397, __pyx_L1_error)
23714  }
23715  break;
23716  }
23717  __Pyx_GOTREF(__pyx_t_5);
23718  }
23719  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
23720  __pyx_t_5 = 0;
23721  __pyx_v_dim = __pyx_t_1;
23722  __pyx_t_1 = (__pyx_t_1 + 1);
23723 
23724  /* "View.MemoryView":398
23725  *
23726  * for dim, idx in enumerate(index):
23727  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
23728  *
23729  * return itemp
23730  */
23731  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
23732  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
23733  __pyx_v_itemp = __pyx_t_7;
23734 
23735  /* "View.MemoryView":397
23736  * cdef char *itemp = <char *> self.view.buf
23737  *
23738  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
23739  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
23740  *
23741  */
23742  }
23743  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23744 
23745  /* "View.MemoryView":400
23746  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
23747  *
23748  * return itemp # <<<<<<<<<<<<<<
23749  *
23750  *
23751  */
23752  __pyx_r = __pyx_v_itemp;
23753  goto __pyx_L0;
23754 
23755  /* "View.MemoryView":393
23756  * PyThread_free_lock(self.lock)
23757  *
23758  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
23759  * cdef Py_ssize_t dim
23760  * cdef char *itemp = <char *> self.view.buf
23761  */
23762 
23763  /* function exit code */
23764  __pyx_L1_error:;
23765  __Pyx_XDECREF(__pyx_t_2);
23766  __Pyx_XDECREF(__pyx_t_5);
23767  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
23768  __pyx_r = NULL;
23769  __pyx_L0:;
23770  __Pyx_XDECREF(__pyx_v_idx);
23771  __Pyx_RefNannyFinishContext();
23772  return __pyx_r;
23773 }
23774 
23775 /* "View.MemoryView":403
23776  *
23777  *
23778  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
23779  * if index is Ellipsis:
23780  * return self
23781  */
23782 
23783 /* Python wrapper */
23784 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
23785 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
23786  PyObject *__pyx_r = 0;
23787  __Pyx_RefNannyDeclarations
23788  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
23789  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
23790 
23791  /* function exit code */
23792  __Pyx_RefNannyFinishContext();
23793  return __pyx_r;
23794 }
23795 
23796 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
23797  PyObject *__pyx_v_have_slices = NULL;
23798  PyObject *__pyx_v_indices = NULL;
23799  char *__pyx_v_itemp;
23800  PyObject *__pyx_r = NULL;
23801  __Pyx_RefNannyDeclarations
23802  int __pyx_t_1;
23803  int __pyx_t_2;
23804  PyObject *__pyx_t_3 = NULL;
23805  PyObject *__pyx_t_4 = NULL;
23806  PyObject *__pyx_t_5 = NULL;
23807  char *__pyx_t_6;
23808  int __pyx_lineno = 0;
23809  const char *__pyx_filename = NULL;
23810  int __pyx_clineno = 0;
23811  __Pyx_RefNannySetupContext("__getitem__", 0);
23812 
23813  /* "View.MemoryView":404
23814  *
23815  * def __getitem__(memoryview self, object index):
23816  * if index is Ellipsis: # <<<<<<<<<<<<<<
23817  * return self
23818  *
23819  */
23820  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
23821  __pyx_t_2 = (__pyx_t_1 != 0);
23822  if (__pyx_t_2) {
23823 
23824  /* "View.MemoryView":405
23825  * def __getitem__(memoryview self, object index):
23826  * if index is Ellipsis:
23827  * return self # <<<<<<<<<<<<<<
23828  *
23829  * have_slices, indices = _unellipsify(index, self.view.ndim)
23830  */
23831  __Pyx_XDECREF(__pyx_r);
23832  __Pyx_INCREF(((PyObject *)__pyx_v_self));
23833  __pyx_r = ((PyObject *)__pyx_v_self);
23834  goto __pyx_L0;
23835 
23836  /* "View.MemoryView":404
23837  *
23838  * def __getitem__(memoryview self, object index):
23839  * if index is Ellipsis: # <<<<<<<<<<<<<<
23840  * return self
23841  *
23842  */
23843  }
23844 
23845  /* "View.MemoryView":407
23846  * return self
23847  *
23848  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
23849  *
23850  * cdef char *itemp
23851  */
23852  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
23853  __Pyx_GOTREF(__pyx_t_3);
23854  if (likely(__pyx_t_3 != Py_None)) {
23855  PyObject* sequence = __pyx_t_3;
23856  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
23857  if (unlikely(size != 2)) {
23858  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
23859  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
23860  __PYX_ERR(1, 407, __pyx_L1_error)
23861  }
23862  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23863  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
23864  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
23865  __Pyx_INCREF(__pyx_t_4);
23866  __Pyx_INCREF(__pyx_t_5);
23867  #else
23868  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
23869  __Pyx_GOTREF(__pyx_t_4);
23870  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
23871  __Pyx_GOTREF(__pyx_t_5);
23872  #endif
23873  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23874  } else {
23875  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
23876  }
23877  __pyx_v_have_slices = __pyx_t_4;
23878  __pyx_t_4 = 0;
23879  __pyx_v_indices = __pyx_t_5;
23880  __pyx_t_5 = 0;
23881 
23882  /* "View.MemoryView":410
23883  *
23884  * cdef char *itemp
23885  * if have_slices: # <<<<<<<<<<<<<<
23886  * return memview_slice(self, indices)
23887  * else:
23888  */
23889  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
23890  if (__pyx_t_2) {
23891 
23892  /* "View.MemoryView":411
23893  * cdef char *itemp
23894  * if have_slices:
23895  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
23896  * else:
23897  * itemp = self.get_item_pointer(indices)
23898  */
23899  __Pyx_XDECREF(__pyx_r);
23900  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
23901  __Pyx_GOTREF(__pyx_t_3);
23902  __pyx_r = __pyx_t_3;
23903  __pyx_t_3 = 0;
23904  goto __pyx_L0;
23905 
23906  /* "View.MemoryView":410
23907  *
23908  * cdef char *itemp
23909  * if have_slices: # <<<<<<<<<<<<<<
23910  * return memview_slice(self, indices)
23911  * else:
23912  */
23913  }
23914 
23915  /* "View.MemoryView":413
23916  * return memview_slice(self, indices)
23917  * else:
23918  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
23919  * return self.convert_item_to_object(itemp)
23920  *
23921  */
23922  /*else*/ {
23923  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
23924  __pyx_v_itemp = __pyx_t_6;
23925 
23926  /* "View.MemoryView":414
23927  * else:
23928  * itemp = self.get_item_pointer(indices)
23929  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
23930  *
23931  * def __setitem__(memoryview self, object index, object value):
23932  */
23933  __Pyx_XDECREF(__pyx_r);
23934  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
23935  __Pyx_GOTREF(__pyx_t_3);
23936  __pyx_r = __pyx_t_3;
23937  __pyx_t_3 = 0;
23938  goto __pyx_L0;
23939  }
23940 
23941  /* "View.MemoryView":403
23942  *
23943  *
23944  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
23945  * if index is Ellipsis:
23946  * return self
23947  */
23948 
23949  /* function exit code */
23950  __pyx_L1_error:;
23951  __Pyx_XDECREF(__pyx_t_3);
23952  __Pyx_XDECREF(__pyx_t_4);
23953  __Pyx_XDECREF(__pyx_t_5);
23954  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23955  __pyx_r = NULL;
23956  __pyx_L0:;
23957  __Pyx_XDECREF(__pyx_v_have_slices);
23958  __Pyx_XDECREF(__pyx_v_indices);
23959  __Pyx_XGIVEREF(__pyx_r);
23960  __Pyx_RefNannyFinishContext();
23961  return __pyx_r;
23962 }
23963 
23964 /* "View.MemoryView":416
23965  * return self.convert_item_to_object(itemp)
23966  *
23967  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
23968  * if self.view.readonly:
23969  * raise TypeError("Cannot assign to read-only memoryview")
23970  */
23971 
23972 /* Python wrapper */
23973 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
23974 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
23975  int __pyx_r;
23976  __Pyx_RefNannyDeclarations
23977  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
23978  __pyx_r = __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));
23979 
23980  /* function exit code */
23981  __Pyx_RefNannyFinishContext();
23982  return __pyx_r;
23983 }
23984 
23985 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) {
23986  PyObject *__pyx_v_have_slices = NULL;
23987  PyObject *__pyx_v_obj = NULL;
23988  int __pyx_r;
23989  __Pyx_RefNannyDeclarations
23990  int __pyx_t_1;
23991  PyObject *__pyx_t_2 = NULL;
23992  PyObject *__pyx_t_3 = NULL;
23993  PyObject *__pyx_t_4 = NULL;
23994  int __pyx_lineno = 0;
23995  const char *__pyx_filename = NULL;
23996  int __pyx_clineno = 0;
23997  __Pyx_RefNannySetupContext("__setitem__", 0);
23998  __Pyx_INCREF(__pyx_v_index);
23999 
24000  /* "View.MemoryView":417
24001  *
24002  * def __setitem__(memoryview self, object index, object value):
24003  * if self.view.readonly: # <<<<<<<<<<<<<<
24004  * raise TypeError("Cannot assign to read-only memoryview")
24005  *
24006  */
24007  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
24008  if (unlikely(__pyx_t_1)) {
24009 
24010  /* "View.MemoryView":418
24011  * def __setitem__(memoryview self, object index, object value):
24012  * if self.view.readonly:
24013  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
24014  *
24015  * have_slices, index = _unellipsify(index, self.view.ndim)
24016  */
24017  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
24018  __Pyx_GOTREF(__pyx_t_2);
24019  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
24020  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24021  __PYX_ERR(1, 418, __pyx_L1_error)
24022 
24023  /* "View.MemoryView":417
24024  *
24025  * def __setitem__(memoryview self, object index, object value):
24026  * if self.view.readonly: # <<<<<<<<<<<<<<
24027  * raise TypeError("Cannot assign to read-only memoryview")
24028  *
24029  */
24030  }
24031 
24032  /* "View.MemoryView":420
24033  * raise TypeError("Cannot assign to read-only memoryview")
24034  *
24035  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
24036  *
24037  * if have_slices:
24038  */
24039  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
24040  __Pyx_GOTREF(__pyx_t_2);
24041  if (likely(__pyx_t_2 != Py_None)) {
24042  PyObject* sequence = __pyx_t_2;
24043  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
24044  if (unlikely(size != 2)) {
24045  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
24046  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
24047  __PYX_ERR(1, 420, __pyx_L1_error)
24048  }
24049  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24050  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
24051  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
24052  __Pyx_INCREF(__pyx_t_3);
24053  __Pyx_INCREF(__pyx_t_4);
24054  #else
24055  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
24056  __Pyx_GOTREF(__pyx_t_3);
24057  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
24058  __Pyx_GOTREF(__pyx_t_4);
24059  #endif
24060  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24061  } else {
24062  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
24063  }
24064  __pyx_v_have_slices = __pyx_t_3;
24065  __pyx_t_3 = 0;
24066  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
24067  __pyx_t_4 = 0;
24068 
24069  /* "View.MemoryView":422
24070  * have_slices, index = _unellipsify(index, self.view.ndim)
24071  *
24072  * if have_slices: # <<<<<<<<<<<<<<
24073  * obj = self.is_slice(value)
24074  * if obj:
24075  */
24076  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
24077  if (__pyx_t_1) {
24078 
24079  /* "View.MemoryView":423
24080  *
24081  * if have_slices:
24082  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
24083  * if obj:
24084  * self.setitem_slice_assignment(self[index], obj)
24085  */
24086  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
24087  __Pyx_GOTREF(__pyx_t_2);
24088  __pyx_v_obj = __pyx_t_2;
24089  __pyx_t_2 = 0;
24090 
24091  /* "View.MemoryView":424
24092  * if have_slices:
24093  * obj = self.is_slice(value)
24094  * if obj: # <<<<<<<<<<<<<<
24095  * self.setitem_slice_assignment(self[index], obj)
24096  * else:
24097  */
24098  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
24099  if (__pyx_t_1) {
24100 
24101  /* "View.MemoryView":425
24102  * obj = self.is_slice(value)
24103  * if obj:
24104  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
24105  * else:
24106  * self.setitem_slice_assign_scalar(self[index], value)
24107  */
24108  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
24109  __Pyx_GOTREF(__pyx_t_2);
24110  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
24111  __Pyx_GOTREF(__pyx_t_4);
24112  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24113  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24114 
24115  /* "View.MemoryView":424
24116  * if have_slices:
24117  * obj = self.is_slice(value)
24118  * if obj: # <<<<<<<<<<<<<<
24119  * self.setitem_slice_assignment(self[index], obj)
24120  * else:
24121  */
24122  goto __pyx_L5;
24123  }
24124 
24125  /* "View.MemoryView":427
24126  * self.setitem_slice_assignment(self[index], obj)
24127  * else:
24128  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
24129  * else:
24130  * self.setitem_indexed(index, value)
24131  */
24132  /*else*/ {
24133  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
24134  __Pyx_GOTREF(__pyx_t_4);
24135  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
24136  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
24137  __Pyx_GOTREF(__pyx_t_2);
24138  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24139  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24140  }
24141  __pyx_L5:;
24142 
24143  /* "View.MemoryView":422
24144  * have_slices, index = _unellipsify(index, self.view.ndim)
24145  *
24146  * if have_slices: # <<<<<<<<<<<<<<
24147  * obj = self.is_slice(value)
24148  * if obj:
24149  */
24150  goto __pyx_L4;
24151  }
24152 
24153  /* "View.MemoryView":429
24154  * self.setitem_slice_assign_scalar(self[index], value)
24155  * else:
24156  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
24157  *
24158  * cdef is_slice(self, obj):
24159  */
24160  /*else*/ {
24161  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
24162  __Pyx_GOTREF(__pyx_t_2);
24163  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24164  }
24165  __pyx_L4:;
24166 
24167  /* "View.MemoryView":416
24168  * return self.convert_item_to_object(itemp)
24169  *
24170  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
24171  * if self.view.readonly:
24172  * raise TypeError("Cannot assign to read-only memoryview")
24173  */
24174 
24175  /* function exit code */
24176  __pyx_r = 0;
24177  goto __pyx_L0;
24178  __pyx_L1_error:;
24179  __Pyx_XDECREF(__pyx_t_2);
24180  __Pyx_XDECREF(__pyx_t_3);
24181  __Pyx_XDECREF(__pyx_t_4);
24182  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24183  __pyx_r = -1;
24184  __pyx_L0:;
24185  __Pyx_XDECREF(__pyx_v_have_slices);
24186  __Pyx_XDECREF(__pyx_v_obj);
24187  __Pyx_XDECREF(__pyx_v_index);
24188  __Pyx_RefNannyFinishContext();
24189  return __pyx_r;
24190 }
24191 
24192 /* "View.MemoryView":431
24193  * self.setitem_indexed(index, value)
24194  *
24195  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
24196  * if not isinstance(obj, memoryview):
24197  * try:
24198  */
24199 
24200 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
24201  PyObject *__pyx_r = NULL;
24202  __Pyx_RefNannyDeclarations
24203  int __pyx_t_1;
24204  int __pyx_t_2;
24205  PyObject *__pyx_t_3 = NULL;
24206  PyObject *__pyx_t_4 = NULL;
24207  PyObject *__pyx_t_5 = NULL;
24208  PyObject *__pyx_t_6 = NULL;
24209  PyObject *__pyx_t_7 = NULL;
24210  PyObject *__pyx_t_8 = NULL;
24211  int __pyx_t_9;
24212  int __pyx_lineno = 0;
24213  const char *__pyx_filename = NULL;
24214  int __pyx_clineno = 0;
24215  __Pyx_RefNannySetupContext("is_slice", 0);
24216  __Pyx_INCREF(__pyx_v_obj);
24217 
24218  /* "View.MemoryView":432
24219  *
24220  * cdef is_slice(self, obj):
24221  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
24222  * try:
24223  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
24224  */
24225  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
24226  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
24227  if (__pyx_t_2) {
24228 
24229  /* "View.MemoryView":433
24230  * cdef is_slice(self, obj):
24231  * if not isinstance(obj, memoryview):
24232  * try: # <<<<<<<<<<<<<<
24233  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
24234  * self.dtype_is_object)
24235  */
24236  {
24237  __Pyx_PyThreadState_declare
24238  __Pyx_PyThreadState_assign
24239  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
24240  __Pyx_XGOTREF(__pyx_t_3);
24241  __Pyx_XGOTREF(__pyx_t_4);
24242  __Pyx_XGOTREF(__pyx_t_5);
24243  /*try:*/ {
24244 
24245  /* "View.MemoryView":434
24246  * if not isinstance(obj, memoryview):
24247  * try:
24248  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
24249  * self.dtype_is_object)
24250  * except TypeError:
24251  */
24252  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
24253  __Pyx_GOTREF(__pyx_t_6);
24254 
24255  /* "View.MemoryView":435
24256  * try:
24257  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
24258  * self.dtype_is_object) # <<<<<<<<<<<<<<
24259  * except TypeError:
24260  * return None
24261  */
24262  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
24263  __Pyx_GOTREF(__pyx_t_7);
24264 
24265  /* "View.MemoryView":434
24266  * if not isinstance(obj, memoryview):
24267  * try:
24268  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
24269  * self.dtype_is_object)
24270  * except TypeError:
24271  */
24272  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
24273  __Pyx_GOTREF(__pyx_t_8);
24274  __Pyx_INCREF(__pyx_v_obj);
24275  __Pyx_GIVEREF(__pyx_v_obj);
24276  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
24277  __Pyx_GIVEREF(__pyx_t_6);
24278  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
24279  __Pyx_GIVEREF(__pyx_t_7);
24280  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
24281  __pyx_t_6 = 0;
24282  __pyx_t_7 = 0;
24283  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
24284  __Pyx_GOTREF(__pyx_t_7);
24285  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24286  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
24287  __pyx_t_7 = 0;
24288 
24289  /* "View.MemoryView":433
24290  * cdef is_slice(self, obj):
24291  * if not isinstance(obj, memoryview):
24292  * try: # <<<<<<<<<<<<<<
24293  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
24294  * self.dtype_is_object)
24295  */
24296  }
24297  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24298  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24299  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24300  goto __pyx_L9_try_end;
24301  __pyx_L4_error:;
24302  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
24303  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
24304  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
24305 
24306  /* "View.MemoryView":436
24307  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
24308  * self.dtype_is_object)
24309  * except TypeError: # <<<<<<<<<<<<<<
24310  * return None
24311  *
24312  */
24313  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
24314  if (__pyx_t_9) {
24315  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
24316  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
24317  __Pyx_GOTREF(__pyx_t_7);
24318  __Pyx_GOTREF(__pyx_t_8);
24319  __Pyx_GOTREF(__pyx_t_6);
24320 
24321  /* "View.MemoryView":437
24322  * self.dtype_is_object)
24323  * except TypeError:
24324  * return None # <<<<<<<<<<<<<<
24325  *
24326  * return obj
24327  */
24328  __Pyx_XDECREF(__pyx_r);
24329  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24330  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24331  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24332  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24333  goto __pyx_L7_except_return;
24334  }
24335  goto __pyx_L6_except_error;
24336  __pyx_L6_except_error:;
24337 
24338  /* "View.MemoryView":433
24339  * cdef is_slice(self, obj):
24340  * if not isinstance(obj, memoryview):
24341  * try: # <<<<<<<<<<<<<<
24342  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
24343  * self.dtype_is_object)
24344  */
24345  __Pyx_XGIVEREF(__pyx_t_3);
24346  __Pyx_XGIVEREF(__pyx_t_4);
24347  __Pyx_XGIVEREF(__pyx_t_5);
24348  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
24349  goto __pyx_L1_error;
24350  __pyx_L7_except_return:;
24351  __Pyx_XGIVEREF(__pyx_t_3);
24352  __Pyx_XGIVEREF(__pyx_t_4);
24353  __Pyx_XGIVEREF(__pyx_t_5);
24354  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
24355  goto __pyx_L0;
24356  __pyx_L9_try_end:;
24357  }
24358 
24359  /* "View.MemoryView":432
24360  *
24361  * cdef is_slice(self, obj):
24362  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
24363  * try:
24364  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
24365  */
24366  }
24367 
24368  /* "View.MemoryView":439
24369  * return None
24370  *
24371  * return obj # <<<<<<<<<<<<<<
24372  *
24373  * cdef setitem_slice_assignment(self, dst, src):
24374  */
24375  __Pyx_XDECREF(__pyx_r);
24376  __Pyx_INCREF(__pyx_v_obj);
24377  __pyx_r = __pyx_v_obj;
24378  goto __pyx_L0;
24379 
24380  /* "View.MemoryView":431
24381  * self.setitem_indexed(index, value)
24382  *
24383  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
24384  * if not isinstance(obj, memoryview):
24385  * try:
24386  */
24387 
24388  /* function exit code */
24389  __pyx_L1_error:;
24390  __Pyx_XDECREF(__pyx_t_6);
24391  __Pyx_XDECREF(__pyx_t_7);
24392  __Pyx_XDECREF(__pyx_t_8);
24393  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
24394  __pyx_r = 0;
24395  __pyx_L0:;
24396  __Pyx_XDECREF(__pyx_v_obj);
24397  __Pyx_XGIVEREF(__pyx_r);
24398  __Pyx_RefNannyFinishContext();
24399  return __pyx_r;
24400 }
24401 
24402 /* "View.MemoryView":441
24403  * return obj
24404  *
24405  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
24406  * cdef __Pyx_memviewslice dst_slice
24407  * cdef __Pyx_memviewslice src_slice
24408  */
24409 
24410 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
24411  __Pyx_memviewslice __pyx_v_dst_slice;
24412  __Pyx_memviewslice __pyx_v_src_slice;
24413  PyObject *__pyx_r = NULL;
24414  __Pyx_RefNannyDeclarations
24415  __Pyx_memviewslice *__pyx_t_1;
24416  __Pyx_memviewslice *__pyx_t_2;
24417  PyObject *__pyx_t_3 = NULL;
24418  int __pyx_t_4;
24419  int __pyx_t_5;
24420  int __pyx_t_6;
24421  int __pyx_lineno = 0;
24422  const char *__pyx_filename = NULL;
24423  int __pyx_clineno = 0;
24424  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
24425 
24426  /* "View.MemoryView":445
24427  * cdef __Pyx_memviewslice src_slice
24428  *
24429  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
24430  * get_slice_from_memview(dst, &dst_slice)[0],
24431  * src.ndim, dst.ndim, self.dtype_is_object)
24432  */
24433  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
24434  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
24435 
24436  /* "View.MemoryView":446
24437  *
24438  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
24439  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
24440  * src.ndim, dst.ndim, self.dtype_is_object)
24441  *
24442  */
24443  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
24444  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
24445 
24446  /* "View.MemoryView":447
24447  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
24448  * get_slice_from_memview(dst, &dst_slice)[0],
24449  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
24450  *
24451  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
24452  */
24453  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
24454  __Pyx_GOTREF(__pyx_t_3);
24455  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
24456  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24457  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
24458  __Pyx_GOTREF(__pyx_t_3);
24459  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
24460  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24461 
24462  /* "View.MemoryView":445
24463  * cdef __Pyx_memviewslice src_slice
24464  *
24465  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
24466  * get_slice_from_memview(dst, &dst_slice)[0],
24467  * src.ndim, dst.ndim, self.dtype_is_object)
24468  */
24469  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
24470 
24471  /* "View.MemoryView":441
24472  * return obj
24473  *
24474  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
24475  * cdef __Pyx_memviewslice dst_slice
24476  * cdef __Pyx_memviewslice src_slice
24477  */
24478 
24479  /* function exit code */
24480  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24481  goto __pyx_L0;
24482  __pyx_L1_error:;
24483  __Pyx_XDECREF(__pyx_t_3);
24484  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
24485  __pyx_r = 0;
24486  __pyx_L0:;
24487  __Pyx_XGIVEREF(__pyx_r);
24488  __Pyx_RefNannyFinishContext();
24489  return __pyx_r;
24490 }
24491 
24492 /* "View.MemoryView":449
24493  * src.ndim, dst.ndim, self.dtype_is_object)
24494  *
24495  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
24496  * cdef int array[128]
24497  * cdef void *tmp = NULL
24498  */
24499 
24500 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) {
24501  int __pyx_v_array[0x80];
24502  void *__pyx_v_tmp;
24503  void *__pyx_v_item;
24504  __Pyx_memviewslice *__pyx_v_dst_slice;
24505  __Pyx_memviewslice __pyx_v_tmp_slice;
24506  PyObject *__pyx_r = NULL;
24507  __Pyx_RefNannyDeclarations
24508  __Pyx_memviewslice *__pyx_t_1;
24509  int __pyx_t_2;
24510  PyObject *__pyx_t_3 = NULL;
24511  int __pyx_t_4;
24512  int __pyx_t_5;
24513  char const *__pyx_t_6;
24514  PyObject *__pyx_t_7 = NULL;
24515  PyObject *__pyx_t_8 = NULL;
24516  PyObject *__pyx_t_9 = NULL;
24517  PyObject *__pyx_t_10 = NULL;
24518  PyObject *__pyx_t_11 = NULL;
24519  PyObject *__pyx_t_12 = NULL;
24520  int __pyx_lineno = 0;
24521  const char *__pyx_filename = NULL;
24522  int __pyx_clineno = 0;
24523  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
24524 
24525  /* "View.MemoryView":451
24526  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
24527  * cdef int array[128]
24528  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
24529  * cdef void *item
24530  *
24531  */
24532  __pyx_v_tmp = NULL;
24533 
24534  /* "View.MemoryView":456
24535  * cdef __Pyx_memviewslice *dst_slice
24536  * cdef __Pyx_memviewslice tmp_slice
24537  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
24538  *
24539  * if <size_t>self.view.itemsize > sizeof(array):
24540  */
24541  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
24542  __pyx_v_dst_slice = __pyx_t_1;
24543 
24544  /* "View.MemoryView":458
24545  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
24546  *
24547  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
24548  * tmp = PyMem_Malloc(self.view.itemsize)
24549  * if tmp == NULL:
24550  */
24551  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
24552  if (__pyx_t_2) {
24553 
24554  /* "View.MemoryView":459
24555  *
24556  * if <size_t>self.view.itemsize > sizeof(array):
24557  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
24558  * if tmp == NULL:
24559  * raise MemoryError
24560  */
24561  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
24562 
24563  /* "View.MemoryView":460
24564  * if <size_t>self.view.itemsize > sizeof(array):
24565  * tmp = PyMem_Malloc(self.view.itemsize)
24566  * if tmp == NULL: # <<<<<<<<<<<<<<
24567  * raise MemoryError
24568  * item = tmp
24569  */
24570  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
24571  if (unlikely(__pyx_t_2)) {
24572 
24573  /* "View.MemoryView":461
24574  * tmp = PyMem_Malloc(self.view.itemsize)
24575  * if tmp == NULL:
24576  * raise MemoryError # <<<<<<<<<<<<<<
24577  * item = tmp
24578  * else:
24579  */
24580  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
24581 
24582  /* "View.MemoryView":460
24583  * if <size_t>self.view.itemsize > sizeof(array):
24584  * tmp = PyMem_Malloc(self.view.itemsize)
24585  * if tmp == NULL: # <<<<<<<<<<<<<<
24586  * raise MemoryError
24587  * item = tmp
24588  */
24589  }
24590 
24591  /* "View.MemoryView":462
24592  * if tmp == NULL:
24593  * raise MemoryError
24594  * item = tmp # <<<<<<<<<<<<<<
24595  * else:
24596  * item = <void *> array
24597  */
24598  __pyx_v_item = __pyx_v_tmp;
24599 
24600  /* "View.MemoryView":458
24601  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
24602  *
24603  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
24604  * tmp = PyMem_Malloc(self.view.itemsize)
24605  * if tmp == NULL:
24606  */
24607  goto __pyx_L3;
24608  }
24609 
24610  /* "View.MemoryView":464
24611  * item = tmp
24612  * else:
24613  * item = <void *> array # <<<<<<<<<<<<<<
24614  *
24615  * try:
24616  */
24617  /*else*/ {
24618  __pyx_v_item = ((void *)__pyx_v_array);
24619  }
24620  __pyx_L3:;
24621 
24622  /* "View.MemoryView":466
24623  * item = <void *> array
24624  *
24625  * try: # <<<<<<<<<<<<<<
24626  * if self.dtype_is_object:
24627  * (<PyObject **> item)[0] = <PyObject *> value
24628  */
24629  /*try:*/ {
24630 
24631  /* "View.MemoryView":467
24632  *
24633  * try:
24634  * if self.dtype_is_object: # <<<<<<<<<<<<<<
24635  * (<PyObject **> item)[0] = <PyObject *> value
24636  * else:
24637  */
24638  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
24639  if (__pyx_t_2) {
24640 
24641  /* "View.MemoryView":468
24642  * try:
24643  * if self.dtype_is_object:
24644  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
24645  * else:
24646  * self.assign_item_from_object(<char *> item, value)
24647  */
24648  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
24649 
24650  /* "View.MemoryView":467
24651  *
24652  * try:
24653  * if self.dtype_is_object: # <<<<<<<<<<<<<<
24654  * (<PyObject **> item)[0] = <PyObject *> value
24655  * else:
24656  */
24657  goto __pyx_L8;
24658  }
24659 
24660  /* "View.MemoryView":470
24661  * (<PyObject **> item)[0] = <PyObject *> value
24662  * else:
24663  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
24664  *
24665  *
24666  */
24667  /*else*/ {
24668  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
24669  __Pyx_GOTREF(__pyx_t_3);
24670  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24671  }
24672  __pyx_L8:;
24673 
24674  /* "View.MemoryView":474
24675  *
24676  *
24677  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
24678  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
24679  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
24680  */
24681  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
24682  if (__pyx_t_2) {
24683 
24684  /* "View.MemoryView":475
24685  *
24686  * if self.view.suboffsets != NULL:
24687  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
24688  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
24689  * item, self.dtype_is_object)
24690  */
24691  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
24692  __Pyx_GOTREF(__pyx_t_3);
24693  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24694 
24695  /* "View.MemoryView":474
24696  *
24697  *
24698  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
24699  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
24700  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
24701  */
24702  }
24703 
24704  /* "View.MemoryView":476
24705  * if self.view.suboffsets != NULL:
24706  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
24707  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
24708  * item, self.dtype_is_object)
24709  * finally:
24710  */
24711  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
24712  }
24713 
24714  /* "View.MemoryView":479
24715  * item, self.dtype_is_object)
24716  * finally:
24717  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
24718  *
24719  * cdef setitem_indexed(self, index, value):
24720  */
24721  /*finally:*/ {
24722  /*normal exit:*/{
24723  PyMem_Free(__pyx_v_tmp);
24724  goto __pyx_L7;
24725  }
24726  __pyx_L6_error:;
24727  /*exception exit:*/{
24728  __Pyx_PyThreadState_declare
24729  __Pyx_PyThreadState_assign
24730  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
24731  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24732  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
24733  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
24734  __Pyx_XGOTREF(__pyx_t_7);
24735  __Pyx_XGOTREF(__pyx_t_8);
24736  __Pyx_XGOTREF(__pyx_t_9);
24737  __Pyx_XGOTREF(__pyx_t_10);
24738  __Pyx_XGOTREF(__pyx_t_11);
24739  __Pyx_XGOTREF(__pyx_t_12);
24740  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
24741  {
24742  PyMem_Free(__pyx_v_tmp);
24743  }
24744  if (PY_MAJOR_VERSION >= 3) {
24745  __Pyx_XGIVEREF(__pyx_t_10);
24746  __Pyx_XGIVEREF(__pyx_t_11);
24747  __Pyx_XGIVEREF(__pyx_t_12);
24748  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
24749  }
24750  __Pyx_XGIVEREF(__pyx_t_7);
24751  __Pyx_XGIVEREF(__pyx_t_8);
24752  __Pyx_XGIVEREF(__pyx_t_9);
24753  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
24754  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
24755  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
24756  goto __pyx_L1_error;
24757  }
24758  __pyx_L7:;
24759  }
24760 
24761  /* "View.MemoryView":449
24762  * src.ndim, dst.ndim, self.dtype_is_object)
24763  *
24764  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
24765  * cdef int array[128]
24766  * cdef void *tmp = NULL
24767  */
24768 
24769  /* function exit code */
24770  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24771  goto __pyx_L0;
24772  __pyx_L1_error:;
24773  __Pyx_XDECREF(__pyx_t_3);
24774  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
24775  __pyx_r = 0;
24776  __pyx_L0:;
24777  __Pyx_XGIVEREF(__pyx_r);
24778  __Pyx_RefNannyFinishContext();
24779  return __pyx_r;
24780 }
24781 
24782 /* "View.MemoryView":481
24783  * PyMem_Free(tmp)
24784  *
24785  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
24786  * cdef char *itemp = self.get_item_pointer(index)
24787  * self.assign_item_from_object(itemp, value)
24788  */
24789 
24790 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
24791  char *__pyx_v_itemp;
24792  PyObject *__pyx_r = NULL;
24793  __Pyx_RefNannyDeclarations
24794  char *__pyx_t_1;
24795  PyObject *__pyx_t_2 = NULL;
24796  int __pyx_lineno = 0;
24797  const char *__pyx_filename = NULL;
24798  int __pyx_clineno = 0;
24799  __Pyx_RefNannySetupContext("setitem_indexed", 0);
24800 
24801  /* "View.MemoryView":482
24802  *
24803  * cdef setitem_indexed(self, index, value):
24804  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
24805  * self.assign_item_from_object(itemp, value)
24806  *
24807  */
24808  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
24809  __pyx_v_itemp = __pyx_t_1;
24810 
24811  /* "View.MemoryView":483
24812  * cdef setitem_indexed(self, index, value):
24813  * cdef char *itemp = self.get_item_pointer(index)
24814  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
24815  *
24816  * cdef convert_item_to_object(self, char *itemp):
24817  */
24818  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
24819  __Pyx_GOTREF(__pyx_t_2);
24820  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24821 
24822  /* "View.MemoryView":481
24823  * PyMem_Free(tmp)
24824  *
24825  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
24826  * cdef char *itemp = self.get_item_pointer(index)
24827  * self.assign_item_from_object(itemp, value)
24828  */
24829 
24830  /* function exit code */
24831  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24832  goto __pyx_L0;
24833  __pyx_L1_error:;
24834  __Pyx_XDECREF(__pyx_t_2);
24835  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
24836  __pyx_r = 0;
24837  __pyx_L0:;
24838  __Pyx_XGIVEREF(__pyx_r);
24839  __Pyx_RefNannyFinishContext();
24840  return __pyx_r;
24841 }
24842 
24843 /* "View.MemoryView":485
24844  * self.assign_item_from_object(itemp, value)
24845  *
24846  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
24847  * """Only used if instantiated manually by the user, or if Cython doesn't
24848  * know how to convert the type"""
24849  */
24850 
24851 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
24852  PyObject *__pyx_v_struct = NULL;
24853  PyObject *__pyx_v_bytesitem = 0;
24854  PyObject *__pyx_v_result = NULL;
24855  PyObject *__pyx_r = NULL;
24856  __Pyx_RefNannyDeclarations
24857  PyObject *__pyx_t_1 = NULL;
24858  PyObject *__pyx_t_2 = NULL;
24859  PyObject *__pyx_t_3 = NULL;
24860  PyObject *__pyx_t_4 = NULL;
24861  PyObject *__pyx_t_5 = NULL;
24862  PyObject *__pyx_t_6 = NULL;
24863  PyObject *__pyx_t_7 = NULL;
24864  int __pyx_t_8;
24865  PyObject *__pyx_t_9 = NULL;
24866  size_t __pyx_t_10;
24867  int __pyx_t_11;
24868  int __pyx_lineno = 0;
24869  const char *__pyx_filename = NULL;
24870  int __pyx_clineno = 0;
24871  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
24872 
24873  /* "View.MemoryView":488
24874  * """Only used if instantiated manually by the user, or if Cython doesn't
24875  * know how to convert the type"""
24876  * import struct # <<<<<<<<<<<<<<
24877  * cdef bytes bytesitem
24878  *
24879  */
24880  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
24881  __Pyx_GOTREF(__pyx_t_1);
24882  __pyx_v_struct = __pyx_t_1;
24883  __pyx_t_1 = 0;
24884 
24885  /* "View.MemoryView":491
24886  * cdef bytes bytesitem
24887  *
24888  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
24889  * try:
24890  * result = struct.unpack(self.view.format, bytesitem)
24891  */
24892  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
24893  __Pyx_GOTREF(__pyx_t_1);
24894  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
24895  __pyx_t_1 = 0;
24896 
24897  /* "View.MemoryView":492
24898  *
24899  * bytesitem = itemp[:self.view.itemsize]
24900  * try: # <<<<<<<<<<<<<<
24901  * result = struct.unpack(self.view.format, bytesitem)
24902  * except struct.error:
24903  */
24904  {
24905  __Pyx_PyThreadState_declare
24906  __Pyx_PyThreadState_assign
24907  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
24908  __Pyx_XGOTREF(__pyx_t_2);
24909  __Pyx_XGOTREF(__pyx_t_3);
24910  __Pyx_XGOTREF(__pyx_t_4);
24911  /*try:*/ {
24912 
24913  /* "View.MemoryView":493
24914  * bytesitem = itemp[:self.view.itemsize]
24915  * try:
24916  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
24917  * except struct.error:
24918  * raise ValueError("Unable to convert item to object")
24919  */
24920  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
24921  __Pyx_GOTREF(__pyx_t_5);
24922  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
24923  __Pyx_GOTREF(__pyx_t_6);
24924  __pyx_t_7 = NULL;
24925  __pyx_t_8 = 0;
24926  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
24927  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
24928  if (likely(__pyx_t_7)) {
24929  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
24930  __Pyx_INCREF(__pyx_t_7);
24931  __Pyx_INCREF(function);
24932  __Pyx_DECREF_SET(__pyx_t_5, function);
24933  __pyx_t_8 = 1;
24934  }
24935  }
24936  #if CYTHON_FAST_PYCALL
24937  if (PyFunction_Check(__pyx_t_5)) {
24938  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
24939  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
24940  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
24941  __Pyx_GOTREF(__pyx_t_1);
24942  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24943  } else
24944  #endif
24945  #if CYTHON_FAST_PYCCALL
24946  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
24947  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
24948  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
24949  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
24950  __Pyx_GOTREF(__pyx_t_1);
24951  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24952  } else
24953  #endif
24954  {
24955  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
24956  __Pyx_GOTREF(__pyx_t_9);
24957  if (__pyx_t_7) {
24958  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
24959  }
24960  __Pyx_GIVEREF(__pyx_t_6);
24961  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
24962  __Pyx_INCREF(__pyx_v_bytesitem);
24963  __Pyx_GIVEREF(__pyx_v_bytesitem);
24964  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
24965  __pyx_t_6 = 0;
24966  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
24967  __Pyx_GOTREF(__pyx_t_1);
24968  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24969  }
24970  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24971  __pyx_v_result = __pyx_t_1;
24972  __pyx_t_1 = 0;
24973 
24974  /* "View.MemoryView":492
24975  *
24976  * bytesitem = itemp[:self.view.itemsize]
24977  * try: # <<<<<<<<<<<<<<
24978  * result = struct.unpack(self.view.format, bytesitem)
24979  * except struct.error:
24980  */
24981  }
24982 
24983  /* "View.MemoryView":497
24984  * raise ValueError("Unable to convert item to object")
24985  * else:
24986  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
24987  * return result[0]
24988  * return result
24989  */
24990  /*else:*/ {
24991  __pyx_t_10 = strlen(__pyx_v_self->view.format);
24992  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
24993  if (__pyx_t_11) {
24994 
24995  /* "View.MemoryView":498
24996  * else:
24997  * if len(self.view.format) == 1:
24998  * return result[0] # <<<<<<<<<<<<<<
24999  * return result
25000  *
25001  */
25002  __Pyx_XDECREF(__pyx_r);
25003  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
25004  __Pyx_GOTREF(__pyx_t_1);
25005  __pyx_r = __pyx_t_1;
25006  __pyx_t_1 = 0;
25007  goto __pyx_L6_except_return;
25008 
25009  /* "View.MemoryView":497
25010  * raise ValueError("Unable to convert item to object")
25011  * else:
25012  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
25013  * return result[0]
25014  * return result
25015  */
25016  }
25017 
25018  /* "View.MemoryView":499
25019  * if len(self.view.format) == 1:
25020  * return result[0]
25021  * return result # <<<<<<<<<<<<<<
25022  *
25023  * cdef assign_item_from_object(self, char *itemp, object value):
25024  */
25025  __Pyx_XDECREF(__pyx_r);
25026  __Pyx_INCREF(__pyx_v_result);
25027  __pyx_r = __pyx_v_result;
25028  goto __pyx_L6_except_return;
25029  }
25030  __pyx_L3_error:;
25031  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
25032  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25033  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
25034  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
25035  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
25036 
25037  /* "View.MemoryView":494
25038  * try:
25039  * result = struct.unpack(self.view.format, bytesitem)
25040  * except struct.error: # <<<<<<<<<<<<<<
25041  * raise ValueError("Unable to convert item to object")
25042  * else:
25043  */
25044  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
25045  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
25046  __Pyx_GOTREF(__pyx_t_6);
25047  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
25048  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25049  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
25050  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
25051  if (__pyx_t_8) {
25052  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
25053  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
25054  __Pyx_GOTREF(__pyx_t_9);
25055  __Pyx_GOTREF(__pyx_t_5);
25056  __Pyx_GOTREF(__pyx_t_1);
25057 
25058  /* "View.MemoryView":495
25059  * result = struct.unpack(self.view.format, bytesitem)
25060  * except struct.error:
25061  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
25062  * else:
25063  * if len(self.view.format) == 1:
25064  */
25065  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
25066  __Pyx_GOTREF(__pyx_t_6);
25067  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
25068  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25069  __PYX_ERR(1, 495, __pyx_L5_except_error)
25070  }
25071  goto __pyx_L5_except_error;
25072  __pyx_L5_except_error:;
25073 
25074  /* "View.MemoryView":492
25075  *
25076  * bytesitem = itemp[:self.view.itemsize]
25077  * try: # <<<<<<<<<<<<<<
25078  * result = struct.unpack(self.view.format, bytesitem)
25079  * except struct.error:
25080  */
25081  __Pyx_XGIVEREF(__pyx_t_2);
25082  __Pyx_XGIVEREF(__pyx_t_3);
25083  __Pyx_XGIVEREF(__pyx_t_4);
25084  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
25085  goto __pyx_L1_error;
25086  __pyx_L6_except_return:;
25087  __Pyx_XGIVEREF(__pyx_t_2);
25088  __Pyx_XGIVEREF(__pyx_t_3);
25089  __Pyx_XGIVEREF(__pyx_t_4);
25090  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
25091  goto __pyx_L0;
25092  }
25093 
25094  /* "View.MemoryView":485
25095  * self.assign_item_from_object(itemp, value)
25096  *
25097  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
25098  * """Only used if instantiated manually by the user, or if Cython doesn't
25099  * know how to convert the type"""
25100  */
25101 
25102  /* function exit code */
25103  __pyx_L1_error:;
25104  __Pyx_XDECREF(__pyx_t_1);
25105  __Pyx_XDECREF(__pyx_t_5);
25106  __Pyx_XDECREF(__pyx_t_6);
25107  __Pyx_XDECREF(__pyx_t_7);
25108  __Pyx_XDECREF(__pyx_t_9);
25109  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
25110  __pyx_r = 0;
25111  __pyx_L0:;
25112  __Pyx_XDECREF(__pyx_v_struct);
25113  __Pyx_XDECREF(__pyx_v_bytesitem);
25114  __Pyx_XDECREF(__pyx_v_result);
25115  __Pyx_XGIVEREF(__pyx_r);
25116  __Pyx_RefNannyFinishContext();
25117  return __pyx_r;
25118 }
25119 
25120 /* "View.MemoryView":501
25121  * return result
25122  *
25123  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
25124  * """Only used if instantiated manually by the user, or if Cython doesn't
25125  * know how to convert the type"""
25126  */
25127 
25128 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
25129  PyObject *__pyx_v_struct = NULL;
25130  char __pyx_v_c;
25131  PyObject *__pyx_v_bytesvalue = 0;
25132  Py_ssize_t __pyx_v_i;
25133  PyObject *__pyx_r = NULL;
25134  __Pyx_RefNannyDeclarations
25135  PyObject *__pyx_t_1 = NULL;
25136  int __pyx_t_2;
25137  int __pyx_t_3;
25138  PyObject *__pyx_t_4 = NULL;
25139  PyObject *__pyx_t_5 = NULL;
25140  PyObject *__pyx_t_6 = NULL;
25141  int __pyx_t_7;
25142  PyObject *__pyx_t_8 = NULL;
25143  Py_ssize_t __pyx_t_9;
25144  PyObject *__pyx_t_10 = NULL;
25145  char *__pyx_t_11;
25146  char *__pyx_t_12;
25147  char *__pyx_t_13;
25148  char *__pyx_t_14;
25149  int __pyx_lineno = 0;
25150  const char *__pyx_filename = NULL;
25151  int __pyx_clineno = 0;
25152  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
25153 
25154  /* "View.MemoryView":504
25155  * """Only used if instantiated manually by the user, or if Cython doesn't
25156  * know how to convert the type"""
25157  * import struct # <<<<<<<<<<<<<<
25158  * cdef char c
25159  * cdef bytes bytesvalue
25160  */
25161  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
25162  __Pyx_GOTREF(__pyx_t_1);
25163  __pyx_v_struct = __pyx_t_1;
25164  __pyx_t_1 = 0;
25165 
25166  /* "View.MemoryView":509
25167  * cdef Py_ssize_t i
25168  *
25169  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
25170  * bytesvalue = struct.pack(self.view.format, *value)
25171  * else:
25172  */
25173  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
25174  __pyx_t_3 = (__pyx_t_2 != 0);
25175  if (__pyx_t_3) {
25176 
25177  /* "View.MemoryView":510
25178  *
25179  * if isinstance(value, tuple):
25180  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
25181  * else:
25182  * bytesvalue = struct.pack(self.view.format, value)
25183  */
25184  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
25185  __Pyx_GOTREF(__pyx_t_1);
25186  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
25187  __Pyx_GOTREF(__pyx_t_4);
25188  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
25189  __Pyx_GOTREF(__pyx_t_5);
25190  __Pyx_GIVEREF(__pyx_t_4);
25191  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
25192  __pyx_t_4 = 0;
25193  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
25194  __Pyx_GOTREF(__pyx_t_4);
25195  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
25196  __Pyx_GOTREF(__pyx_t_6);
25197  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25198  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25199  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
25200  __Pyx_GOTREF(__pyx_t_4);
25201  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25202  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25203  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
25204  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
25205  __pyx_t_4 = 0;
25206 
25207  /* "View.MemoryView":509
25208  * cdef Py_ssize_t i
25209  *
25210  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
25211  * bytesvalue = struct.pack(self.view.format, *value)
25212  * else:
25213  */
25214  goto __pyx_L3;
25215  }
25216 
25217  /* "View.MemoryView":512
25218  * bytesvalue = struct.pack(self.view.format, *value)
25219  * else:
25220  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
25221  *
25222  * for i, c in enumerate(bytesvalue):
25223  */
25224  /*else*/ {
25225  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
25226  __Pyx_GOTREF(__pyx_t_6);
25227  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
25228  __Pyx_GOTREF(__pyx_t_1);
25229  __pyx_t_5 = NULL;
25230  __pyx_t_7 = 0;
25231  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
25232  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
25233  if (likely(__pyx_t_5)) {
25234  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
25235  __Pyx_INCREF(__pyx_t_5);
25236  __Pyx_INCREF(function);
25237  __Pyx_DECREF_SET(__pyx_t_6, function);
25238  __pyx_t_7 = 1;
25239  }
25240  }
25241  #if CYTHON_FAST_PYCALL
25242  if (PyFunction_Check(__pyx_t_6)) {
25243  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
25244  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
25245  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25246  __Pyx_GOTREF(__pyx_t_4);
25247  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25248  } else
25249  #endif
25250  #if CYTHON_FAST_PYCCALL
25251  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
25252  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
25253  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
25254  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25255  __Pyx_GOTREF(__pyx_t_4);
25256  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25257  } else
25258  #endif
25259  {
25260  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
25261  __Pyx_GOTREF(__pyx_t_8);
25262  if (__pyx_t_5) {
25263  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
25264  }
25265  __Pyx_GIVEREF(__pyx_t_1);
25266  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
25267  __Pyx_INCREF(__pyx_v_value);
25268  __Pyx_GIVEREF(__pyx_v_value);
25269  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
25270  __pyx_t_1 = 0;
25271  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
25272  __Pyx_GOTREF(__pyx_t_4);
25273  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
25274  }
25275  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25276  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
25277  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
25278  __pyx_t_4 = 0;
25279  }
25280  __pyx_L3:;
25281 
25282  /* "View.MemoryView":514
25283  * bytesvalue = struct.pack(self.view.format, value)
25284  *
25285  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
25286  * itemp[i] = c
25287  *
25288  */
25289  __pyx_t_9 = 0;
25290  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
25291  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
25292  __PYX_ERR(1, 514, __pyx_L1_error)
25293  }
25294  __Pyx_INCREF(__pyx_v_bytesvalue);
25295  __pyx_t_10 = __pyx_v_bytesvalue;
25296  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
25297  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
25298  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
25299  __pyx_t_11 = __pyx_t_14;
25300  __pyx_v_c = (__pyx_t_11[0]);
25301 
25302  /* "View.MemoryView":515
25303  *
25304  * for i, c in enumerate(bytesvalue):
25305  * itemp[i] = c # <<<<<<<<<<<<<<
25306  *
25307  * @cname('getbuffer')
25308  */
25309  __pyx_v_i = __pyx_t_9;
25310 
25311  /* "View.MemoryView":514
25312  * bytesvalue = struct.pack(self.view.format, value)
25313  *
25314  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
25315  * itemp[i] = c
25316  *
25317  */
25318  __pyx_t_9 = (__pyx_t_9 + 1);
25319 
25320  /* "View.MemoryView":515
25321  *
25322  * for i, c in enumerate(bytesvalue):
25323  * itemp[i] = c # <<<<<<<<<<<<<<
25324  *
25325  * @cname('getbuffer')
25326  */
25327  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
25328  }
25329  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25330 
25331  /* "View.MemoryView":501
25332  * return result
25333  *
25334  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
25335  * """Only used if instantiated manually by the user, or if Cython doesn't
25336  * know how to convert the type"""
25337  */
25338 
25339  /* function exit code */
25340  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25341  goto __pyx_L0;
25342  __pyx_L1_error:;
25343  __Pyx_XDECREF(__pyx_t_1);
25344  __Pyx_XDECREF(__pyx_t_4);
25345  __Pyx_XDECREF(__pyx_t_5);
25346  __Pyx_XDECREF(__pyx_t_6);
25347  __Pyx_XDECREF(__pyx_t_8);
25348  __Pyx_XDECREF(__pyx_t_10);
25349  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
25350  __pyx_r = 0;
25351  __pyx_L0:;
25352  __Pyx_XDECREF(__pyx_v_struct);
25353  __Pyx_XDECREF(__pyx_v_bytesvalue);
25354  __Pyx_XGIVEREF(__pyx_r);
25355  __Pyx_RefNannyFinishContext();
25356  return __pyx_r;
25357 }
25358 
25359 /* "View.MemoryView":518
25360  *
25361  * @cname('getbuffer')
25362  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
25363  * if flags & PyBUF_WRITABLE and self.view.readonly:
25364  * raise ValueError("Cannot create writable memory view from read-only memoryview")
25365  */
25366 
25367 /* Python wrapper */
25368 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
25369 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
25370  int __pyx_r;
25371  __Pyx_RefNannyDeclarations
25372  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
25373  __pyx_r = __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));
25374 
25375  /* function exit code */
25376  __Pyx_RefNannyFinishContext();
25377  return __pyx_r;
25378 }
25379 
25380 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) {
25381  int __pyx_r;
25382  __Pyx_RefNannyDeclarations
25383  int __pyx_t_1;
25384  int __pyx_t_2;
25385  PyObject *__pyx_t_3 = NULL;
25386  Py_ssize_t *__pyx_t_4;
25387  char *__pyx_t_5;
25388  void *__pyx_t_6;
25389  int __pyx_t_7;
25390  Py_ssize_t __pyx_t_8;
25391  int __pyx_lineno = 0;
25392  const char *__pyx_filename = NULL;
25393  int __pyx_clineno = 0;
25394  if (__pyx_v_info == NULL) {
25395  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
25396  return -1;
25397  }
25398  __Pyx_RefNannySetupContext("__getbuffer__", 0);
25399  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
25400  __Pyx_GIVEREF(__pyx_v_info->obj);
25401 
25402  /* "View.MemoryView":519
25403  * @cname('getbuffer')
25404  * def __getbuffer__(self, Py_buffer *info, int flags):
25405  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
25406  * raise ValueError("Cannot create writable memory view from read-only memoryview")
25407  *
25408  */
25409  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
25410  if (__pyx_t_2) {
25411  } else {
25412  __pyx_t_1 = __pyx_t_2;
25413  goto __pyx_L4_bool_binop_done;
25414  }
25415  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
25416  __pyx_t_1 = __pyx_t_2;
25417  __pyx_L4_bool_binop_done:;
25418  if (unlikely(__pyx_t_1)) {
25419 
25420  /* "View.MemoryView":520
25421  * def __getbuffer__(self, Py_buffer *info, int flags):
25422  * if flags & PyBUF_WRITABLE and self.view.readonly:
25423  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
25424  *
25425  * if flags & PyBUF_ND:
25426  */
25427  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
25428  __Pyx_GOTREF(__pyx_t_3);
25429  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
25430  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25431  __PYX_ERR(1, 520, __pyx_L1_error)
25432 
25433  /* "View.MemoryView":519
25434  * @cname('getbuffer')
25435  * def __getbuffer__(self, Py_buffer *info, int flags):
25436  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
25437  * raise ValueError("Cannot create writable memory view from read-only memoryview")
25438  *
25439  */
25440  }
25441 
25442  /* "View.MemoryView":522
25443  * raise ValueError("Cannot create writable memory view from read-only memoryview")
25444  *
25445  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
25446  * info.shape = self.view.shape
25447  * else:
25448  */
25449  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
25450  if (__pyx_t_1) {
25451 
25452  /* "View.MemoryView":523
25453  *
25454  * if flags & PyBUF_ND:
25455  * info.shape = self.view.shape # <<<<<<<<<<<<<<
25456  * else:
25457  * info.shape = NULL
25458  */
25459  __pyx_t_4 = __pyx_v_self->view.shape;
25460  __pyx_v_info->shape = __pyx_t_4;
25461 
25462  /* "View.MemoryView":522
25463  * raise ValueError("Cannot create writable memory view from read-only memoryview")
25464  *
25465  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
25466  * info.shape = self.view.shape
25467  * else:
25468  */
25469  goto __pyx_L6;
25470  }
25471 
25472  /* "View.MemoryView":525
25473  * info.shape = self.view.shape
25474  * else:
25475  * info.shape = NULL # <<<<<<<<<<<<<<
25476  *
25477  * if flags & PyBUF_STRIDES:
25478  */
25479  /*else*/ {
25480  __pyx_v_info->shape = NULL;
25481  }
25482  __pyx_L6:;
25483 
25484  /* "View.MemoryView":527
25485  * info.shape = NULL
25486  *
25487  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
25488  * info.strides = self.view.strides
25489  * else:
25490  */
25491  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
25492  if (__pyx_t_1) {
25493 
25494  /* "View.MemoryView":528
25495  *
25496  * if flags & PyBUF_STRIDES:
25497  * info.strides = self.view.strides # <<<<<<<<<<<<<<
25498  * else:
25499  * info.strides = NULL
25500  */
25501  __pyx_t_4 = __pyx_v_self->view.strides;
25502  __pyx_v_info->strides = __pyx_t_4;
25503 
25504  /* "View.MemoryView":527
25505  * info.shape = NULL
25506  *
25507  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
25508  * info.strides = self.view.strides
25509  * else:
25510  */
25511  goto __pyx_L7;
25512  }
25513 
25514  /* "View.MemoryView":530
25515  * info.strides = self.view.strides
25516  * else:
25517  * info.strides = NULL # <<<<<<<<<<<<<<
25518  *
25519  * if flags & PyBUF_INDIRECT:
25520  */
25521  /*else*/ {
25522  __pyx_v_info->strides = NULL;
25523  }
25524  __pyx_L7:;
25525 
25526  /* "View.MemoryView":532
25527  * info.strides = NULL
25528  *
25529  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
25530  * info.suboffsets = self.view.suboffsets
25531  * else:
25532  */
25533  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
25534  if (__pyx_t_1) {
25535 
25536  /* "View.MemoryView":533
25537  *
25538  * if flags & PyBUF_INDIRECT:
25539  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
25540  * else:
25541  * info.suboffsets = NULL
25542  */
25543  __pyx_t_4 = __pyx_v_self->view.suboffsets;
25544  __pyx_v_info->suboffsets = __pyx_t_4;
25545 
25546  /* "View.MemoryView":532
25547  * info.strides = NULL
25548  *
25549  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
25550  * info.suboffsets = self.view.suboffsets
25551  * else:
25552  */
25553  goto __pyx_L8;
25554  }
25555 
25556  /* "View.MemoryView":535
25557  * info.suboffsets = self.view.suboffsets
25558  * else:
25559  * info.suboffsets = NULL # <<<<<<<<<<<<<<
25560  *
25561  * if flags & PyBUF_FORMAT:
25562  */
25563  /*else*/ {
25564  __pyx_v_info->suboffsets = NULL;
25565  }
25566  __pyx_L8:;
25567 
25568  /* "View.MemoryView":537
25569  * info.suboffsets = NULL
25570  *
25571  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
25572  * info.format = self.view.format
25573  * else:
25574  */
25575  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
25576  if (__pyx_t_1) {
25577 
25578  /* "View.MemoryView":538
25579  *
25580  * if flags & PyBUF_FORMAT:
25581  * info.format = self.view.format # <<<<<<<<<<<<<<
25582  * else:
25583  * info.format = NULL
25584  */
25585  __pyx_t_5 = __pyx_v_self->view.format;
25586  __pyx_v_info->format = __pyx_t_5;
25587 
25588  /* "View.MemoryView":537
25589  * info.suboffsets = NULL
25590  *
25591  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
25592  * info.format = self.view.format
25593  * else:
25594  */
25595  goto __pyx_L9;
25596  }
25597 
25598  /* "View.MemoryView":540
25599  * info.format = self.view.format
25600  * else:
25601  * info.format = NULL # <<<<<<<<<<<<<<
25602  *
25603  * info.buf = self.view.buf
25604  */
25605  /*else*/ {
25606  __pyx_v_info->format = NULL;
25607  }
25608  __pyx_L9:;
25609 
25610  /* "View.MemoryView":542
25611  * info.format = NULL
25612  *
25613  * info.buf = self.view.buf # <<<<<<<<<<<<<<
25614  * info.ndim = self.view.ndim
25615  * info.itemsize = self.view.itemsize
25616  */
25617  __pyx_t_6 = __pyx_v_self->view.buf;
25618  __pyx_v_info->buf = __pyx_t_6;
25619 
25620  /* "View.MemoryView":543
25621  *
25622  * info.buf = self.view.buf
25623  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
25624  * info.itemsize = self.view.itemsize
25625  * info.len = self.view.len
25626  */
25627  __pyx_t_7 = __pyx_v_self->view.ndim;
25628  __pyx_v_info->ndim = __pyx_t_7;
25629 
25630  /* "View.MemoryView":544
25631  * info.buf = self.view.buf
25632  * info.ndim = self.view.ndim
25633  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
25634  * info.len = self.view.len
25635  * info.readonly = self.view.readonly
25636  */
25637  __pyx_t_8 = __pyx_v_self->view.itemsize;
25638  __pyx_v_info->itemsize = __pyx_t_8;
25639 
25640  /* "View.MemoryView":545
25641  * info.ndim = self.view.ndim
25642  * info.itemsize = self.view.itemsize
25643  * info.len = self.view.len # <<<<<<<<<<<<<<
25644  * info.readonly = self.view.readonly
25645  * info.obj = self
25646  */
25647  __pyx_t_8 = __pyx_v_self->view.len;
25648  __pyx_v_info->len = __pyx_t_8;
25649 
25650  /* "View.MemoryView":546
25651  * info.itemsize = self.view.itemsize
25652  * info.len = self.view.len
25653  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
25654  * info.obj = self
25655  *
25656  */
25657  __pyx_t_1 = __pyx_v_self->view.readonly;
25658  __pyx_v_info->readonly = __pyx_t_1;
25659 
25660  /* "View.MemoryView":547
25661  * info.len = self.view.len
25662  * info.readonly = self.view.readonly
25663  * info.obj = self # <<<<<<<<<<<<<<
25664  *
25665  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
25666  */
25667  __Pyx_INCREF(((PyObject *)__pyx_v_self));
25668  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
25669  __Pyx_GOTREF(__pyx_v_info->obj);
25670  __Pyx_DECREF(__pyx_v_info->obj);
25671  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
25672 
25673  /* "View.MemoryView":518
25674  *
25675  * @cname('getbuffer')
25676  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
25677  * if flags & PyBUF_WRITABLE and self.view.readonly:
25678  * raise ValueError("Cannot create writable memory view from read-only memoryview")
25679  */
25680 
25681  /* function exit code */
25682  __pyx_r = 0;
25683  goto __pyx_L0;
25684  __pyx_L1_error:;
25685  __Pyx_XDECREF(__pyx_t_3);
25686  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25687  __pyx_r = -1;
25688  if (__pyx_v_info->obj != NULL) {
25689  __Pyx_GOTREF(__pyx_v_info->obj);
25690  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
25691  }
25692  goto __pyx_L2;
25693  __pyx_L0:;
25694  if (__pyx_v_info->obj == Py_None) {
25695  __Pyx_GOTREF(__pyx_v_info->obj);
25696  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
25697  }
25698  __pyx_L2:;
25699  __Pyx_RefNannyFinishContext();
25700  return __pyx_r;
25701 }
25702 
25703 /* "View.MemoryView":553
25704  *
25705  * @property
25706  * def T(self): # <<<<<<<<<<<<<<
25707  * cdef _memoryviewslice result = memoryview_copy(self)
25708  * transpose_memslice(&result.from_slice)
25709  */
25710 
25711 /* Python wrapper */
25712 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
25713 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
25714  PyObject *__pyx_r = 0;
25715  __Pyx_RefNannyDeclarations
25716  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
25717  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
25718 
25719  /* function exit code */
25720  __Pyx_RefNannyFinishContext();
25721  return __pyx_r;
25722 }
25723 
25724 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
25725  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
25726  PyObject *__pyx_r = NULL;
25727  __Pyx_RefNannyDeclarations
25728  PyObject *__pyx_t_1 = NULL;
25729  int __pyx_t_2;
25730  int __pyx_lineno = 0;
25731  const char *__pyx_filename = NULL;
25732  int __pyx_clineno = 0;
25733  __Pyx_RefNannySetupContext("__get__", 0);
25734 
25735  /* "View.MemoryView":554
25736  * @property
25737  * def T(self):
25738  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
25739  * transpose_memslice(&result.from_slice)
25740  * return result
25741  */
25742  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
25743  __Pyx_GOTREF(__pyx_t_1);
25744  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
25745  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
25746  __pyx_t_1 = 0;
25747 
25748  /* "View.MemoryView":555
25749  * def T(self):
25750  * cdef _memoryviewslice result = memoryview_copy(self)
25751  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
25752  * return result
25753  *
25754  */
25755  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
25756 
25757  /* "View.MemoryView":556
25758  * cdef _memoryviewslice result = memoryview_copy(self)
25759  * transpose_memslice(&result.from_slice)
25760  * return result # <<<<<<<<<<<<<<
25761  *
25762  * @property
25763  */
25764  __Pyx_XDECREF(__pyx_r);
25765  __Pyx_INCREF(((PyObject *)__pyx_v_result));
25766  __pyx_r = ((PyObject *)__pyx_v_result);
25767  goto __pyx_L0;
25768 
25769  /* "View.MemoryView":553
25770  *
25771  * @property
25772  * def T(self): # <<<<<<<<<<<<<<
25773  * cdef _memoryviewslice result = memoryview_copy(self)
25774  * transpose_memslice(&result.from_slice)
25775  */
25776 
25777  /* function exit code */
25778  __pyx_L1_error:;
25779  __Pyx_XDECREF(__pyx_t_1);
25780  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25781  __pyx_r = NULL;
25782  __pyx_L0:;
25783  __Pyx_XDECREF((PyObject *)__pyx_v_result);
25784  __Pyx_XGIVEREF(__pyx_r);
25785  __Pyx_RefNannyFinishContext();
25786  return __pyx_r;
25787 }
25788 
25789 /* "View.MemoryView":559
25790  *
25791  * @property
25792  * def base(self): # <<<<<<<<<<<<<<
25793  * return self.obj
25794  *
25795  */
25796 
25797 /* Python wrapper */
25798 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
25799 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
25800  PyObject *__pyx_r = 0;
25801  __Pyx_RefNannyDeclarations
25802  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
25803  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
25804 
25805  /* function exit code */
25806  __Pyx_RefNannyFinishContext();
25807  return __pyx_r;
25808 }
25809 
25810 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
25811  PyObject *__pyx_r = NULL;
25812  __Pyx_RefNannyDeclarations
25813  __Pyx_RefNannySetupContext("__get__", 0);
25814 
25815  /* "View.MemoryView":560
25816  * @property
25817  * def base(self):
25818  * return self.obj # <<<<<<<<<<<<<<
25819  *
25820  * @property
25821  */
25822  __Pyx_XDECREF(__pyx_r);
25823  __Pyx_INCREF(__pyx_v_self->obj);
25824  __pyx_r = __pyx_v_self->obj;
25825  goto __pyx_L0;
25826 
25827  /* "View.MemoryView":559
25828  *
25829  * @property
25830  * def base(self): # <<<<<<<<<<<<<<
25831  * return self.obj
25832  *
25833  */
25834 
25835  /* function exit code */
25836  __pyx_L0:;
25837  __Pyx_XGIVEREF(__pyx_r);
25838  __Pyx_RefNannyFinishContext();
25839  return __pyx_r;
25840 }
25841 
25842 /* "View.MemoryView":563
25843  *
25844  * @property
25845  * def shape(self): # <<<<<<<<<<<<<<
25846  * return tuple([length for length in self.view.shape[:self.view.ndim]])
25847  *
25848  */
25849 
25850 /* Python wrapper */
25851 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
25852 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
25853  PyObject *__pyx_r = 0;
25854  __Pyx_RefNannyDeclarations
25855  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
25856  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
25857 
25858  /* function exit code */
25859  __Pyx_RefNannyFinishContext();
25860  return __pyx_r;
25861 }
25862 
25863 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
25864  Py_ssize_t __pyx_v_length;
25865  PyObject *__pyx_r = NULL;
25866  __Pyx_RefNannyDeclarations
25867  PyObject *__pyx_t_1 = NULL;
25868  Py_ssize_t *__pyx_t_2;
25869  Py_ssize_t *__pyx_t_3;
25870  Py_ssize_t *__pyx_t_4;
25871  PyObject *__pyx_t_5 = NULL;
25872  int __pyx_lineno = 0;
25873  const char *__pyx_filename = NULL;
25874  int __pyx_clineno = 0;
25875  __Pyx_RefNannySetupContext("__get__", 0);
25876 
25877  /* "View.MemoryView":564
25878  * @property
25879  * def shape(self):
25880  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
25881  *
25882  * @property
25883  */
25884  __Pyx_XDECREF(__pyx_r);
25885  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
25886  __Pyx_GOTREF(__pyx_t_1);
25887  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
25888  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
25889  __pyx_t_2 = __pyx_t_4;
25890  __pyx_v_length = (__pyx_t_2[0]);
25891  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
25892  __Pyx_GOTREF(__pyx_t_5);
25893  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
25894  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25895  }
25896  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
25897  __Pyx_GOTREF(__pyx_t_5);
25898  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25899  __pyx_r = __pyx_t_5;
25900  __pyx_t_5 = 0;
25901  goto __pyx_L0;
25902 
25903  /* "View.MemoryView":563
25904  *
25905  * @property
25906  * def shape(self): # <<<<<<<<<<<<<<
25907  * return tuple([length for length in self.view.shape[:self.view.ndim]])
25908  *
25909  */
25910 
25911  /* function exit code */
25912  __pyx_L1_error:;
25913  __Pyx_XDECREF(__pyx_t_1);
25914  __Pyx_XDECREF(__pyx_t_5);
25915  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25916  __pyx_r = NULL;
25917  __pyx_L0:;
25918  __Pyx_XGIVEREF(__pyx_r);
25919  __Pyx_RefNannyFinishContext();
25920  return __pyx_r;
25921 }
25922 
25923 /* "View.MemoryView":567
25924  *
25925  * @property
25926  * def strides(self): # <<<<<<<<<<<<<<
25927  * if self.view.strides == NULL:
25928  *
25929  */
25930 
25931 /* Python wrapper */
25932 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
25933 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
25934  PyObject *__pyx_r = 0;
25935  __Pyx_RefNannyDeclarations
25936  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
25937  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
25938 
25939  /* function exit code */
25940  __Pyx_RefNannyFinishContext();
25941  return __pyx_r;
25942 }
25943 
25944 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
25945  Py_ssize_t __pyx_v_stride;
25946  PyObject *__pyx_r = NULL;
25947  __Pyx_RefNannyDeclarations
25948  int __pyx_t_1;
25949  PyObject *__pyx_t_2 = NULL;
25950  Py_ssize_t *__pyx_t_3;
25951  Py_ssize_t *__pyx_t_4;
25952  Py_ssize_t *__pyx_t_5;
25953  PyObject *__pyx_t_6 = NULL;
25954  int __pyx_lineno = 0;
25955  const char *__pyx_filename = NULL;
25956  int __pyx_clineno = 0;
25957  __Pyx_RefNannySetupContext("__get__", 0);
25958 
25959  /* "View.MemoryView":568
25960  * @property
25961  * def strides(self):
25962  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
25963  *
25964  * raise ValueError("Buffer view does not expose strides")
25965  */
25966  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
25967  if (unlikely(__pyx_t_1)) {
25968 
25969  /* "View.MemoryView":570
25970  * if self.view.strides == NULL:
25971  *
25972  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
25973  *
25974  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
25975  */
25976  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
25977  __Pyx_GOTREF(__pyx_t_2);
25978  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
25979  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25980  __PYX_ERR(1, 570, __pyx_L1_error)
25981 
25982  /* "View.MemoryView":568
25983  * @property
25984  * def strides(self):
25985  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
25986  *
25987  * raise ValueError("Buffer view does not expose strides")
25988  */
25989  }
25990 
25991  /* "View.MemoryView":572
25992  * raise ValueError("Buffer view does not expose strides")
25993  *
25994  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
25995  *
25996  * @property
25997  */
25998  __Pyx_XDECREF(__pyx_r);
25999  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
26000  __Pyx_GOTREF(__pyx_t_2);
26001  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
26002  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
26003  __pyx_t_3 = __pyx_t_5;
26004  __pyx_v_stride = (__pyx_t_3[0]);
26005  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
26006  __Pyx_GOTREF(__pyx_t_6);
26007  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
26008  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26009  }
26010  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
26011  __Pyx_GOTREF(__pyx_t_6);
26012  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26013  __pyx_r = __pyx_t_6;
26014  __pyx_t_6 = 0;
26015  goto __pyx_L0;
26016 
26017  /* "View.MemoryView":567
26018  *
26019  * @property
26020  * def strides(self): # <<<<<<<<<<<<<<
26021  * if self.view.strides == NULL:
26022  *
26023  */
26024 
26025  /* function exit code */
26026  __pyx_L1_error:;
26027  __Pyx_XDECREF(__pyx_t_2);
26028  __Pyx_XDECREF(__pyx_t_6);
26029  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26030  __pyx_r = NULL;
26031  __pyx_L0:;
26032  __Pyx_XGIVEREF(__pyx_r);
26033  __Pyx_RefNannyFinishContext();
26034  return __pyx_r;
26035 }
26036 
26037 /* "View.MemoryView":575
26038  *
26039  * @property
26040  * def suboffsets(self): # <<<<<<<<<<<<<<
26041  * if self.view.suboffsets == NULL:
26042  * return (-1,) * self.view.ndim
26043  */
26044 
26045 /* Python wrapper */
26046 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
26047 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
26048  PyObject *__pyx_r = 0;
26049  __Pyx_RefNannyDeclarations
26050  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
26051  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
26052 
26053  /* function exit code */
26054  __Pyx_RefNannyFinishContext();
26055  return __pyx_r;
26056 }
26057 
26058 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
26059  Py_ssize_t __pyx_v_suboffset;
26060  PyObject *__pyx_r = NULL;
26061  __Pyx_RefNannyDeclarations
26062  int __pyx_t_1;
26063  PyObject *__pyx_t_2 = NULL;
26064  PyObject *__pyx_t_3 = NULL;
26065  Py_ssize_t *__pyx_t_4;
26066  Py_ssize_t *__pyx_t_5;
26067  Py_ssize_t *__pyx_t_6;
26068  int __pyx_lineno = 0;
26069  const char *__pyx_filename = NULL;
26070  int __pyx_clineno = 0;
26071  __Pyx_RefNannySetupContext("__get__", 0);
26072 
26073  /* "View.MemoryView":576
26074  * @property
26075  * def suboffsets(self):
26076  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
26077  * return (-1,) * self.view.ndim
26078  *
26079  */
26080  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
26081  if (__pyx_t_1) {
26082 
26083  /* "View.MemoryView":577
26084  * def suboffsets(self):
26085  * if self.view.suboffsets == NULL:
26086  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
26087  *
26088  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
26089  */
26090  __Pyx_XDECREF(__pyx_r);
26091  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
26092  __Pyx_GOTREF(__pyx_t_2);
26093  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__23, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
26094  __Pyx_GOTREF(__pyx_t_3);
26095  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26096  __pyx_r = __pyx_t_3;
26097  __pyx_t_3 = 0;
26098  goto __pyx_L0;
26099 
26100  /* "View.MemoryView":576
26101  * @property
26102  * def suboffsets(self):
26103  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
26104  * return (-1,) * self.view.ndim
26105  *
26106  */
26107  }
26108 
26109  /* "View.MemoryView":579
26110  * return (-1,) * self.view.ndim
26111  *
26112  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
26113  *
26114  * @property
26115  */
26116  __Pyx_XDECREF(__pyx_r);
26117  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
26118  __Pyx_GOTREF(__pyx_t_3);
26119  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
26120  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
26121  __pyx_t_4 = __pyx_t_6;
26122  __pyx_v_suboffset = (__pyx_t_4[0]);
26123  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
26124  __Pyx_GOTREF(__pyx_t_2);
26125  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
26126  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26127  }
26128  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
26129  __Pyx_GOTREF(__pyx_t_2);
26130  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26131  __pyx_r = __pyx_t_2;
26132  __pyx_t_2 = 0;
26133  goto __pyx_L0;
26134 
26135  /* "View.MemoryView":575
26136  *
26137  * @property
26138  * def suboffsets(self): # <<<<<<<<<<<<<<
26139  * if self.view.suboffsets == NULL:
26140  * return (-1,) * self.view.ndim
26141  */
26142 
26143  /* function exit code */
26144  __pyx_L1_error:;
26145  __Pyx_XDECREF(__pyx_t_2);
26146  __Pyx_XDECREF(__pyx_t_3);
26147  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26148  __pyx_r = NULL;
26149  __pyx_L0:;
26150  __Pyx_XGIVEREF(__pyx_r);
26151  __Pyx_RefNannyFinishContext();
26152  return __pyx_r;
26153 }
26154 
26155 /* "View.MemoryView":582
26156  *
26157  * @property
26158  * def ndim(self): # <<<<<<<<<<<<<<
26159  * return self.view.ndim
26160  *
26161  */
26162 
26163 /* Python wrapper */
26164 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
26165 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
26166  PyObject *__pyx_r = 0;
26167  __Pyx_RefNannyDeclarations
26168  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
26169  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
26170 
26171  /* function exit code */
26172  __Pyx_RefNannyFinishContext();
26173  return __pyx_r;
26174 }
26175 
26176 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
26177  PyObject *__pyx_r = NULL;
26178  __Pyx_RefNannyDeclarations
26179  PyObject *__pyx_t_1 = NULL;
26180  int __pyx_lineno = 0;
26181  const char *__pyx_filename = NULL;
26182  int __pyx_clineno = 0;
26183  __Pyx_RefNannySetupContext("__get__", 0);
26184 
26185  /* "View.MemoryView":583
26186  * @property
26187  * def ndim(self):
26188  * return self.view.ndim # <<<<<<<<<<<<<<
26189  *
26190  * @property
26191  */
26192  __Pyx_XDECREF(__pyx_r);
26193  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
26194  __Pyx_GOTREF(__pyx_t_1);
26195  __pyx_r = __pyx_t_1;
26196  __pyx_t_1 = 0;
26197  goto __pyx_L0;
26198 
26199  /* "View.MemoryView":582
26200  *
26201  * @property
26202  * def ndim(self): # <<<<<<<<<<<<<<
26203  * return self.view.ndim
26204  *
26205  */
26206 
26207  /* function exit code */
26208  __pyx_L1_error:;
26209  __Pyx_XDECREF(__pyx_t_1);
26210  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26211  __pyx_r = NULL;
26212  __pyx_L0:;
26213  __Pyx_XGIVEREF(__pyx_r);
26214  __Pyx_RefNannyFinishContext();
26215  return __pyx_r;
26216 }
26217 
26218 /* "View.MemoryView":586
26219  *
26220  * @property
26221  * def itemsize(self): # <<<<<<<<<<<<<<
26222  * return self.view.itemsize
26223  *
26224  */
26225 
26226 /* Python wrapper */
26227 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
26228 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
26229  PyObject *__pyx_r = 0;
26230  __Pyx_RefNannyDeclarations
26231  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
26232  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
26233 
26234  /* function exit code */
26235  __Pyx_RefNannyFinishContext();
26236  return __pyx_r;
26237 }
26238 
26239 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
26240  PyObject *__pyx_r = NULL;
26241  __Pyx_RefNannyDeclarations
26242  PyObject *__pyx_t_1 = NULL;
26243  int __pyx_lineno = 0;
26244  const char *__pyx_filename = NULL;
26245  int __pyx_clineno = 0;
26246  __Pyx_RefNannySetupContext("__get__", 0);
26247 
26248  /* "View.MemoryView":587
26249  * @property
26250  * def itemsize(self):
26251  * return self.view.itemsize # <<<<<<<<<<<<<<
26252  *
26253  * @property
26254  */
26255  __Pyx_XDECREF(__pyx_r);
26256  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
26257  __Pyx_GOTREF(__pyx_t_1);
26258  __pyx_r = __pyx_t_1;
26259  __pyx_t_1 = 0;
26260  goto __pyx_L0;
26261 
26262  /* "View.MemoryView":586
26263  *
26264  * @property
26265  * def itemsize(self): # <<<<<<<<<<<<<<
26266  * return self.view.itemsize
26267  *
26268  */
26269 
26270  /* function exit code */
26271  __pyx_L1_error:;
26272  __Pyx_XDECREF(__pyx_t_1);
26273  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26274  __pyx_r = NULL;
26275  __pyx_L0:;
26276  __Pyx_XGIVEREF(__pyx_r);
26277  __Pyx_RefNannyFinishContext();
26278  return __pyx_r;
26279 }
26280 
26281 /* "View.MemoryView":590
26282  *
26283  * @property
26284  * def nbytes(self): # <<<<<<<<<<<<<<
26285  * return self.size * self.view.itemsize
26286  *
26287  */
26288 
26289 /* Python wrapper */
26290 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
26291 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
26292  PyObject *__pyx_r = 0;
26293  __Pyx_RefNannyDeclarations
26294  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
26295  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
26296 
26297  /* function exit code */
26298  __Pyx_RefNannyFinishContext();
26299  return __pyx_r;
26300 }
26301 
26302 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
26303  PyObject *__pyx_r = NULL;
26304  __Pyx_RefNannyDeclarations
26305  PyObject *__pyx_t_1 = NULL;
26306  PyObject *__pyx_t_2 = NULL;
26307  PyObject *__pyx_t_3 = NULL;
26308  int __pyx_lineno = 0;
26309  const char *__pyx_filename = NULL;
26310  int __pyx_clineno = 0;
26311  __Pyx_RefNannySetupContext("__get__", 0);
26312 
26313  /* "View.MemoryView":591
26314  * @property
26315  * def nbytes(self):
26316  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
26317  *
26318  * @property
26319  */
26320  __Pyx_XDECREF(__pyx_r);
26321  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
26322  __Pyx_GOTREF(__pyx_t_1);
26323  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
26324  __Pyx_GOTREF(__pyx_t_2);
26325  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
26326  __Pyx_GOTREF(__pyx_t_3);
26327  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26328  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26329  __pyx_r = __pyx_t_3;
26330  __pyx_t_3 = 0;
26331  goto __pyx_L0;
26332 
26333  /* "View.MemoryView":590
26334  *
26335  * @property
26336  * def nbytes(self): # <<<<<<<<<<<<<<
26337  * return self.size * self.view.itemsize
26338  *
26339  */
26340 
26341  /* function exit code */
26342  __pyx_L1_error:;
26343  __Pyx_XDECREF(__pyx_t_1);
26344  __Pyx_XDECREF(__pyx_t_2);
26345  __Pyx_XDECREF(__pyx_t_3);
26346  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26347  __pyx_r = NULL;
26348  __pyx_L0:;
26349  __Pyx_XGIVEREF(__pyx_r);
26350  __Pyx_RefNannyFinishContext();
26351  return __pyx_r;
26352 }
26353 
26354 /* "View.MemoryView":594
26355  *
26356  * @property
26357  * def size(self): # <<<<<<<<<<<<<<
26358  * if self._size is None:
26359  * result = 1
26360  */
26361 
26362 /* Python wrapper */
26363 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
26364 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
26365  PyObject *__pyx_r = 0;
26366  __Pyx_RefNannyDeclarations
26367  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
26368  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
26369 
26370  /* function exit code */
26371  __Pyx_RefNannyFinishContext();
26372  return __pyx_r;
26373 }
26374 
26375 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
26376  PyObject *__pyx_v_result = NULL;
26377  PyObject *__pyx_v_length = NULL;
26378  PyObject *__pyx_r = NULL;
26379  __Pyx_RefNannyDeclarations
26380  int __pyx_t_1;
26381  int __pyx_t_2;
26382  Py_ssize_t *__pyx_t_3;
26383  Py_ssize_t *__pyx_t_4;
26384  Py_ssize_t *__pyx_t_5;
26385  PyObject *__pyx_t_6 = NULL;
26386  int __pyx_lineno = 0;
26387  const char *__pyx_filename = NULL;
26388  int __pyx_clineno = 0;
26389  __Pyx_RefNannySetupContext("__get__", 0);
26390 
26391  /* "View.MemoryView":595
26392  * @property
26393  * def size(self):
26394  * if self._size is None: # <<<<<<<<<<<<<<
26395  * result = 1
26396  *
26397  */
26398  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
26399  __pyx_t_2 = (__pyx_t_1 != 0);
26400  if (__pyx_t_2) {
26401 
26402  /* "View.MemoryView":596
26403  * def size(self):
26404  * if self._size is None:
26405  * result = 1 # <<<<<<<<<<<<<<
26406  *
26407  * for length in self.view.shape[:self.view.ndim]:
26408  */
26409  __Pyx_INCREF(__pyx_int_1);
26410  __pyx_v_result = __pyx_int_1;
26411 
26412  /* "View.MemoryView":598
26413  * result = 1
26414  *
26415  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
26416  * result *= length
26417  *
26418  */
26419  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
26420  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
26421  __pyx_t_3 = __pyx_t_5;
26422  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
26423  __Pyx_GOTREF(__pyx_t_6);
26424  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
26425  __pyx_t_6 = 0;
26426 
26427  /* "View.MemoryView":599
26428  *
26429  * for length in self.view.shape[:self.view.ndim]:
26430  * result *= length # <<<<<<<<<<<<<<
26431  *
26432  * self._size = result
26433  */
26434  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
26435  __Pyx_GOTREF(__pyx_t_6);
26436  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
26437  __pyx_t_6 = 0;
26438  }
26439 
26440  /* "View.MemoryView":601
26441  * result *= length
26442  *
26443  * self._size = result # <<<<<<<<<<<<<<
26444  *
26445  * return self._size
26446  */
26447  __Pyx_INCREF(__pyx_v_result);
26448  __Pyx_GIVEREF(__pyx_v_result);
26449  __Pyx_GOTREF(__pyx_v_self->_size);
26450  __Pyx_DECREF(__pyx_v_self->_size);
26451  __pyx_v_self->_size = __pyx_v_result;
26452 
26453  /* "View.MemoryView":595
26454  * @property
26455  * def size(self):
26456  * if self._size is None: # <<<<<<<<<<<<<<
26457  * result = 1
26458  *
26459  */
26460  }
26461 
26462  /* "View.MemoryView":603
26463  * self._size = result
26464  *
26465  * return self._size # <<<<<<<<<<<<<<
26466  *
26467  * def __len__(self):
26468  */
26469  __Pyx_XDECREF(__pyx_r);
26470  __Pyx_INCREF(__pyx_v_self->_size);
26471  __pyx_r = __pyx_v_self->_size;
26472  goto __pyx_L0;
26473 
26474  /* "View.MemoryView":594
26475  *
26476  * @property
26477  * def size(self): # <<<<<<<<<<<<<<
26478  * if self._size is None:
26479  * result = 1
26480  */
26481 
26482  /* function exit code */
26483  __pyx_L1_error:;
26484  __Pyx_XDECREF(__pyx_t_6);
26485  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26486  __pyx_r = NULL;
26487  __pyx_L0:;
26488  __Pyx_XDECREF(__pyx_v_result);
26489  __Pyx_XDECREF(__pyx_v_length);
26490  __Pyx_XGIVEREF(__pyx_r);
26491  __Pyx_RefNannyFinishContext();
26492  return __pyx_r;
26493 }
26494 
26495 /* "View.MemoryView":605
26496  * return self._size
26497  *
26498  * def __len__(self): # <<<<<<<<<<<<<<
26499  * if self.view.ndim >= 1:
26500  * return self.view.shape[0]
26501  */
26502 
26503 /* Python wrapper */
26504 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
26505 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
26506  Py_ssize_t __pyx_r;
26507  __Pyx_RefNannyDeclarations
26508  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
26509  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
26510 
26511  /* function exit code */
26512  __Pyx_RefNannyFinishContext();
26513  return __pyx_r;
26514 }
26515 
26516 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
26517  Py_ssize_t __pyx_r;
26518  __Pyx_RefNannyDeclarations
26519  int __pyx_t_1;
26520  __Pyx_RefNannySetupContext("__len__", 0);
26521 
26522  /* "View.MemoryView":606
26523  *
26524  * def __len__(self):
26525  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
26526  * return self.view.shape[0]
26527  *
26528  */
26529  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
26530  if (__pyx_t_1) {
26531 
26532  /* "View.MemoryView":607
26533  * def __len__(self):
26534  * if self.view.ndim >= 1:
26535  * return self.view.shape[0] # <<<<<<<<<<<<<<
26536  *
26537  * return 0
26538  */
26539  __pyx_r = (__pyx_v_self->view.shape[0]);
26540  goto __pyx_L0;
26541 
26542  /* "View.MemoryView":606
26543  *
26544  * def __len__(self):
26545  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
26546  * return self.view.shape[0]
26547  *
26548  */
26549  }
26550 
26551  /* "View.MemoryView":609
26552  * return self.view.shape[0]
26553  *
26554  * return 0 # <<<<<<<<<<<<<<
26555  *
26556  * def __repr__(self):
26557  */
26558  __pyx_r = 0;
26559  goto __pyx_L0;
26560 
26561  /* "View.MemoryView":605
26562  * return self._size
26563  *
26564  * def __len__(self): # <<<<<<<<<<<<<<
26565  * if self.view.ndim >= 1:
26566  * return self.view.shape[0]
26567  */
26568 
26569  /* function exit code */
26570  __pyx_L0:;
26571  __Pyx_RefNannyFinishContext();
26572  return __pyx_r;
26573 }
26574 
26575 /* "View.MemoryView":611
26576  * return 0
26577  *
26578  * def __repr__(self): # <<<<<<<<<<<<<<
26579  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
26580  * id(self))
26581  */
26582 
26583 /* Python wrapper */
26584 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
26585 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
26586  PyObject *__pyx_r = 0;
26587  __Pyx_RefNannyDeclarations
26588  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
26589  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
26590 
26591  /* function exit code */
26592  __Pyx_RefNannyFinishContext();
26593  return __pyx_r;
26594 }
26595 
26596 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
26597  PyObject *__pyx_r = NULL;
26598  __Pyx_RefNannyDeclarations
26599  PyObject *__pyx_t_1 = NULL;
26600  PyObject *__pyx_t_2 = NULL;
26601  PyObject *__pyx_t_3 = NULL;
26602  int __pyx_lineno = 0;
26603  const char *__pyx_filename = NULL;
26604  int __pyx_clineno = 0;
26605  __Pyx_RefNannySetupContext("__repr__", 0);
26606 
26607  /* "View.MemoryView":612
26608  *
26609  * def __repr__(self):
26610  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
26611  * id(self))
26612  *
26613  */
26614  __Pyx_XDECREF(__pyx_r);
26615  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
26616  __Pyx_GOTREF(__pyx_t_1);
26617  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
26618  __Pyx_GOTREF(__pyx_t_2);
26619  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26620  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
26621  __Pyx_GOTREF(__pyx_t_1);
26622  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26623 
26624  /* "View.MemoryView":613
26625  * def __repr__(self):
26626  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
26627  * id(self)) # <<<<<<<<<<<<<<
26628  *
26629  * def __str__(self):
26630  */
26631  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
26632  __Pyx_GOTREF(__pyx_t_2);
26633 
26634  /* "View.MemoryView":612
26635  *
26636  * def __repr__(self):
26637  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
26638  * id(self))
26639  *
26640  */
26641  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
26642  __Pyx_GOTREF(__pyx_t_3);
26643  __Pyx_GIVEREF(__pyx_t_1);
26644  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
26645  __Pyx_GIVEREF(__pyx_t_2);
26646  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
26647  __pyx_t_1 = 0;
26648  __pyx_t_2 = 0;
26649  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
26650  __Pyx_GOTREF(__pyx_t_2);
26651  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26652  __pyx_r = __pyx_t_2;
26653  __pyx_t_2 = 0;
26654  goto __pyx_L0;
26655 
26656  /* "View.MemoryView":611
26657  * return 0
26658  *
26659  * def __repr__(self): # <<<<<<<<<<<<<<
26660  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
26661  * id(self))
26662  */
26663 
26664  /* function exit code */
26665  __pyx_L1_error:;
26666  __Pyx_XDECREF(__pyx_t_1);
26667  __Pyx_XDECREF(__pyx_t_2);
26668  __Pyx_XDECREF(__pyx_t_3);
26669  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26670  __pyx_r = NULL;
26671  __pyx_L0:;
26672  __Pyx_XGIVEREF(__pyx_r);
26673  __Pyx_RefNannyFinishContext();
26674  return __pyx_r;
26675 }
26676 
26677 /* "View.MemoryView":615
26678  * id(self))
26679  *
26680  * def __str__(self): # <<<<<<<<<<<<<<
26681  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
26682  *
26683  */
26684 
26685 /* Python wrapper */
26686 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
26687 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
26688  PyObject *__pyx_r = 0;
26689  __Pyx_RefNannyDeclarations
26690  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
26691  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
26692 
26693  /* function exit code */
26694  __Pyx_RefNannyFinishContext();
26695  return __pyx_r;
26696 }
26697 
26698 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
26699  PyObject *__pyx_r = NULL;
26700  __Pyx_RefNannyDeclarations
26701  PyObject *__pyx_t_1 = NULL;
26702  PyObject *__pyx_t_2 = NULL;
26703  int __pyx_lineno = 0;
26704  const char *__pyx_filename = NULL;
26705  int __pyx_clineno = 0;
26706  __Pyx_RefNannySetupContext("__str__", 0);
26707 
26708  /* "View.MemoryView":616
26709  *
26710  * def __str__(self):
26711  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
26712  *
26713  *
26714  */
26715  __Pyx_XDECREF(__pyx_r);
26716  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
26717  __Pyx_GOTREF(__pyx_t_1);
26718  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
26719  __Pyx_GOTREF(__pyx_t_2);
26720  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26721  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
26722  __Pyx_GOTREF(__pyx_t_1);
26723  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26724  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
26725  __Pyx_GOTREF(__pyx_t_2);
26726  __Pyx_GIVEREF(__pyx_t_1);
26727  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
26728  __pyx_t_1 = 0;
26729  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
26730  __Pyx_GOTREF(__pyx_t_1);
26731  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26732  __pyx_r = __pyx_t_1;
26733  __pyx_t_1 = 0;
26734  goto __pyx_L0;
26735 
26736  /* "View.MemoryView":615
26737  * id(self))
26738  *
26739  * def __str__(self): # <<<<<<<<<<<<<<
26740  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
26741  *
26742  */
26743 
26744  /* function exit code */
26745  __pyx_L1_error:;
26746  __Pyx_XDECREF(__pyx_t_1);
26747  __Pyx_XDECREF(__pyx_t_2);
26748  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26749  __pyx_r = NULL;
26750  __pyx_L0:;
26751  __Pyx_XGIVEREF(__pyx_r);
26752  __Pyx_RefNannyFinishContext();
26753  return __pyx_r;
26754 }
26755 
26756 /* "View.MemoryView":619
26757  *
26758  *
26759  * def is_c_contig(self): # <<<<<<<<<<<<<<
26760  * cdef __Pyx_memviewslice *mslice
26761  * cdef __Pyx_memviewslice tmp
26762  */
26763 
26764 /* Python wrapper */
26765 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
26766 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
26767  PyObject *__pyx_r = 0;
26768  __Pyx_RefNannyDeclarations
26769  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
26770  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
26771 
26772  /* function exit code */
26773  __Pyx_RefNannyFinishContext();
26774  return __pyx_r;
26775 }
26776 
26777 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
26778  __Pyx_memviewslice *__pyx_v_mslice;
26779  __Pyx_memviewslice __pyx_v_tmp;
26780  PyObject *__pyx_r = NULL;
26781  __Pyx_RefNannyDeclarations
26782  __Pyx_memviewslice *__pyx_t_1;
26783  PyObject *__pyx_t_2 = NULL;
26784  int __pyx_lineno = 0;
26785  const char *__pyx_filename = NULL;
26786  int __pyx_clineno = 0;
26787  __Pyx_RefNannySetupContext("is_c_contig", 0);
26788 
26789  /* "View.MemoryView":622
26790  * cdef __Pyx_memviewslice *mslice
26791  * cdef __Pyx_memviewslice tmp
26792  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
26793  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
26794  *
26795  */
26796  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
26797  __pyx_v_mslice = __pyx_t_1;
26798 
26799  /* "View.MemoryView":623
26800  * cdef __Pyx_memviewslice tmp
26801  * mslice = get_slice_from_memview(self, &tmp)
26802  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
26803  *
26804  * def is_f_contig(self):
26805  */
26806  __Pyx_XDECREF(__pyx_r);
26807  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
26808  __Pyx_GOTREF(__pyx_t_2);
26809  __pyx_r = __pyx_t_2;
26810  __pyx_t_2 = 0;
26811  goto __pyx_L0;
26812 
26813  /* "View.MemoryView":619
26814  *
26815  *
26816  * def is_c_contig(self): # <<<<<<<<<<<<<<
26817  * cdef __Pyx_memviewslice *mslice
26818  * cdef __Pyx_memviewslice tmp
26819  */
26820 
26821  /* function exit code */
26822  __pyx_L1_error:;
26823  __Pyx_XDECREF(__pyx_t_2);
26824  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
26825  __pyx_r = NULL;
26826  __pyx_L0:;
26827  __Pyx_XGIVEREF(__pyx_r);
26828  __Pyx_RefNannyFinishContext();
26829  return __pyx_r;
26830 }
26831 
26832 /* "View.MemoryView":625
26833  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
26834  *
26835  * def is_f_contig(self): # <<<<<<<<<<<<<<
26836  * cdef __Pyx_memviewslice *mslice
26837  * cdef __Pyx_memviewslice tmp
26838  */
26839 
26840 /* Python wrapper */
26841 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
26842 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
26843  PyObject *__pyx_r = 0;
26844  __Pyx_RefNannyDeclarations
26845  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
26846  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
26847 
26848  /* function exit code */
26849  __Pyx_RefNannyFinishContext();
26850  return __pyx_r;
26851 }
26852 
26853 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
26854  __Pyx_memviewslice *__pyx_v_mslice;
26855  __Pyx_memviewslice __pyx_v_tmp;
26856  PyObject *__pyx_r = NULL;
26857  __Pyx_RefNannyDeclarations
26858  __Pyx_memviewslice *__pyx_t_1;
26859  PyObject *__pyx_t_2 = NULL;
26860  int __pyx_lineno = 0;
26861  const char *__pyx_filename = NULL;
26862  int __pyx_clineno = 0;
26863  __Pyx_RefNannySetupContext("is_f_contig", 0);
26864 
26865  /* "View.MemoryView":628
26866  * cdef __Pyx_memviewslice *mslice
26867  * cdef __Pyx_memviewslice tmp
26868  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
26869  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
26870  *
26871  */
26872  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
26873  __pyx_v_mslice = __pyx_t_1;
26874 
26875  /* "View.MemoryView":629
26876  * cdef __Pyx_memviewslice tmp
26877  * mslice = get_slice_from_memview(self, &tmp)
26878  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
26879  *
26880  * def copy(self):
26881  */
26882  __Pyx_XDECREF(__pyx_r);
26883  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
26884  __Pyx_GOTREF(__pyx_t_2);
26885  __pyx_r = __pyx_t_2;
26886  __pyx_t_2 = 0;
26887  goto __pyx_L0;
26888 
26889  /* "View.MemoryView":625
26890  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
26891  *
26892  * def is_f_contig(self): # <<<<<<<<<<<<<<
26893  * cdef __Pyx_memviewslice *mslice
26894  * cdef __Pyx_memviewslice tmp
26895  */
26896 
26897  /* function exit code */
26898  __pyx_L1_error:;
26899  __Pyx_XDECREF(__pyx_t_2);
26900  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
26901  __pyx_r = NULL;
26902  __pyx_L0:;
26903  __Pyx_XGIVEREF(__pyx_r);
26904  __Pyx_RefNannyFinishContext();
26905  return __pyx_r;
26906 }
26907 
26908 /* "View.MemoryView":631
26909  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
26910  *
26911  * def copy(self): # <<<<<<<<<<<<<<
26912  * cdef __Pyx_memviewslice mslice
26913  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
26914  */
26915 
26916 /* Python wrapper */
26917 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
26918 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
26919  PyObject *__pyx_r = 0;
26920  __Pyx_RefNannyDeclarations
26921  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
26922  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
26923 
26924  /* function exit code */
26925  __Pyx_RefNannyFinishContext();
26926  return __pyx_r;
26927 }
26928 
26929 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
26930  __Pyx_memviewslice __pyx_v_mslice;
26931  int __pyx_v_flags;
26932  PyObject *__pyx_r = NULL;
26933  __Pyx_RefNannyDeclarations
26934  __Pyx_memviewslice __pyx_t_1;
26935  PyObject *__pyx_t_2 = NULL;
26936  int __pyx_lineno = 0;
26937  const char *__pyx_filename = NULL;
26938  int __pyx_clineno = 0;
26939  __Pyx_RefNannySetupContext("copy", 0);
26940 
26941  /* "View.MemoryView":633
26942  * def copy(self):
26943  * cdef __Pyx_memviewslice mslice
26944  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
26945  *
26946  * slice_copy(self, &mslice)
26947  */
26948  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
26949 
26950  /* "View.MemoryView":635
26951  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
26952  *
26953  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
26954  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
26955  * self.view.itemsize,
26956  */
26957  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
26958 
26959  /* "View.MemoryView":636
26960  *
26961  * slice_copy(self, &mslice)
26962  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
26963  * self.view.itemsize,
26964  * flags|PyBUF_C_CONTIGUOUS,
26965  */
26966  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
26967  __pyx_v_mslice = __pyx_t_1;
26968 
26969  /* "View.MemoryView":641
26970  * self.dtype_is_object)
26971  *
26972  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
26973  *
26974  * def copy_fortran(self):
26975  */
26976  __Pyx_XDECREF(__pyx_r);
26977  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
26978  __Pyx_GOTREF(__pyx_t_2);
26979  __pyx_r = __pyx_t_2;
26980  __pyx_t_2 = 0;
26981  goto __pyx_L0;
26982 
26983  /* "View.MemoryView":631
26984  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
26985  *
26986  * def copy(self): # <<<<<<<<<<<<<<
26987  * cdef __Pyx_memviewslice mslice
26988  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
26989  */
26990 
26991  /* function exit code */
26992  __pyx_L1_error:;
26993  __Pyx_XDECREF(__pyx_t_2);
26994  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
26995  __pyx_r = NULL;
26996  __pyx_L0:;
26997  __Pyx_XGIVEREF(__pyx_r);
26998  __Pyx_RefNannyFinishContext();
26999  return __pyx_r;
27000 }
27001 
27002 /* "View.MemoryView":643
27003  * return memoryview_copy_from_slice(self, &mslice)
27004  *
27005  * def copy_fortran(self): # <<<<<<<<<<<<<<
27006  * cdef __Pyx_memviewslice src, dst
27007  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
27008  */
27009 
27010 /* Python wrapper */
27011 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
27012 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
27013  PyObject *__pyx_r = 0;
27014  __Pyx_RefNannyDeclarations
27015  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
27016  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
27017 
27018  /* function exit code */
27019  __Pyx_RefNannyFinishContext();
27020  return __pyx_r;
27021 }
27022 
27023 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
27024  __Pyx_memviewslice __pyx_v_src;
27025  __Pyx_memviewslice __pyx_v_dst;
27026  int __pyx_v_flags;
27027  PyObject *__pyx_r = NULL;
27028  __Pyx_RefNannyDeclarations
27029  __Pyx_memviewslice __pyx_t_1;
27030  PyObject *__pyx_t_2 = NULL;
27031  int __pyx_lineno = 0;
27032  const char *__pyx_filename = NULL;
27033  int __pyx_clineno = 0;
27034  __Pyx_RefNannySetupContext("copy_fortran", 0);
27035 
27036  /* "View.MemoryView":645
27037  * def copy_fortran(self):
27038  * cdef __Pyx_memviewslice src, dst
27039  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
27040  *
27041  * slice_copy(self, &src)
27042  */
27043  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
27044 
27045  /* "View.MemoryView":647
27046  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
27047  *
27048  * slice_copy(self, &src) # <<<<<<<<<<<<<<
27049  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
27050  * self.view.itemsize,
27051  */
27052  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
27053 
27054  /* "View.MemoryView":648
27055  *
27056  * slice_copy(self, &src)
27057  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
27058  * self.view.itemsize,
27059  * flags|PyBUF_F_CONTIGUOUS,
27060  */
27061  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
27062  __pyx_v_dst = __pyx_t_1;
27063 
27064  /* "View.MemoryView":653
27065  * self.dtype_is_object)
27066  *
27067  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
27068  *
27069  *
27070  */
27071  __Pyx_XDECREF(__pyx_r);
27072  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
27073  __Pyx_GOTREF(__pyx_t_2);
27074  __pyx_r = __pyx_t_2;
27075  __pyx_t_2 = 0;
27076  goto __pyx_L0;
27077 
27078  /* "View.MemoryView":643
27079  * return memoryview_copy_from_slice(self, &mslice)
27080  *
27081  * def copy_fortran(self): # <<<<<<<<<<<<<<
27082  * cdef __Pyx_memviewslice src, dst
27083  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
27084  */
27085 
27086  /* function exit code */
27087  __pyx_L1_error:;
27088  __Pyx_XDECREF(__pyx_t_2);
27089  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
27090  __pyx_r = NULL;
27091  __pyx_L0:;
27092  __Pyx_XGIVEREF(__pyx_r);
27093  __Pyx_RefNannyFinishContext();
27094  return __pyx_r;
27095 }
27096 
27097 /* "(tree fragment)":1
27098  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
27099  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27100  * def __setstate_cython__(self, __pyx_state):
27101  */
27102 
27103 /* Python wrapper */
27104 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
27105 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
27106  PyObject *__pyx_r = 0;
27107  __Pyx_RefNannyDeclarations
27108  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
27109  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
27110 
27111  /* function exit code */
27112  __Pyx_RefNannyFinishContext();
27113  return __pyx_r;
27114 }
27115 
27116 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
27117  PyObject *__pyx_r = NULL;
27118  __Pyx_RefNannyDeclarations
27119  PyObject *__pyx_t_1 = NULL;
27120  int __pyx_lineno = 0;
27121  const char *__pyx_filename = NULL;
27122  int __pyx_clineno = 0;
27123  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
27124 
27125  /* "(tree fragment)":2
27126  * def __reduce_cython__(self):
27127  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
27128  * def __setstate_cython__(self, __pyx_state):
27129  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27130  */
27131  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
27132  __Pyx_GOTREF(__pyx_t_1);
27133  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
27134  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27135  __PYX_ERR(1, 2, __pyx_L1_error)
27136 
27137  /* "(tree fragment)":1
27138  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
27139  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27140  * def __setstate_cython__(self, __pyx_state):
27141  */
27142 
27143  /* function exit code */
27144  __pyx_L1_error:;
27145  __Pyx_XDECREF(__pyx_t_1);
27146  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27147  __pyx_r = NULL;
27148  __Pyx_XGIVEREF(__pyx_r);
27149  __Pyx_RefNannyFinishContext();
27150  return __pyx_r;
27151 }
27152 
27153 /* "(tree fragment)":3
27154  * def __reduce_cython__(self):
27155  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27156  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
27157  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27158  */
27159 
27160 /* Python wrapper */
27161 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
27162 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
27163  PyObject *__pyx_r = 0;
27164  __Pyx_RefNannyDeclarations
27165  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
27166  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
27167 
27168  /* function exit code */
27169  __Pyx_RefNannyFinishContext();
27170  return __pyx_r;
27171 }
27172 
27173 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) {
27174  PyObject *__pyx_r = NULL;
27175  __Pyx_RefNannyDeclarations
27176  PyObject *__pyx_t_1 = NULL;
27177  int __pyx_lineno = 0;
27178  const char *__pyx_filename = NULL;
27179  int __pyx_clineno = 0;
27180  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
27181 
27182  /* "(tree fragment)":4
27183  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27184  * def __setstate_cython__(self, __pyx_state):
27185  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
27186  */
27187  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
27188  __Pyx_GOTREF(__pyx_t_1);
27189  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
27190  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27191  __PYX_ERR(1, 4, __pyx_L1_error)
27192 
27193  /* "(tree fragment)":3
27194  * def __reduce_cython__(self):
27195  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27196  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
27197  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27198  */
27199 
27200  /* function exit code */
27201  __pyx_L1_error:;
27202  __Pyx_XDECREF(__pyx_t_1);
27203  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27204  __pyx_r = NULL;
27205  __Pyx_XGIVEREF(__pyx_r);
27206  __Pyx_RefNannyFinishContext();
27207  return __pyx_r;
27208 }
27209 
27210 /* "View.MemoryView":657
27211  *
27212  * @cname('__pyx_memoryview_new')
27213  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
27214  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
27215  * result.typeinfo = typeinfo
27216  */
27217 
27218 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
27219  struct __pyx_memoryview_obj *__pyx_v_result = 0;
27220  PyObject *__pyx_r = NULL;
27221  __Pyx_RefNannyDeclarations
27222  PyObject *__pyx_t_1 = NULL;
27223  PyObject *__pyx_t_2 = NULL;
27224  PyObject *__pyx_t_3 = NULL;
27225  int __pyx_lineno = 0;
27226  const char *__pyx_filename = NULL;
27227  int __pyx_clineno = 0;
27228  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
27229 
27230  /* "View.MemoryView":658
27231  * @cname('__pyx_memoryview_new')
27232  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
27233  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
27234  * result.typeinfo = typeinfo
27235  * return result
27236  */
27237  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
27238  __Pyx_GOTREF(__pyx_t_1);
27239  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
27240  __Pyx_GOTREF(__pyx_t_2);
27241  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
27242  __Pyx_GOTREF(__pyx_t_3);
27243  __Pyx_INCREF(__pyx_v_o);
27244  __Pyx_GIVEREF(__pyx_v_o);
27245  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
27246  __Pyx_GIVEREF(__pyx_t_1);
27247  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
27248  __Pyx_GIVEREF(__pyx_t_2);
27249  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
27250  __pyx_t_1 = 0;
27251  __pyx_t_2 = 0;
27252  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
27253  __Pyx_GOTREF(__pyx_t_2);
27254  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27255  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
27256  __pyx_t_2 = 0;
27257 
27258  /* "View.MemoryView":659
27259  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
27260  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
27261  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
27262  * return result
27263  *
27264  */
27265  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
27266 
27267  /* "View.MemoryView":660
27268  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
27269  * result.typeinfo = typeinfo
27270  * return result # <<<<<<<<<<<<<<
27271  *
27272  * @cname('__pyx_memoryview_check')
27273  */
27274  __Pyx_XDECREF(__pyx_r);
27275  __Pyx_INCREF(((PyObject *)__pyx_v_result));
27276  __pyx_r = ((PyObject *)__pyx_v_result);
27277  goto __pyx_L0;
27278 
27279  /* "View.MemoryView":657
27280  *
27281  * @cname('__pyx_memoryview_new')
27282  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
27283  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
27284  * result.typeinfo = typeinfo
27285  */
27286 
27287  /* function exit code */
27288  __pyx_L1_error:;
27289  __Pyx_XDECREF(__pyx_t_1);
27290  __Pyx_XDECREF(__pyx_t_2);
27291  __Pyx_XDECREF(__pyx_t_3);
27292  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
27293  __pyx_r = 0;
27294  __pyx_L0:;
27295  __Pyx_XDECREF((PyObject *)__pyx_v_result);
27296  __Pyx_XGIVEREF(__pyx_r);
27297  __Pyx_RefNannyFinishContext();
27298  return __pyx_r;
27299 }
27300 
27301 /* "View.MemoryView":663
27302  *
27303  * @cname('__pyx_memoryview_check')
27304  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
27305  * return isinstance(o, memoryview)
27306  *
27307  */
27308 
27309 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
27310  int __pyx_r;
27311  __Pyx_RefNannyDeclarations
27312  int __pyx_t_1;
27313  __Pyx_RefNannySetupContext("memoryview_check", 0);
27314 
27315  /* "View.MemoryView":664
27316  * @cname('__pyx_memoryview_check')
27317  * cdef inline bint memoryview_check(object o):
27318  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
27319  *
27320  * cdef tuple _unellipsify(object index, int ndim):
27321  */
27322  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
27323  __pyx_r = __pyx_t_1;
27324  goto __pyx_L0;
27325 
27326  /* "View.MemoryView":663
27327  *
27328  * @cname('__pyx_memoryview_check')
27329  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
27330  * return isinstance(o, memoryview)
27331  *
27332  */
27333 
27334  /* function exit code */
27335  __pyx_L0:;
27336  __Pyx_RefNannyFinishContext();
27337  return __pyx_r;
27338 }
27339 
27340 /* "View.MemoryView":666
27341  * return isinstance(o, memoryview)
27342  *
27343  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
27344  * """
27345  * Replace all ellipses with full slices and fill incomplete indices with
27346  */
27347 
27348 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
27349  PyObject *__pyx_v_tup = NULL;
27350  PyObject *__pyx_v_result = NULL;
27351  int __pyx_v_have_slices;
27352  int __pyx_v_seen_ellipsis;
27353  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
27354  PyObject *__pyx_v_item = NULL;
27355  Py_ssize_t __pyx_v_nslices;
27356  PyObject *__pyx_r = NULL;
27357  __Pyx_RefNannyDeclarations
27358  int __pyx_t_1;
27359  int __pyx_t_2;
27360  PyObject *__pyx_t_3 = NULL;
27361  PyObject *__pyx_t_4 = NULL;
27362  Py_ssize_t __pyx_t_5;
27363  PyObject *(*__pyx_t_6)(PyObject *);
27364  PyObject *__pyx_t_7 = NULL;
27365  Py_ssize_t __pyx_t_8;
27366  int __pyx_t_9;
27367  int __pyx_t_10;
27368  PyObject *__pyx_t_11 = NULL;
27369  int __pyx_lineno = 0;
27370  const char *__pyx_filename = NULL;
27371  int __pyx_clineno = 0;
27372  __Pyx_RefNannySetupContext("_unellipsify", 0);
27373 
27374  /* "View.MemoryView":671
27375  * full slices.
27376  * """
27377  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
27378  * tup = (index,)
27379  * else:
27380  */
27381  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
27382  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
27383  if (__pyx_t_2) {
27384 
27385  /* "View.MemoryView":672
27386  * """
27387  * if not isinstance(index, tuple):
27388  * tup = (index,) # <<<<<<<<<<<<<<
27389  * else:
27390  * tup = index
27391  */
27392  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
27393  __Pyx_GOTREF(__pyx_t_3);
27394  __Pyx_INCREF(__pyx_v_index);
27395  __Pyx_GIVEREF(__pyx_v_index);
27396  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
27397  __pyx_v_tup = __pyx_t_3;
27398  __pyx_t_3 = 0;
27399 
27400  /* "View.MemoryView":671
27401  * full slices.
27402  * """
27403  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
27404  * tup = (index,)
27405  * else:
27406  */
27407  goto __pyx_L3;
27408  }
27409 
27410  /* "View.MemoryView":674
27411  * tup = (index,)
27412  * else:
27413  * tup = index # <<<<<<<<<<<<<<
27414  *
27415  * result = []
27416  */
27417  /*else*/ {
27418  __Pyx_INCREF(__pyx_v_index);
27419  __pyx_v_tup = __pyx_v_index;
27420  }
27421  __pyx_L3:;
27422 
27423  /* "View.MemoryView":676
27424  * tup = index
27425  *
27426  * result = [] # <<<<<<<<<<<<<<
27427  * have_slices = False
27428  * seen_ellipsis = False
27429  */
27430  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
27431  __Pyx_GOTREF(__pyx_t_3);
27432  __pyx_v_result = ((PyObject*)__pyx_t_3);
27433  __pyx_t_3 = 0;
27434 
27435  /* "View.MemoryView":677
27436  *
27437  * result = []
27438  * have_slices = False # <<<<<<<<<<<<<<
27439  * seen_ellipsis = False
27440  * for idx, item in enumerate(tup):
27441  */
27442  __pyx_v_have_slices = 0;
27443 
27444  /* "View.MemoryView":678
27445  * result = []
27446  * have_slices = False
27447  * seen_ellipsis = False # <<<<<<<<<<<<<<
27448  * for idx, item in enumerate(tup):
27449  * if item is Ellipsis:
27450  */
27451  __pyx_v_seen_ellipsis = 0;
27452 
27453  /* "View.MemoryView":679
27454  * have_slices = False
27455  * seen_ellipsis = False
27456  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
27457  * if item is Ellipsis:
27458  * if not seen_ellipsis:
27459  */
27460  __Pyx_INCREF(__pyx_int_0);
27461  __pyx_t_3 = __pyx_int_0;
27462  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
27463  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
27464  __pyx_t_6 = NULL;
27465  } else {
27466  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
27467  __Pyx_GOTREF(__pyx_t_4);
27468  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
27469  }
27470  for (;;) {
27471  if (likely(!__pyx_t_6)) {
27472  if (likely(PyList_CheckExact(__pyx_t_4))) {
27473  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
27474  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27475  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
27476  #else
27477  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
27478  __Pyx_GOTREF(__pyx_t_7);
27479  #endif
27480  } else {
27481  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
27482  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27483  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
27484  #else
27485  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
27486  __Pyx_GOTREF(__pyx_t_7);
27487  #endif
27488  }
27489  } else {
27490  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
27491  if (unlikely(!__pyx_t_7)) {
27492  PyObject* exc_type = PyErr_Occurred();
27493  if (exc_type) {
27494  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
27495  else __PYX_ERR(1, 679, __pyx_L1_error)
27496  }
27497  break;
27498  }
27499  __Pyx_GOTREF(__pyx_t_7);
27500  }
27501  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
27502  __pyx_t_7 = 0;
27503  __Pyx_INCREF(__pyx_t_3);
27504  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
27505  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
27506  __Pyx_GOTREF(__pyx_t_7);
27507  __Pyx_DECREF(__pyx_t_3);
27508  __pyx_t_3 = __pyx_t_7;
27509  __pyx_t_7 = 0;
27510 
27511  /* "View.MemoryView":680
27512  * seen_ellipsis = False
27513  * for idx, item in enumerate(tup):
27514  * if item is Ellipsis: # <<<<<<<<<<<<<<
27515  * if not seen_ellipsis:
27516  * result.extend([slice(None)] * (ndim - len(tup) + 1))
27517  */
27518  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
27519  __pyx_t_1 = (__pyx_t_2 != 0);
27520  if (__pyx_t_1) {
27521 
27522  /* "View.MemoryView":681
27523  * for idx, item in enumerate(tup):
27524  * if item is Ellipsis:
27525  * if not seen_ellipsis: # <<<<<<<<<<<<<<
27526  * result.extend([slice(None)] * (ndim - len(tup) + 1))
27527  * seen_ellipsis = True
27528  */
27529  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
27530  if (__pyx_t_1) {
27531 
27532  /* "View.MemoryView":682
27533  * if item is Ellipsis:
27534  * if not seen_ellipsis:
27535  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
27536  * seen_ellipsis = True
27537  * else:
27538  */
27539  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
27540  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
27541  __Pyx_GOTREF(__pyx_t_7);
27542  { Py_ssize_t __pyx_temp;
27543  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
27544  __Pyx_INCREF(__pyx_slice__26);
27545  __Pyx_GIVEREF(__pyx_slice__26);
27546  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__26);
27547  }
27548  }
27549  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
27550  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27551 
27552  /* "View.MemoryView":683
27553  * if not seen_ellipsis:
27554  * result.extend([slice(None)] * (ndim - len(tup) + 1))
27555  * seen_ellipsis = True # <<<<<<<<<<<<<<
27556  * else:
27557  * result.append(slice(None))
27558  */
27559  __pyx_v_seen_ellipsis = 1;
27560 
27561  /* "View.MemoryView":681
27562  * for idx, item in enumerate(tup):
27563  * if item is Ellipsis:
27564  * if not seen_ellipsis: # <<<<<<<<<<<<<<
27565  * result.extend([slice(None)] * (ndim - len(tup) + 1))
27566  * seen_ellipsis = True
27567  */
27568  goto __pyx_L7;
27569  }
27570 
27571  /* "View.MemoryView":685
27572  * seen_ellipsis = True
27573  * else:
27574  * result.append(slice(None)) # <<<<<<<<<<<<<<
27575  * have_slices = True
27576  * else:
27577  */
27578  /*else*/ {
27579  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__26); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
27580  }
27581  __pyx_L7:;
27582 
27583  /* "View.MemoryView":686
27584  * else:
27585  * result.append(slice(None))
27586  * have_slices = True # <<<<<<<<<<<<<<
27587  * else:
27588  * if not isinstance(item, slice) and not PyIndex_Check(item):
27589  */
27590  __pyx_v_have_slices = 1;
27591 
27592  /* "View.MemoryView":680
27593  * seen_ellipsis = False
27594  * for idx, item in enumerate(tup):
27595  * if item is Ellipsis: # <<<<<<<<<<<<<<
27596  * if not seen_ellipsis:
27597  * result.extend([slice(None)] * (ndim - len(tup) + 1))
27598  */
27599  goto __pyx_L6;
27600  }
27601 
27602  /* "View.MemoryView":688
27603  * have_slices = True
27604  * else:
27605  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
27606  * raise TypeError("Cannot index with type '%s'" % type(item))
27607  *
27608  */
27609  /*else*/ {
27610  __pyx_t_2 = PySlice_Check(__pyx_v_item);
27611  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
27612  if (__pyx_t_10) {
27613  } else {
27614  __pyx_t_1 = __pyx_t_10;
27615  goto __pyx_L9_bool_binop_done;
27616  }
27617  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
27618  __pyx_t_1 = __pyx_t_10;
27619  __pyx_L9_bool_binop_done:;
27620  if (unlikely(__pyx_t_1)) {
27621 
27622  /* "View.MemoryView":689
27623  * else:
27624  * if not isinstance(item, slice) and not PyIndex_Check(item):
27625  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
27626  *
27627  * have_slices = have_slices or isinstance(item, slice)
27628  */
27629  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
27630  __Pyx_GOTREF(__pyx_t_7);
27631  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
27632  __Pyx_GOTREF(__pyx_t_11);
27633  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27634  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
27635  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
27636  __PYX_ERR(1, 689, __pyx_L1_error)
27637 
27638  /* "View.MemoryView":688
27639  * have_slices = True
27640  * else:
27641  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
27642  * raise TypeError("Cannot index with type '%s'" % type(item))
27643  *
27644  */
27645  }
27646 
27647  /* "View.MemoryView":691
27648  * raise TypeError("Cannot index with type '%s'" % type(item))
27649  *
27650  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
27651  * result.append(item)
27652  *
27653  */
27654  __pyx_t_10 = (__pyx_v_have_slices != 0);
27655  if (!__pyx_t_10) {
27656  } else {
27657  __pyx_t_1 = __pyx_t_10;
27658  goto __pyx_L11_bool_binop_done;
27659  }
27660  __pyx_t_10 = PySlice_Check(__pyx_v_item);
27661  __pyx_t_2 = (__pyx_t_10 != 0);
27662  __pyx_t_1 = __pyx_t_2;
27663  __pyx_L11_bool_binop_done:;
27664  __pyx_v_have_slices = __pyx_t_1;
27665 
27666  /* "View.MemoryView":692
27667  *
27668  * have_slices = have_slices or isinstance(item, slice)
27669  * result.append(item) # <<<<<<<<<<<<<<
27670  *
27671  * nslices = ndim - len(result)
27672  */
27673  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
27674  }
27675  __pyx_L6:;
27676 
27677  /* "View.MemoryView":679
27678  * have_slices = False
27679  * seen_ellipsis = False
27680  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
27681  * if item is Ellipsis:
27682  * if not seen_ellipsis:
27683  */
27684  }
27685  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27686  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27687 
27688  /* "View.MemoryView":694
27689  * result.append(item)
27690  *
27691  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
27692  * if nslices:
27693  * result.extend([slice(None)] * nslices)
27694  */
27695  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
27696  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
27697 
27698  /* "View.MemoryView":695
27699  *
27700  * nslices = ndim - len(result)
27701  * if nslices: # <<<<<<<<<<<<<<
27702  * result.extend([slice(None)] * nslices)
27703  *
27704  */
27705  __pyx_t_1 = (__pyx_v_nslices != 0);
27706  if (__pyx_t_1) {
27707 
27708  /* "View.MemoryView":696
27709  * nslices = ndim - len(result)
27710  * if nslices:
27711  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
27712  *
27713  * return have_slices or nslices, tuple(result)
27714  */
27715  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
27716  __Pyx_GOTREF(__pyx_t_3);
27717  { Py_ssize_t __pyx_temp;
27718  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
27719  __Pyx_INCREF(__pyx_slice__26);
27720  __Pyx_GIVEREF(__pyx_slice__26);
27721  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__26);
27722  }
27723  }
27724  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
27725  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27726 
27727  /* "View.MemoryView":695
27728  *
27729  * nslices = ndim - len(result)
27730  * if nslices: # <<<<<<<<<<<<<<
27731  * result.extend([slice(None)] * nslices)
27732  *
27733  */
27734  }
27735 
27736  /* "View.MemoryView":698
27737  * result.extend([slice(None)] * nslices)
27738  *
27739  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
27740  *
27741  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
27742  */
27743  __Pyx_XDECREF(__pyx_r);
27744  if (!__pyx_v_have_slices) {
27745  } else {
27746  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
27747  __Pyx_GOTREF(__pyx_t_4);
27748  __pyx_t_3 = __pyx_t_4;
27749  __pyx_t_4 = 0;
27750  goto __pyx_L14_bool_binop_done;
27751  }
27752  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
27753  __Pyx_GOTREF(__pyx_t_4);
27754  __pyx_t_3 = __pyx_t_4;
27755  __pyx_t_4 = 0;
27756  __pyx_L14_bool_binop_done:;
27757  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
27758  __Pyx_GOTREF(__pyx_t_4);
27759  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
27760  __Pyx_GOTREF(__pyx_t_11);
27761  __Pyx_GIVEREF(__pyx_t_3);
27762  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
27763  __Pyx_GIVEREF(__pyx_t_4);
27764  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
27765  __pyx_t_3 = 0;
27766  __pyx_t_4 = 0;
27767  __pyx_r = ((PyObject*)__pyx_t_11);
27768  __pyx_t_11 = 0;
27769  goto __pyx_L0;
27770 
27771  /* "View.MemoryView":666
27772  * return isinstance(o, memoryview)
27773  *
27774  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
27775  * """
27776  * Replace all ellipses with full slices and fill incomplete indices with
27777  */
27778 
27779  /* function exit code */
27780  __pyx_L1_error:;
27781  __Pyx_XDECREF(__pyx_t_3);
27782  __Pyx_XDECREF(__pyx_t_4);
27783  __Pyx_XDECREF(__pyx_t_7);
27784  __Pyx_XDECREF(__pyx_t_11);
27785  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
27786  __pyx_r = 0;
27787  __pyx_L0:;
27788  __Pyx_XDECREF(__pyx_v_tup);
27789  __Pyx_XDECREF(__pyx_v_result);
27790  __Pyx_XDECREF(__pyx_v_idx);
27791  __Pyx_XDECREF(__pyx_v_item);
27792  __Pyx_XGIVEREF(__pyx_r);
27793  __Pyx_RefNannyFinishContext();
27794  return __pyx_r;
27795 }
27796 
27797 /* "View.MemoryView":700
27798  * return have_slices or nslices, tuple(result)
27799  *
27800  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
27801  * for suboffset in suboffsets[:ndim]:
27802  * if suboffset >= 0:
27803  */
27804 
27805 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
27806  Py_ssize_t __pyx_v_suboffset;
27807  PyObject *__pyx_r = NULL;
27808  __Pyx_RefNannyDeclarations
27809  Py_ssize_t *__pyx_t_1;
27810  Py_ssize_t *__pyx_t_2;
27811  Py_ssize_t *__pyx_t_3;
27812  int __pyx_t_4;
27813  PyObject *__pyx_t_5 = NULL;
27814  int __pyx_lineno = 0;
27815  const char *__pyx_filename = NULL;
27816  int __pyx_clineno = 0;
27817  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
27818 
27819  /* "View.MemoryView":701
27820  *
27821  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
27822  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
27823  * if suboffset >= 0:
27824  * raise ValueError("Indirect dimensions not supported")
27825  */
27826  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
27827  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
27828  __pyx_t_1 = __pyx_t_3;
27829  __pyx_v_suboffset = (__pyx_t_1[0]);
27830 
27831  /* "View.MemoryView":702
27832  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
27833  * for suboffset in suboffsets[:ndim]:
27834  * if suboffset >= 0: # <<<<<<<<<<<<<<
27835  * raise ValueError("Indirect dimensions not supported")
27836  *
27837  */
27838  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
27839  if (unlikely(__pyx_t_4)) {
27840 
27841  /* "View.MemoryView":703
27842  * for suboffset in suboffsets[:ndim]:
27843  * if suboffset >= 0:
27844  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
27845  *
27846  *
27847  */
27848  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
27849  __Pyx_GOTREF(__pyx_t_5);
27850  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
27851  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27852  __PYX_ERR(1, 703, __pyx_L1_error)
27853 
27854  /* "View.MemoryView":702
27855  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
27856  * for suboffset in suboffsets[:ndim]:
27857  * if suboffset >= 0: # <<<<<<<<<<<<<<
27858  * raise ValueError("Indirect dimensions not supported")
27859  *
27860  */
27861  }
27862  }
27863 
27864  /* "View.MemoryView":700
27865  * return have_slices or nslices, tuple(result)
27866  *
27867  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
27868  * for suboffset in suboffsets[:ndim]:
27869  * if suboffset >= 0:
27870  */
27871 
27872  /* function exit code */
27873  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
27874  goto __pyx_L0;
27875  __pyx_L1_error:;
27876  __Pyx_XDECREF(__pyx_t_5);
27877  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
27878  __pyx_r = 0;
27879  __pyx_L0:;
27880  __Pyx_XGIVEREF(__pyx_r);
27881  __Pyx_RefNannyFinishContext();
27882  return __pyx_r;
27883 }
27884 
27885 /* "View.MemoryView":710
27886  *
27887  * @cname('__pyx_memview_slice')
27888  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
27889  * cdef int new_ndim = 0, suboffset_dim = -1, dim
27890  * cdef bint negative_step
27891  */
27892 
27893 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
27894  int __pyx_v_new_ndim;
27895  int __pyx_v_suboffset_dim;
27896  int __pyx_v_dim;
27897  __Pyx_memviewslice __pyx_v_src;
27898  __Pyx_memviewslice __pyx_v_dst;
27899  __Pyx_memviewslice *__pyx_v_p_src;
27900  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
27901  __Pyx_memviewslice *__pyx_v_p_dst;
27902  int *__pyx_v_p_suboffset_dim;
27903  Py_ssize_t __pyx_v_start;
27904  Py_ssize_t __pyx_v_stop;
27905  Py_ssize_t __pyx_v_step;
27906  int __pyx_v_have_start;
27907  int __pyx_v_have_stop;
27908  int __pyx_v_have_step;
27909  PyObject *__pyx_v_index = NULL;
27910  struct __pyx_memoryview_obj *__pyx_r = NULL;
27911  __Pyx_RefNannyDeclarations
27912  int __pyx_t_1;
27913  int __pyx_t_2;
27914  PyObject *__pyx_t_3 = NULL;
27915  struct __pyx_memoryview_obj *__pyx_t_4;
27916  char *__pyx_t_5;
27917  int __pyx_t_6;
27918  Py_ssize_t __pyx_t_7;
27919  PyObject *(*__pyx_t_8)(PyObject *);
27920  PyObject *__pyx_t_9 = NULL;
27921  Py_ssize_t __pyx_t_10;
27922  int __pyx_t_11;
27923  Py_ssize_t __pyx_t_12;
27924  int __pyx_lineno = 0;
27925  const char *__pyx_filename = NULL;
27926  int __pyx_clineno = 0;
27927  __Pyx_RefNannySetupContext("memview_slice", 0);
27928 
27929  /* "View.MemoryView":711
27930  * @cname('__pyx_memview_slice')
27931  * cdef memoryview memview_slice(memoryview memview, object indices):
27932  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
27933  * cdef bint negative_step
27934  * cdef __Pyx_memviewslice src, dst
27935  */
27936  __pyx_v_new_ndim = 0;
27937  __pyx_v_suboffset_dim = -1;
27938 
27939  /* "View.MemoryView":718
27940  *
27941  *
27942  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
27943  *
27944  * cdef _memoryviewslice memviewsliceobj
27945  */
27946  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
27947 
27948  /* "View.MemoryView":722
27949  * cdef _memoryviewslice memviewsliceobj
27950  *
27951  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
27952  *
27953  * if isinstance(memview, _memoryviewslice):
27954  */
27955  #ifndef CYTHON_WITHOUT_ASSERTIONS
27956  if (unlikely(!Py_OptimizeFlag)) {
27957  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
27958  PyErr_SetNone(PyExc_AssertionError);
27959  __PYX_ERR(1, 722, __pyx_L1_error)
27960  }
27961  }
27962  #endif
27963 
27964  /* "View.MemoryView":724
27965  * assert memview.view.ndim > 0
27966  *
27967  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
27968  * memviewsliceobj = memview
27969  * p_src = &memviewsliceobj.from_slice
27970  */
27971  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
27972  __pyx_t_2 = (__pyx_t_1 != 0);
27973  if (__pyx_t_2) {
27974 
27975  /* "View.MemoryView":725
27976  *
27977  * if isinstance(memview, _memoryviewslice):
27978  * memviewsliceobj = memview # <<<<<<<<<<<<<<
27979  * p_src = &memviewsliceobj.from_slice
27980  * else:
27981  */
27982  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
27983  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
27984  __Pyx_INCREF(__pyx_t_3);
27985  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
27986  __pyx_t_3 = 0;
27987 
27988  /* "View.MemoryView":726
27989  * if isinstance(memview, _memoryviewslice):
27990  * memviewsliceobj = memview
27991  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
27992  * else:
27993  * slice_copy(memview, &src)
27994  */
27995  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
27996 
27997  /* "View.MemoryView":724
27998  * assert memview.view.ndim > 0
27999  *
28000  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
28001  * memviewsliceobj = memview
28002  * p_src = &memviewsliceobj.from_slice
28003  */
28004  goto __pyx_L3;
28005  }
28006 
28007  /* "View.MemoryView":728
28008  * p_src = &memviewsliceobj.from_slice
28009  * else:
28010  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
28011  * p_src = &src
28012  *
28013  */
28014  /*else*/ {
28015  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
28016 
28017  /* "View.MemoryView":729
28018  * else:
28019  * slice_copy(memview, &src)
28020  * p_src = &src # <<<<<<<<<<<<<<
28021  *
28022  *
28023  */
28024  __pyx_v_p_src = (&__pyx_v_src);
28025  }
28026  __pyx_L3:;
28027 
28028  /* "View.MemoryView":735
28029  *
28030  *
28031  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
28032  * dst.data = p_src.data
28033  *
28034  */
28035  __pyx_t_4 = __pyx_v_p_src->memview;
28036  __pyx_v_dst.memview = __pyx_t_4;
28037 
28038  /* "View.MemoryView":736
28039  *
28040  * dst.memview = p_src.memview
28041  * dst.data = p_src.data # <<<<<<<<<<<<<<
28042  *
28043  *
28044  */
28045  __pyx_t_5 = __pyx_v_p_src->data;
28046  __pyx_v_dst.data = __pyx_t_5;
28047 
28048  /* "View.MemoryView":741
28049  *
28050  *
28051  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
28052  * cdef int *p_suboffset_dim = &suboffset_dim
28053  * cdef Py_ssize_t start, stop, step
28054  */
28055  __pyx_v_p_dst = (&__pyx_v_dst);
28056 
28057  /* "View.MemoryView":742
28058  *
28059  * cdef __Pyx_memviewslice *p_dst = &dst
28060  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
28061  * cdef Py_ssize_t start, stop, step
28062  * cdef bint have_start, have_stop, have_step
28063  */
28064  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
28065 
28066  /* "View.MemoryView":746
28067  * cdef bint have_start, have_stop, have_step
28068  *
28069  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
28070  * if PyIndex_Check(index):
28071  * slice_memviewslice(
28072  */
28073  __pyx_t_6 = 0;
28074  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
28075  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
28076  __pyx_t_8 = NULL;
28077  } else {
28078  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
28079  __Pyx_GOTREF(__pyx_t_3);
28080  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
28081  }
28082  for (;;) {
28083  if (likely(!__pyx_t_8)) {
28084  if (likely(PyList_CheckExact(__pyx_t_3))) {
28085  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
28086  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28087  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
28088  #else
28089  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
28090  __Pyx_GOTREF(__pyx_t_9);
28091  #endif
28092  } else {
28093  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
28094  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28095  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
28096  #else
28097  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
28098  __Pyx_GOTREF(__pyx_t_9);
28099  #endif
28100  }
28101  } else {
28102  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
28103  if (unlikely(!__pyx_t_9)) {
28104  PyObject* exc_type = PyErr_Occurred();
28105  if (exc_type) {
28106  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
28107  else __PYX_ERR(1, 746, __pyx_L1_error)
28108  }
28109  break;
28110  }
28111  __Pyx_GOTREF(__pyx_t_9);
28112  }
28113  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
28114  __pyx_t_9 = 0;
28115  __pyx_v_dim = __pyx_t_6;
28116  __pyx_t_6 = (__pyx_t_6 + 1);
28117 
28118  /* "View.MemoryView":747
28119  *
28120  * for dim, index in enumerate(indices):
28121  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
28122  * slice_memviewslice(
28123  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
28124  */
28125  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
28126  if (__pyx_t_2) {
28127 
28128  /* "View.MemoryView":751
28129  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
28130  * dim, new_ndim, p_suboffset_dim,
28131  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
28132  * 0, 0, 0, # have_{start,stop,step}
28133  * False)
28134  */
28135  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
28136 
28137  /* "View.MemoryView":748
28138  * for dim, index in enumerate(indices):
28139  * if PyIndex_Check(index):
28140  * slice_memviewslice( # <<<<<<<<<<<<<<
28141  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
28142  * dim, new_ndim, p_suboffset_dim,
28143  */
28144  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
28145 
28146  /* "View.MemoryView":747
28147  *
28148  * for dim, index in enumerate(indices):
28149  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
28150  * slice_memviewslice(
28151  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
28152  */
28153  goto __pyx_L6;
28154  }
28155 
28156  /* "View.MemoryView":754
28157  * 0, 0, 0, # have_{start,stop,step}
28158  * False)
28159  * elif index is None: # <<<<<<<<<<<<<<
28160  * p_dst.shape[new_ndim] = 1
28161  * p_dst.strides[new_ndim] = 0
28162  */
28163  __pyx_t_2 = (__pyx_v_index == Py_None);
28164  __pyx_t_1 = (__pyx_t_2 != 0);
28165  if (__pyx_t_1) {
28166 
28167  /* "View.MemoryView":755
28168  * False)
28169  * elif index is None:
28170  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
28171  * p_dst.strides[new_ndim] = 0
28172  * p_dst.suboffsets[new_ndim] = -1
28173  */
28174  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
28175 
28176  /* "View.MemoryView":756
28177  * elif index is None:
28178  * p_dst.shape[new_ndim] = 1
28179  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
28180  * p_dst.suboffsets[new_ndim] = -1
28181  * new_ndim += 1
28182  */
28183  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
28184 
28185  /* "View.MemoryView":757
28186  * p_dst.shape[new_ndim] = 1
28187  * p_dst.strides[new_ndim] = 0
28188  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
28189  * new_ndim += 1
28190  * else:
28191  */
28192  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
28193 
28194  /* "View.MemoryView":758
28195  * p_dst.strides[new_ndim] = 0
28196  * p_dst.suboffsets[new_ndim] = -1
28197  * new_ndim += 1 # <<<<<<<<<<<<<<
28198  * else:
28199  * start = index.start or 0
28200  */
28201  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
28202 
28203  /* "View.MemoryView":754
28204  * 0, 0, 0, # have_{start,stop,step}
28205  * False)
28206  * elif index is None: # <<<<<<<<<<<<<<
28207  * p_dst.shape[new_ndim] = 1
28208  * p_dst.strides[new_ndim] = 0
28209  */
28210  goto __pyx_L6;
28211  }
28212 
28213  /* "View.MemoryView":760
28214  * new_ndim += 1
28215  * else:
28216  * start = index.start or 0 # <<<<<<<<<<<<<<
28217  * stop = index.stop or 0
28218  * step = index.step or 0
28219  */
28220  /*else*/ {
28221  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
28222  __Pyx_GOTREF(__pyx_t_9);
28223  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
28224  if (!__pyx_t_1) {
28225  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28226  } else {
28227  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
28228  __pyx_t_10 = __pyx_t_12;
28229  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28230  goto __pyx_L7_bool_binop_done;
28231  }
28232  __pyx_t_10 = 0;
28233  __pyx_L7_bool_binop_done:;
28234  __pyx_v_start = __pyx_t_10;
28235 
28236  /* "View.MemoryView":761
28237  * else:
28238  * start = index.start or 0
28239  * stop = index.stop or 0 # <<<<<<<<<<<<<<
28240  * step = index.step or 0
28241  *
28242  */
28243  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
28244  __Pyx_GOTREF(__pyx_t_9);
28245  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
28246  if (!__pyx_t_1) {
28247  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28248  } else {
28249  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
28250  __pyx_t_10 = __pyx_t_12;
28251  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28252  goto __pyx_L9_bool_binop_done;
28253  }
28254  __pyx_t_10 = 0;
28255  __pyx_L9_bool_binop_done:;
28256  __pyx_v_stop = __pyx_t_10;
28257 
28258  /* "View.MemoryView":762
28259  * start = index.start or 0
28260  * stop = index.stop or 0
28261  * step = index.step or 0 # <<<<<<<<<<<<<<
28262  *
28263  * have_start = index.start is not None
28264  */
28265  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
28266  __Pyx_GOTREF(__pyx_t_9);
28267  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
28268  if (!__pyx_t_1) {
28269  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28270  } else {
28271  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
28272  __pyx_t_10 = __pyx_t_12;
28273  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28274  goto __pyx_L11_bool_binop_done;
28275  }
28276  __pyx_t_10 = 0;
28277  __pyx_L11_bool_binop_done:;
28278  __pyx_v_step = __pyx_t_10;
28279 
28280  /* "View.MemoryView":764
28281  * step = index.step or 0
28282  *
28283  * have_start = index.start is not None # <<<<<<<<<<<<<<
28284  * have_stop = index.stop is not None
28285  * have_step = index.step is not None
28286  */
28287  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
28288  __Pyx_GOTREF(__pyx_t_9);
28289  __pyx_t_1 = (__pyx_t_9 != Py_None);
28290  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28291  __pyx_v_have_start = __pyx_t_1;
28292 
28293  /* "View.MemoryView":765
28294  *
28295  * have_start = index.start is not None
28296  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
28297  * have_step = index.step is not None
28298  *
28299  */
28300  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
28301  __Pyx_GOTREF(__pyx_t_9);
28302  __pyx_t_1 = (__pyx_t_9 != Py_None);
28303  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28304  __pyx_v_have_stop = __pyx_t_1;
28305 
28306  /* "View.MemoryView":766
28307  * have_start = index.start is not None
28308  * have_stop = index.stop is not None
28309  * have_step = index.step is not None # <<<<<<<<<<<<<<
28310  *
28311  * slice_memviewslice(
28312  */
28313  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
28314  __Pyx_GOTREF(__pyx_t_9);
28315  __pyx_t_1 = (__pyx_t_9 != Py_None);
28316  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28317  __pyx_v_have_step = __pyx_t_1;
28318 
28319  /* "View.MemoryView":768
28320  * have_step = index.step is not None
28321  *
28322  * slice_memviewslice( # <<<<<<<<<<<<<<
28323  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
28324  * dim, new_ndim, p_suboffset_dim,
28325  */
28326  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
28327 
28328  /* "View.MemoryView":774
28329  * have_start, have_stop, have_step,
28330  * True)
28331  * new_ndim += 1 # <<<<<<<<<<<<<<
28332  *
28333  * if isinstance(memview, _memoryviewslice):
28334  */
28335  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
28336  }
28337  __pyx_L6:;
28338 
28339  /* "View.MemoryView":746
28340  * cdef bint have_start, have_stop, have_step
28341  *
28342  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
28343  * if PyIndex_Check(index):
28344  * slice_memviewslice(
28345  */
28346  }
28347  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28348 
28349  /* "View.MemoryView":776
28350  * new_ndim += 1
28351  *
28352  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
28353  * return memoryview_fromslice(dst, new_ndim,
28354  * memviewsliceobj.to_object_func,
28355  */
28356  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
28357  __pyx_t_2 = (__pyx_t_1 != 0);
28358  if (__pyx_t_2) {
28359 
28360  /* "View.MemoryView":777
28361  *
28362  * if isinstance(memview, _memoryviewslice):
28363  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
28364  * memviewsliceobj.to_object_func,
28365  * memviewsliceobj.to_dtype_func,
28366  */
28367  __Pyx_XDECREF(((PyObject *)__pyx_r));
28368 
28369  /* "View.MemoryView":778
28370  * if isinstance(memview, _memoryviewslice):
28371  * return memoryview_fromslice(dst, new_ndim,
28372  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
28373  * memviewsliceobj.to_dtype_func,
28374  * memview.dtype_is_object)
28375  */
28376  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
28377 
28378  /* "View.MemoryView":779
28379  * return memoryview_fromslice(dst, new_ndim,
28380  * memviewsliceobj.to_object_func,
28381  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
28382  * memview.dtype_is_object)
28383  * else:
28384  */
28385  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
28386 
28387  /* "View.MemoryView":777
28388  *
28389  * if isinstance(memview, _memoryviewslice):
28390  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
28391  * memviewsliceobj.to_object_func,
28392  * memviewsliceobj.to_dtype_func,
28393  */
28394  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
28395  __Pyx_GOTREF(__pyx_t_3);
28396  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
28397  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
28398  __pyx_t_3 = 0;
28399  goto __pyx_L0;
28400 
28401  /* "View.MemoryView":776
28402  * new_ndim += 1
28403  *
28404  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
28405  * return memoryview_fromslice(dst, new_ndim,
28406  * memviewsliceobj.to_object_func,
28407  */
28408  }
28409 
28410  /* "View.MemoryView":782
28411  * memview.dtype_is_object)
28412  * else:
28413  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
28414  * memview.dtype_is_object)
28415  *
28416  */
28417  /*else*/ {
28418  __Pyx_XDECREF(((PyObject *)__pyx_r));
28419 
28420  /* "View.MemoryView":783
28421  * else:
28422  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
28423  * memview.dtype_is_object) # <<<<<<<<<<<<<<
28424  *
28425  *
28426  */
28427  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
28428  __Pyx_GOTREF(__pyx_t_3);
28429 
28430  /* "View.MemoryView":782
28431  * memview.dtype_is_object)
28432  * else:
28433  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
28434  * memview.dtype_is_object)
28435  *
28436  */
28437  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
28438  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
28439  __pyx_t_3 = 0;
28440  goto __pyx_L0;
28441  }
28442 
28443  /* "View.MemoryView":710
28444  *
28445  * @cname('__pyx_memview_slice')
28446  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
28447  * cdef int new_ndim = 0, suboffset_dim = -1, dim
28448  * cdef bint negative_step
28449  */
28450 
28451  /* function exit code */
28452  __pyx_L1_error:;
28453  __Pyx_XDECREF(__pyx_t_3);
28454  __Pyx_XDECREF(__pyx_t_9);
28455  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
28456  __pyx_r = 0;
28457  __pyx_L0:;
28458  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
28459  __Pyx_XDECREF(__pyx_v_index);
28460  __Pyx_XGIVEREF((PyObject *)__pyx_r);
28461  __Pyx_RefNannyFinishContext();
28462  return __pyx_r;
28463 }
28464 
28465 /* "View.MemoryView":807
28466  *
28467  * @cname('__pyx_memoryview_slice_memviewslice')
28468  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
28469  * __Pyx_memviewslice *dst,
28470  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
28471  */
28472 
28473 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
28474  Py_ssize_t __pyx_v_new_shape;
28475  int __pyx_v_negative_step;
28476  int __pyx_r;
28477  int __pyx_t_1;
28478  int __pyx_t_2;
28479  int __pyx_t_3;
28480  int __pyx_lineno = 0;
28481  const char *__pyx_filename = NULL;
28482  int __pyx_clineno = 0;
28483 
28484  /* "View.MemoryView":827
28485  * cdef bint negative_step
28486  *
28487  * if not is_slice: # <<<<<<<<<<<<<<
28488  *
28489  * if start < 0:
28490  */
28491  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
28492  if (__pyx_t_1) {
28493 
28494  /* "View.MemoryView":829
28495  * if not is_slice:
28496  *
28497  * if start < 0: # <<<<<<<<<<<<<<
28498  * start += shape
28499  * if not 0 <= start < shape:
28500  */
28501  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
28502  if (__pyx_t_1) {
28503 
28504  /* "View.MemoryView":830
28505  *
28506  * if start < 0:
28507  * start += shape # <<<<<<<<<<<<<<
28508  * if not 0 <= start < shape:
28509  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
28510  */
28511  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
28512 
28513  /* "View.MemoryView":829
28514  * if not is_slice:
28515  *
28516  * if start < 0: # <<<<<<<<<<<<<<
28517  * start += shape
28518  * if not 0 <= start < shape:
28519  */
28520  }
28521 
28522  /* "View.MemoryView":831
28523  * if start < 0:
28524  * start += shape
28525  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
28526  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
28527  * else:
28528  */
28529  __pyx_t_1 = (0 <= __pyx_v_start);
28530  if (__pyx_t_1) {
28531  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
28532  }
28533  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
28534  if (__pyx_t_2) {
28535 
28536  /* "View.MemoryView":832
28537  * start += shape
28538  * if not 0 <= start < shape:
28539  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
28540  * else:
28541  *
28542  */
28543  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
28544 
28545  /* "View.MemoryView":831
28546  * if start < 0:
28547  * start += shape
28548  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
28549  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
28550  * else:
28551  */
28552  }
28553 
28554  /* "View.MemoryView":827
28555  * cdef bint negative_step
28556  *
28557  * if not is_slice: # <<<<<<<<<<<<<<
28558  *
28559  * if start < 0:
28560  */
28561  goto __pyx_L3;
28562  }
28563 
28564  /* "View.MemoryView":835
28565  * else:
28566  *
28567  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
28568  *
28569  * if have_step and step == 0:
28570  */
28571  /*else*/ {
28572  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
28573  if (__pyx_t_1) {
28574  } else {
28575  __pyx_t_2 = __pyx_t_1;
28576  goto __pyx_L6_bool_binop_done;
28577  }
28578  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
28579  __pyx_t_2 = __pyx_t_1;
28580  __pyx_L6_bool_binop_done:;
28581  __pyx_v_negative_step = __pyx_t_2;
28582 
28583  /* "View.MemoryView":837
28584  * negative_step = have_step != 0 and step < 0
28585  *
28586  * if have_step and step == 0: # <<<<<<<<<<<<<<
28587  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
28588  *
28589  */
28590  __pyx_t_1 = (__pyx_v_have_step != 0);
28591  if (__pyx_t_1) {
28592  } else {
28593  __pyx_t_2 = __pyx_t_1;
28594  goto __pyx_L9_bool_binop_done;
28595  }
28596  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
28597  __pyx_t_2 = __pyx_t_1;
28598  __pyx_L9_bool_binop_done:;
28599  if (__pyx_t_2) {
28600 
28601  /* "View.MemoryView":838
28602  *
28603  * if have_step and step == 0:
28604  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
28605  *
28606  *
28607  */
28608  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
28609 
28610  /* "View.MemoryView":837
28611  * negative_step = have_step != 0 and step < 0
28612  *
28613  * if have_step and step == 0: # <<<<<<<<<<<<<<
28614  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
28615  *
28616  */
28617  }
28618 
28619  /* "View.MemoryView":841
28620  *
28621  *
28622  * if have_start: # <<<<<<<<<<<<<<
28623  * if start < 0:
28624  * start += shape
28625  */
28626  __pyx_t_2 = (__pyx_v_have_start != 0);
28627  if (__pyx_t_2) {
28628 
28629  /* "View.MemoryView":842
28630  *
28631  * if have_start:
28632  * if start < 0: # <<<<<<<<<<<<<<
28633  * start += shape
28634  * if start < 0:
28635  */
28636  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
28637  if (__pyx_t_2) {
28638 
28639  /* "View.MemoryView":843
28640  * if have_start:
28641  * if start < 0:
28642  * start += shape # <<<<<<<<<<<<<<
28643  * if start < 0:
28644  * start = 0
28645  */
28646  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
28647 
28648  /* "View.MemoryView":844
28649  * if start < 0:
28650  * start += shape
28651  * if start < 0: # <<<<<<<<<<<<<<
28652  * start = 0
28653  * elif start >= shape:
28654  */
28655  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
28656  if (__pyx_t_2) {
28657 
28658  /* "View.MemoryView":845
28659  * start += shape
28660  * if start < 0:
28661  * start = 0 # <<<<<<<<<<<<<<
28662  * elif start >= shape:
28663  * if negative_step:
28664  */
28665  __pyx_v_start = 0;
28666 
28667  /* "View.MemoryView":844
28668  * if start < 0:
28669  * start += shape
28670  * if start < 0: # <<<<<<<<<<<<<<
28671  * start = 0
28672  * elif start >= shape:
28673  */
28674  }
28675 
28676  /* "View.MemoryView":842
28677  *
28678  * if have_start:
28679  * if start < 0: # <<<<<<<<<<<<<<
28680  * start += shape
28681  * if start < 0:
28682  */
28683  goto __pyx_L12;
28684  }
28685 
28686  /* "View.MemoryView":846
28687  * if start < 0:
28688  * start = 0
28689  * elif start >= shape: # <<<<<<<<<<<<<<
28690  * if negative_step:
28691  * start = shape - 1
28692  */
28693  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
28694  if (__pyx_t_2) {
28695 
28696  /* "View.MemoryView":847
28697  * start = 0
28698  * elif start >= shape:
28699  * if negative_step: # <<<<<<<<<<<<<<
28700  * start = shape - 1
28701  * else:
28702  */
28703  __pyx_t_2 = (__pyx_v_negative_step != 0);
28704  if (__pyx_t_2) {
28705 
28706  /* "View.MemoryView":848
28707  * elif start >= shape:
28708  * if negative_step:
28709  * start = shape - 1 # <<<<<<<<<<<<<<
28710  * else:
28711  * start = shape
28712  */
28713  __pyx_v_start = (__pyx_v_shape - 1);
28714 
28715  /* "View.MemoryView":847
28716  * start = 0
28717  * elif start >= shape:
28718  * if negative_step: # <<<<<<<<<<<<<<
28719  * start = shape - 1
28720  * else:
28721  */
28722  goto __pyx_L14;
28723  }
28724 
28725  /* "View.MemoryView":850
28726  * start = shape - 1
28727  * else:
28728  * start = shape # <<<<<<<<<<<<<<
28729  * else:
28730  * if negative_step:
28731  */
28732  /*else*/ {
28733  __pyx_v_start = __pyx_v_shape;
28734  }
28735  __pyx_L14:;
28736 
28737  /* "View.MemoryView":846
28738  * if start < 0:
28739  * start = 0
28740  * elif start >= shape: # <<<<<<<<<<<<<<
28741  * if negative_step:
28742  * start = shape - 1
28743  */
28744  }
28745  __pyx_L12:;
28746 
28747  /* "View.MemoryView":841
28748  *
28749  *
28750  * if have_start: # <<<<<<<<<<<<<<
28751  * if start < 0:
28752  * start += shape
28753  */
28754  goto __pyx_L11;
28755  }
28756 
28757  /* "View.MemoryView":852
28758  * start = shape
28759  * else:
28760  * if negative_step: # <<<<<<<<<<<<<<
28761  * start = shape - 1
28762  * else:
28763  */
28764  /*else*/ {
28765  __pyx_t_2 = (__pyx_v_negative_step != 0);
28766  if (__pyx_t_2) {
28767 
28768  /* "View.MemoryView":853
28769  * else:
28770  * if negative_step:
28771  * start = shape - 1 # <<<<<<<<<<<<<<
28772  * else:
28773  * start = 0
28774  */
28775  __pyx_v_start = (__pyx_v_shape - 1);
28776 
28777  /* "View.MemoryView":852
28778  * start = shape
28779  * else:
28780  * if negative_step: # <<<<<<<<<<<<<<
28781  * start = shape - 1
28782  * else:
28783  */
28784  goto __pyx_L15;
28785  }
28786 
28787  /* "View.MemoryView":855
28788  * start = shape - 1
28789  * else:
28790  * start = 0 # <<<<<<<<<<<<<<
28791  *
28792  * if have_stop:
28793  */
28794  /*else*/ {
28795  __pyx_v_start = 0;
28796  }
28797  __pyx_L15:;
28798  }
28799  __pyx_L11:;
28800 
28801  /* "View.MemoryView":857
28802  * start = 0
28803  *
28804  * if have_stop: # <<<<<<<<<<<<<<
28805  * if stop < 0:
28806  * stop += shape
28807  */
28808  __pyx_t_2 = (__pyx_v_have_stop != 0);
28809  if (__pyx_t_2) {
28810 
28811  /* "View.MemoryView":858
28812  *
28813  * if have_stop:
28814  * if stop < 0: # <<<<<<<<<<<<<<
28815  * stop += shape
28816  * if stop < 0:
28817  */
28818  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
28819  if (__pyx_t_2) {
28820 
28821  /* "View.MemoryView":859
28822  * if have_stop:
28823  * if stop < 0:
28824  * stop += shape # <<<<<<<<<<<<<<
28825  * if stop < 0:
28826  * stop = 0
28827  */
28828  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
28829 
28830  /* "View.MemoryView":860
28831  * if stop < 0:
28832  * stop += shape
28833  * if stop < 0: # <<<<<<<<<<<<<<
28834  * stop = 0
28835  * elif stop > shape:
28836  */
28837  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
28838  if (__pyx_t_2) {
28839 
28840  /* "View.MemoryView":861
28841  * stop += shape
28842  * if stop < 0:
28843  * stop = 0 # <<<<<<<<<<<<<<
28844  * elif stop > shape:
28845  * stop = shape
28846  */
28847  __pyx_v_stop = 0;
28848 
28849  /* "View.MemoryView":860
28850  * if stop < 0:
28851  * stop += shape
28852  * if stop < 0: # <<<<<<<<<<<<<<
28853  * stop = 0
28854  * elif stop > shape:
28855  */
28856  }
28857 
28858  /* "View.MemoryView":858
28859  *
28860  * if have_stop:
28861  * if stop < 0: # <<<<<<<<<<<<<<
28862  * stop += shape
28863  * if stop < 0:
28864  */
28865  goto __pyx_L17;
28866  }
28867 
28868  /* "View.MemoryView":862
28869  * if stop < 0:
28870  * stop = 0
28871  * elif stop > shape: # <<<<<<<<<<<<<<
28872  * stop = shape
28873  * else:
28874  */
28875  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
28876  if (__pyx_t_2) {
28877 
28878  /* "View.MemoryView":863
28879  * stop = 0
28880  * elif stop > shape:
28881  * stop = shape # <<<<<<<<<<<<<<
28882  * else:
28883  * if negative_step:
28884  */
28885  __pyx_v_stop = __pyx_v_shape;
28886 
28887  /* "View.MemoryView":862
28888  * if stop < 0:
28889  * stop = 0
28890  * elif stop > shape: # <<<<<<<<<<<<<<
28891  * stop = shape
28892  * else:
28893  */
28894  }
28895  __pyx_L17:;
28896 
28897  /* "View.MemoryView":857
28898  * start = 0
28899  *
28900  * if have_stop: # <<<<<<<<<<<<<<
28901  * if stop < 0:
28902  * stop += shape
28903  */
28904  goto __pyx_L16;
28905  }
28906 
28907  /* "View.MemoryView":865
28908  * stop = shape
28909  * else:
28910  * if negative_step: # <<<<<<<<<<<<<<
28911  * stop = -1
28912  * else:
28913  */
28914  /*else*/ {
28915  __pyx_t_2 = (__pyx_v_negative_step != 0);
28916  if (__pyx_t_2) {
28917 
28918  /* "View.MemoryView":866
28919  * else:
28920  * if negative_step:
28921  * stop = -1 # <<<<<<<<<<<<<<
28922  * else:
28923  * stop = shape
28924  */
28925  __pyx_v_stop = -1L;
28926 
28927  /* "View.MemoryView":865
28928  * stop = shape
28929  * else:
28930  * if negative_step: # <<<<<<<<<<<<<<
28931  * stop = -1
28932  * else:
28933  */
28934  goto __pyx_L19;
28935  }
28936 
28937  /* "View.MemoryView":868
28938  * stop = -1
28939  * else:
28940  * stop = shape # <<<<<<<<<<<<<<
28941  *
28942  * if not have_step:
28943  */
28944  /*else*/ {
28945  __pyx_v_stop = __pyx_v_shape;
28946  }
28947  __pyx_L19:;
28948  }
28949  __pyx_L16:;
28950 
28951  /* "View.MemoryView":870
28952  * stop = shape
28953  *
28954  * if not have_step: # <<<<<<<<<<<<<<
28955  * step = 1
28956  *
28957  */
28958  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
28959  if (__pyx_t_2) {
28960 
28961  /* "View.MemoryView":871
28962  *
28963  * if not have_step:
28964  * step = 1 # <<<<<<<<<<<<<<
28965  *
28966  *
28967  */
28968  __pyx_v_step = 1;
28969 
28970  /* "View.MemoryView":870
28971  * stop = shape
28972  *
28973  * if not have_step: # <<<<<<<<<<<<<<
28974  * step = 1
28975  *
28976  */
28977  }
28978 
28979  /* "View.MemoryView":875
28980  *
28981  * with cython.cdivision(True):
28982  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
28983  *
28984  * if (stop - start) - step * new_shape:
28985  */
28986  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
28987 
28988  /* "View.MemoryView":877
28989  * new_shape = (stop - start) // step
28990  *
28991  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
28992  * new_shape += 1
28993  *
28994  */
28995  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
28996  if (__pyx_t_2) {
28997 
28998  /* "View.MemoryView":878
28999  *
29000  * if (stop - start) - step * new_shape:
29001  * new_shape += 1 # <<<<<<<<<<<<<<
29002  *
29003  * if new_shape < 0:
29004  */
29005  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
29006 
29007  /* "View.MemoryView":877
29008  * new_shape = (stop - start) // step
29009  *
29010  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
29011  * new_shape += 1
29012  *
29013  */
29014  }
29015 
29016  /* "View.MemoryView":880
29017  * new_shape += 1
29018  *
29019  * if new_shape < 0: # <<<<<<<<<<<<<<
29020  * new_shape = 0
29021  *
29022  */
29023  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
29024  if (__pyx_t_2) {
29025 
29026  /* "View.MemoryView":881
29027  *
29028  * if new_shape < 0:
29029  * new_shape = 0 # <<<<<<<<<<<<<<
29030  *
29031  *
29032  */
29033  __pyx_v_new_shape = 0;
29034 
29035  /* "View.MemoryView":880
29036  * new_shape += 1
29037  *
29038  * if new_shape < 0: # <<<<<<<<<<<<<<
29039  * new_shape = 0
29040  *
29041  */
29042  }
29043 
29044  /* "View.MemoryView":884
29045  *
29046  *
29047  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
29048  * dst.shape[new_ndim] = new_shape
29049  * dst.suboffsets[new_ndim] = suboffset
29050  */
29051  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
29052 
29053  /* "View.MemoryView":885
29054  *
29055  * dst.strides[new_ndim] = stride * step
29056  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
29057  * dst.suboffsets[new_ndim] = suboffset
29058  *
29059  */
29060  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
29061 
29062  /* "View.MemoryView":886
29063  * dst.strides[new_ndim] = stride * step
29064  * dst.shape[new_ndim] = new_shape
29065  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
29066  *
29067  *
29068  */
29069  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
29070  }
29071  __pyx_L3:;
29072 
29073  /* "View.MemoryView":889
29074  *
29075  *
29076  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
29077  * dst.data += start * stride
29078  * else:
29079  */
29080  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
29081  if (__pyx_t_2) {
29082 
29083  /* "View.MemoryView":890
29084  *
29085  * if suboffset_dim[0] < 0:
29086  * dst.data += start * stride # <<<<<<<<<<<<<<
29087  * else:
29088  * dst.suboffsets[suboffset_dim[0]] += start * stride
29089  */
29090  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
29091 
29092  /* "View.MemoryView":889
29093  *
29094  *
29095  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
29096  * dst.data += start * stride
29097  * else:
29098  */
29099  goto __pyx_L23;
29100  }
29101 
29102  /* "View.MemoryView":892
29103  * dst.data += start * stride
29104  * else:
29105  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
29106  *
29107  * if suboffset >= 0:
29108  */
29109  /*else*/ {
29110  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
29111  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
29112  }
29113  __pyx_L23:;
29114 
29115  /* "View.MemoryView":894
29116  * dst.suboffsets[suboffset_dim[0]] += start * stride
29117  *
29118  * if suboffset >= 0: # <<<<<<<<<<<<<<
29119  * if not is_slice:
29120  * if new_ndim == 0:
29121  */
29122  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
29123  if (__pyx_t_2) {
29124 
29125  /* "View.MemoryView":895
29126  *
29127  * if suboffset >= 0:
29128  * if not is_slice: # <<<<<<<<<<<<<<
29129  * if new_ndim == 0:
29130  * dst.data = (<char **> dst.data)[0] + suboffset
29131  */
29132  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
29133  if (__pyx_t_2) {
29134 
29135  /* "View.MemoryView":896
29136  * if suboffset >= 0:
29137  * if not is_slice:
29138  * if new_ndim == 0: # <<<<<<<<<<<<<<
29139  * dst.data = (<char **> dst.data)[0] + suboffset
29140  * else:
29141  */
29142  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
29143  if (__pyx_t_2) {
29144 
29145  /* "View.MemoryView":897
29146  * if not is_slice:
29147  * if new_ndim == 0:
29148  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
29149  * else:
29150  * _err_dim(IndexError, "All dimensions preceding dimension %d "
29151  */
29152  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
29153 
29154  /* "View.MemoryView":896
29155  * if suboffset >= 0:
29156  * if not is_slice:
29157  * if new_ndim == 0: # <<<<<<<<<<<<<<
29158  * dst.data = (<char **> dst.data)[0] + suboffset
29159  * else:
29160  */
29161  goto __pyx_L26;
29162  }
29163 
29164  /* "View.MemoryView":899
29165  * dst.data = (<char **> dst.data)[0] + suboffset
29166  * else:
29167  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
29168  * "must be indexed and not sliced", dim)
29169  * else:
29170  */
29171  /*else*/ {
29172 
29173  /* "View.MemoryView":900
29174  * else:
29175  * _err_dim(IndexError, "All dimensions preceding dimension %d "
29176  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
29177  * else:
29178  * suboffset_dim[0] = new_ndim
29179  */
29180  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
29181  }
29182  __pyx_L26:;
29183 
29184  /* "View.MemoryView":895
29185  *
29186  * if suboffset >= 0:
29187  * if not is_slice: # <<<<<<<<<<<<<<
29188  * if new_ndim == 0:
29189  * dst.data = (<char **> dst.data)[0] + suboffset
29190  */
29191  goto __pyx_L25;
29192  }
29193 
29194  /* "View.MemoryView":902
29195  * "must be indexed and not sliced", dim)
29196  * else:
29197  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
29198  *
29199  * return 0
29200  */
29201  /*else*/ {
29202  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
29203  }
29204  __pyx_L25:;
29205 
29206  /* "View.MemoryView":894
29207  * dst.suboffsets[suboffset_dim[0]] += start * stride
29208  *
29209  * if suboffset >= 0: # <<<<<<<<<<<<<<
29210  * if not is_slice:
29211  * if new_ndim == 0:
29212  */
29213  }
29214 
29215  /* "View.MemoryView":904
29216  * suboffset_dim[0] = new_ndim
29217  *
29218  * return 0 # <<<<<<<<<<<<<<
29219  *
29220  *
29221  */
29222  __pyx_r = 0;
29223  goto __pyx_L0;
29224 
29225  /* "View.MemoryView":807
29226  *
29227  * @cname('__pyx_memoryview_slice_memviewslice')
29228  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
29229  * __Pyx_memviewslice *dst,
29230  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
29231  */
29232 
29233  /* function exit code */
29234  __pyx_L1_error:;
29235  {
29236  #ifdef WITH_THREAD
29237  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
29238  #endif
29239  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
29240  #ifdef WITH_THREAD
29241  __Pyx_PyGILState_Release(__pyx_gilstate_save);
29242  #endif
29243  }
29244  __pyx_r = -1;
29245  __pyx_L0:;
29246  return __pyx_r;
29247 }
29248 
29249 /* "View.MemoryView":910
29250  *
29251  * @cname('__pyx_pybuffer_index')
29252  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
29253  * Py_ssize_t dim) except NULL:
29254  * cdef Py_ssize_t shape, stride, suboffset = -1
29255  */
29256 
29257 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
29258  Py_ssize_t __pyx_v_shape;
29259  Py_ssize_t __pyx_v_stride;
29260  Py_ssize_t __pyx_v_suboffset;
29261  Py_ssize_t __pyx_v_itemsize;
29262  char *__pyx_v_resultp;
29263  char *__pyx_r;
29264  __Pyx_RefNannyDeclarations
29265  Py_ssize_t __pyx_t_1;
29266  int __pyx_t_2;
29267  PyObject *__pyx_t_3 = NULL;
29268  PyObject *__pyx_t_4 = NULL;
29269  int __pyx_lineno = 0;
29270  const char *__pyx_filename = NULL;
29271  int __pyx_clineno = 0;
29272  __Pyx_RefNannySetupContext("pybuffer_index", 0);
29273 
29274  /* "View.MemoryView":912
29275  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
29276  * Py_ssize_t dim) except NULL:
29277  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
29278  * cdef Py_ssize_t itemsize = view.itemsize
29279  * cdef char *resultp
29280  */
29281  __pyx_v_suboffset = -1L;
29282 
29283  /* "View.MemoryView":913
29284  * Py_ssize_t dim) except NULL:
29285  * cdef Py_ssize_t shape, stride, suboffset = -1
29286  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
29287  * cdef char *resultp
29288  *
29289  */
29290  __pyx_t_1 = __pyx_v_view->itemsize;
29291  __pyx_v_itemsize = __pyx_t_1;
29292 
29293  /* "View.MemoryView":916
29294  * cdef char *resultp
29295  *
29296  * if view.ndim == 0: # <<<<<<<<<<<<<<
29297  * shape = view.len / itemsize
29298  * stride = itemsize
29299  */
29300  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
29301  if (__pyx_t_2) {
29302 
29303  /* "View.MemoryView":917
29304  *
29305  * if view.ndim == 0:
29306  * shape = view.len / itemsize # <<<<<<<<<<<<<<
29307  * stride = itemsize
29308  * else:
29309  */
29310  if (unlikely(__pyx_v_itemsize == 0)) {
29311  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
29312  __PYX_ERR(1, 917, __pyx_L1_error)
29313  }
29314  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
29315  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
29316  __PYX_ERR(1, 917, __pyx_L1_error)
29317  }
29318  __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
29319 
29320  /* "View.MemoryView":918
29321  * if view.ndim == 0:
29322  * shape = view.len / itemsize
29323  * stride = itemsize # <<<<<<<<<<<<<<
29324  * else:
29325  * shape = view.shape[dim]
29326  */
29327  __pyx_v_stride = __pyx_v_itemsize;
29328 
29329  /* "View.MemoryView":916
29330  * cdef char *resultp
29331  *
29332  * if view.ndim == 0: # <<<<<<<<<<<<<<
29333  * shape = view.len / itemsize
29334  * stride = itemsize
29335  */
29336  goto __pyx_L3;
29337  }
29338 
29339  /* "View.MemoryView":920
29340  * stride = itemsize
29341  * else:
29342  * shape = view.shape[dim] # <<<<<<<<<<<<<<
29343  * stride = view.strides[dim]
29344  * if view.suboffsets != NULL:
29345  */
29346  /*else*/ {
29347  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
29348 
29349  /* "View.MemoryView":921
29350  * else:
29351  * shape = view.shape[dim]
29352  * stride = view.strides[dim] # <<<<<<<<<<<<<<
29353  * if view.suboffsets != NULL:
29354  * suboffset = view.suboffsets[dim]
29355  */
29356  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
29357 
29358  /* "View.MemoryView":922
29359  * shape = view.shape[dim]
29360  * stride = view.strides[dim]
29361  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
29362  * suboffset = view.suboffsets[dim]
29363  *
29364  */
29365  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
29366  if (__pyx_t_2) {
29367 
29368  /* "View.MemoryView":923
29369  * stride = view.strides[dim]
29370  * if view.suboffsets != NULL:
29371  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
29372  *
29373  * if index < 0:
29374  */
29375  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
29376 
29377  /* "View.MemoryView":922
29378  * shape = view.shape[dim]
29379  * stride = view.strides[dim]
29380  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
29381  * suboffset = view.suboffsets[dim]
29382  *
29383  */
29384  }
29385  }
29386  __pyx_L3:;
29387 
29388  /* "View.MemoryView":925
29389  * suboffset = view.suboffsets[dim]
29390  *
29391  * if index < 0: # <<<<<<<<<<<<<<
29392  * index += view.shape[dim]
29393  * if index < 0:
29394  */
29395  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
29396  if (__pyx_t_2) {
29397 
29398  /* "View.MemoryView":926
29399  *
29400  * if index < 0:
29401  * index += view.shape[dim] # <<<<<<<<<<<<<<
29402  * if index < 0:
29403  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
29404  */
29405  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
29406 
29407  /* "View.MemoryView":927
29408  * if index < 0:
29409  * index += view.shape[dim]
29410  * if index < 0: # <<<<<<<<<<<<<<
29411  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
29412  *
29413  */
29414  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
29415  if (unlikely(__pyx_t_2)) {
29416 
29417  /* "View.MemoryView":928
29418  * index += view.shape[dim]
29419  * if index < 0:
29420  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
29421  *
29422  * if index >= shape:
29423  */
29424  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
29425  __Pyx_GOTREF(__pyx_t_3);
29426  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
29427  __Pyx_GOTREF(__pyx_t_4);
29428  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29429  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
29430  __Pyx_GOTREF(__pyx_t_3);
29431  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29432  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
29433  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29434  __PYX_ERR(1, 928, __pyx_L1_error)
29435 
29436  /* "View.MemoryView":927
29437  * if index < 0:
29438  * index += view.shape[dim]
29439  * if index < 0: # <<<<<<<<<<<<<<
29440  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
29441  *
29442  */
29443  }
29444 
29445  /* "View.MemoryView":925
29446  * suboffset = view.suboffsets[dim]
29447  *
29448  * if index < 0: # <<<<<<<<<<<<<<
29449  * index += view.shape[dim]
29450  * if index < 0:
29451  */
29452  }
29453 
29454  /* "View.MemoryView":930
29455  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
29456  *
29457  * if index >= shape: # <<<<<<<<<<<<<<
29458  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
29459  *
29460  */
29461  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
29462  if (unlikely(__pyx_t_2)) {
29463 
29464  /* "View.MemoryView":931
29465  *
29466  * if index >= shape:
29467  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
29468  *
29469  * resultp = bufp + index * stride
29470  */
29471  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
29472  __Pyx_GOTREF(__pyx_t_3);
29473  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
29474  __Pyx_GOTREF(__pyx_t_4);
29475  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29476  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
29477  __Pyx_GOTREF(__pyx_t_3);
29478  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29479  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
29480  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29481  __PYX_ERR(1, 931, __pyx_L1_error)
29482 
29483  /* "View.MemoryView":930
29484  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
29485  *
29486  * if index >= shape: # <<<<<<<<<<<<<<
29487  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
29488  *
29489  */
29490  }
29491 
29492  /* "View.MemoryView":933
29493  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
29494  *
29495  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
29496  * if suboffset >= 0:
29497  * resultp = (<char **> resultp)[0] + suboffset
29498  */
29499  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
29500 
29501  /* "View.MemoryView":934
29502  *
29503  * resultp = bufp + index * stride
29504  * if suboffset >= 0: # <<<<<<<<<<<<<<
29505  * resultp = (<char **> resultp)[0] + suboffset
29506  *
29507  */
29508  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
29509  if (__pyx_t_2) {
29510 
29511  /* "View.MemoryView":935
29512  * resultp = bufp + index * stride
29513  * if suboffset >= 0:
29514  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
29515  *
29516  * return resultp
29517  */
29518  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
29519 
29520  /* "View.MemoryView":934
29521  *
29522  * resultp = bufp + index * stride
29523  * if suboffset >= 0: # <<<<<<<<<<<<<<
29524  * resultp = (<char **> resultp)[0] + suboffset
29525  *
29526  */
29527  }
29528 
29529  /* "View.MemoryView":937
29530  * resultp = (<char **> resultp)[0] + suboffset
29531  *
29532  * return resultp # <<<<<<<<<<<<<<
29533  *
29534  *
29535  */
29536  __pyx_r = __pyx_v_resultp;
29537  goto __pyx_L0;
29538 
29539  /* "View.MemoryView":910
29540  *
29541  * @cname('__pyx_pybuffer_index')
29542  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
29543  * Py_ssize_t dim) except NULL:
29544  * cdef Py_ssize_t shape, stride, suboffset = -1
29545  */
29546 
29547  /* function exit code */
29548  __pyx_L1_error:;
29549  __Pyx_XDECREF(__pyx_t_3);
29550  __Pyx_XDECREF(__pyx_t_4);
29551  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
29552  __pyx_r = NULL;
29553  __pyx_L0:;
29554  __Pyx_RefNannyFinishContext();
29555  return __pyx_r;
29556 }
29557 
29558 /* "View.MemoryView":943
29559  *
29560  * @cname('__pyx_memslice_transpose')
29561  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
29562  * cdef int ndim = memslice.memview.view.ndim
29563  *
29564  */
29565 
29566 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
29567  int __pyx_v_ndim;
29568  Py_ssize_t *__pyx_v_shape;
29569  Py_ssize_t *__pyx_v_strides;
29570  int __pyx_v_i;
29571  int __pyx_v_j;
29572  int __pyx_r;
29573  int __pyx_t_1;
29574  Py_ssize_t *__pyx_t_2;
29575  long __pyx_t_3;
29576  long __pyx_t_4;
29577  Py_ssize_t __pyx_t_5;
29578  Py_ssize_t __pyx_t_6;
29579  int __pyx_t_7;
29580  int __pyx_t_8;
29581  int __pyx_t_9;
29582  int __pyx_lineno = 0;
29583  const char *__pyx_filename = NULL;
29584  int __pyx_clineno = 0;
29585 
29586  /* "View.MemoryView":944
29587  * @cname('__pyx_memslice_transpose')
29588  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
29589  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
29590  *
29591  * cdef Py_ssize_t *shape = memslice.shape
29592  */
29593  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
29594  __pyx_v_ndim = __pyx_t_1;
29595 
29596  /* "View.MemoryView":946
29597  * cdef int ndim = memslice.memview.view.ndim
29598  *
29599  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
29600  * cdef Py_ssize_t *strides = memslice.strides
29601  *
29602  */
29603  __pyx_t_2 = __pyx_v_memslice->shape;
29604  __pyx_v_shape = __pyx_t_2;
29605 
29606  /* "View.MemoryView":947
29607  *
29608  * cdef Py_ssize_t *shape = memslice.shape
29609  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
29610  *
29611  *
29612  */
29613  __pyx_t_2 = __pyx_v_memslice->strides;
29614  __pyx_v_strides = __pyx_t_2;
29615 
29616  /* "View.MemoryView":951
29617  *
29618  * cdef int i, j
29619  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
29620  * j = ndim - 1 - i
29621  * strides[i], strides[j] = strides[j], strides[i]
29622  */
29623  __pyx_t_3 = (__pyx_v_ndim / 2);
29624  __pyx_t_4 = __pyx_t_3;
29625  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
29626  __pyx_v_i = __pyx_t_1;
29627 
29628  /* "View.MemoryView":952
29629  * cdef int i, j
29630  * for i in range(ndim / 2):
29631  * j = ndim - 1 - i # <<<<<<<<<<<<<<
29632  * strides[i], strides[j] = strides[j], strides[i]
29633  * shape[i], shape[j] = shape[j], shape[i]
29634  */
29635  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
29636 
29637  /* "View.MemoryView":953
29638  * for i in range(ndim / 2):
29639  * j = ndim - 1 - i
29640  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
29641  * shape[i], shape[j] = shape[j], shape[i]
29642  *
29643  */
29644  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
29645  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
29646  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
29647  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
29648 
29649  /* "View.MemoryView":954
29650  * j = ndim - 1 - i
29651  * strides[i], strides[j] = strides[j], strides[i]
29652  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
29653  *
29654  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
29655  */
29656  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
29657  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
29658  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
29659  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
29660 
29661  /* "View.MemoryView":956
29662  * shape[i], shape[j] = shape[j], shape[i]
29663  *
29664  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
29665  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
29666  *
29667  */
29668  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
29669  if (!__pyx_t_8) {
29670  } else {
29671  __pyx_t_7 = __pyx_t_8;
29672  goto __pyx_L6_bool_binop_done;
29673  }
29674  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
29675  __pyx_t_7 = __pyx_t_8;
29676  __pyx_L6_bool_binop_done:;
29677  if (__pyx_t_7) {
29678 
29679  /* "View.MemoryView":957
29680  *
29681  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
29682  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
29683  *
29684  * return 1
29685  */
29686  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
29687 
29688  /* "View.MemoryView":956
29689  * shape[i], shape[j] = shape[j], shape[i]
29690  *
29691  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
29692  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
29693  *
29694  */
29695  }
29696  }
29697 
29698  /* "View.MemoryView":959
29699  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
29700  *
29701  * return 1 # <<<<<<<<<<<<<<
29702  *
29703  *
29704  */
29705  __pyx_r = 1;
29706  goto __pyx_L0;
29707 
29708  /* "View.MemoryView":943
29709  *
29710  * @cname('__pyx_memslice_transpose')
29711  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
29712  * cdef int ndim = memslice.memview.view.ndim
29713  *
29714  */
29715 
29716  /* function exit code */
29717  __pyx_L1_error:;
29718  {
29719  #ifdef WITH_THREAD
29720  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
29721  #endif
29722  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
29723  #ifdef WITH_THREAD
29724  __Pyx_PyGILState_Release(__pyx_gilstate_save);
29725  #endif
29726  }
29727  __pyx_r = 0;
29728  __pyx_L0:;
29729  return __pyx_r;
29730 }
29731 
29732 /* "View.MemoryView":976
29733  * cdef int (*to_dtype_func)(char *, object) except 0
29734  *
29735  * def __dealloc__(self): # <<<<<<<<<<<<<<
29736  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
29737  *
29738  */
29739 
29740 /* Python wrapper */
29741 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
29742 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
29743  __Pyx_RefNannyDeclarations
29744  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
29745  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
29746 
29747  /* function exit code */
29748  __Pyx_RefNannyFinishContext();
29749 }
29750 
29751 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
29752  __Pyx_RefNannyDeclarations
29753  __Pyx_RefNannySetupContext("__dealloc__", 0);
29754 
29755  /* "View.MemoryView":977
29756  *
29757  * def __dealloc__(self):
29758  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
29759  *
29760  * cdef convert_item_to_object(self, char *itemp):
29761  */
29762  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
29763 
29764  /* "View.MemoryView":976
29765  * cdef int (*to_dtype_func)(char *, object) except 0
29766  *
29767  * def __dealloc__(self): # <<<<<<<<<<<<<<
29768  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
29769  *
29770  */
29771 
29772  /* function exit code */
29773  __Pyx_RefNannyFinishContext();
29774 }
29775 
29776 /* "View.MemoryView":979
29777  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
29778  *
29779  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
29780  * if self.to_object_func != NULL:
29781  * return self.to_object_func(itemp)
29782  */
29783 
29784 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
29785  PyObject *__pyx_r = NULL;
29786  __Pyx_RefNannyDeclarations
29787  int __pyx_t_1;
29788  PyObject *__pyx_t_2 = NULL;
29789  int __pyx_lineno = 0;
29790  const char *__pyx_filename = NULL;
29791  int __pyx_clineno = 0;
29792  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
29793 
29794  /* "View.MemoryView":980
29795  *
29796  * cdef convert_item_to_object(self, char *itemp):
29797  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
29798  * return self.to_object_func(itemp)
29799  * else:
29800  */
29801  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
29802  if (__pyx_t_1) {
29803 
29804  /* "View.MemoryView":981
29805  * cdef convert_item_to_object(self, char *itemp):
29806  * if self.to_object_func != NULL:
29807  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
29808  * else:
29809  * return memoryview.convert_item_to_object(self, itemp)
29810  */
29811  __Pyx_XDECREF(__pyx_r);
29812  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
29813  __Pyx_GOTREF(__pyx_t_2);
29814  __pyx_r = __pyx_t_2;
29815  __pyx_t_2 = 0;
29816  goto __pyx_L0;
29817 
29818  /* "View.MemoryView":980
29819  *
29820  * cdef convert_item_to_object(self, char *itemp):
29821  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
29822  * return self.to_object_func(itemp)
29823  * else:
29824  */
29825  }
29826 
29827  /* "View.MemoryView":983
29828  * return self.to_object_func(itemp)
29829  * else:
29830  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
29831  *
29832  * cdef assign_item_from_object(self, char *itemp, object value):
29833  */
29834  /*else*/ {
29835  __Pyx_XDECREF(__pyx_r);
29836  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
29837  __Pyx_GOTREF(__pyx_t_2);
29838  __pyx_r = __pyx_t_2;
29839  __pyx_t_2 = 0;
29840  goto __pyx_L0;
29841  }
29842 
29843  /* "View.MemoryView":979
29844  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
29845  *
29846  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
29847  * if self.to_object_func != NULL:
29848  * return self.to_object_func(itemp)
29849  */
29850 
29851  /* function exit code */
29852  __pyx_L1_error:;
29853  __Pyx_XDECREF(__pyx_t_2);
29854  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
29855  __pyx_r = 0;
29856  __pyx_L0:;
29857  __Pyx_XGIVEREF(__pyx_r);
29858  __Pyx_RefNannyFinishContext();
29859  return __pyx_r;
29860 }
29861 
29862 /* "View.MemoryView":985
29863  * return memoryview.convert_item_to_object(self, itemp)
29864  *
29865  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
29866  * if self.to_dtype_func != NULL:
29867  * self.to_dtype_func(itemp, value)
29868  */
29869 
29870 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
29871  PyObject *__pyx_r = NULL;
29872  __Pyx_RefNannyDeclarations
29873  int __pyx_t_1;
29874  int __pyx_t_2;
29875  PyObject *__pyx_t_3 = NULL;
29876  int __pyx_lineno = 0;
29877  const char *__pyx_filename = NULL;
29878  int __pyx_clineno = 0;
29879  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
29880 
29881  /* "View.MemoryView":986
29882  *
29883  * cdef assign_item_from_object(self, char *itemp, object value):
29884  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
29885  * self.to_dtype_func(itemp, value)
29886  * else:
29887  */
29888  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
29889  if (__pyx_t_1) {
29890 
29891  /* "View.MemoryView":987
29892  * cdef assign_item_from_object(self, char *itemp, object value):
29893  * if self.to_dtype_func != NULL:
29894  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
29895  * else:
29896  * memoryview.assign_item_from_object(self, itemp, value)
29897  */
29898  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
29899 
29900  /* "View.MemoryView":986
29901  *
29902  * cdef assign_item_from_object(self, char *itemp, object value):
29903  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
29904  * self.to_dtype_func(itemp, value)
29905  * else:
29906  */
29907  goto __pyx_L3;
29908  }
29909 
29910  /* "View.MemoryView":989
29911  * self.to_dtype_func(itemp, value)
29912  * else:
29913  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
29914  *
29915  * @property
29916  */
29917  /*else*/ {
29918  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
29919  __Pyx_GOTREF(__pyx_t_3);
29920  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29921  }
29922  __pyx_L3:;
29923 
29924  /* "View.MemoryView":985
29925  * return memoryview.convert_item_to_object(self, itemp)
29926  *
29927  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
29928  * if self.to_dtype_func != NULL:
29929  * self.to_dtype_func(itemp, value)
29930  */
29931 
29932  /* function exit code */
29933  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29934  goto __pyx_L0;
29935  __pyx_L1_error:;
29936  __Pyx_XDECREF(__pyx_t_3);
29937  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
29938  __pyx_r = 0;
29939  __pyx_L0:;
29940  __Pyx_XGIVEREF(__pyx_r);
29941  __Pyx_RefNannyFinishContext();
29942  return __pyx_r;
29943 }
29944 
29945 /* "View.MemoryView":992
29946  *
29947  * @property
29948  * def base(self): # <<<<<<<<<<<<<<
29949  * return self.from_object
29950  *
29951  */
29952 
29953 /* Python wrapper */
29954 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
29955 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
29956  PyObject *__pyx_r = 0;
29957  __Pyx_RefNannyDeclarations
29958  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
29959  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
29960 
29961  /* function exit code */
29962  __Pyx_RefNannyFinishContext();
29963  return __pyx_r;
29964 }
29965 
29966 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
29967  PyObject *__pyx_r = NULL;
29968  __Pyx_RefNannyDeclarations
29969  __Pyx_RefNannySetupContext("__get__", 0);
29970 
29971  /* "View.MemoryView":993
29972  * @property
29973  * def base(self):
29974  * return self.from_object # <<<<<<<<<<<<<<
29975  *
29976  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
29977  */
29978  __Pyx_XDECREF(__pyx_r);
29979  __Pyx_INCREF(__pyx_v_self->from_object);
29980  __pyx_r = __pyx_v_self->from_object;
29981  goto __pyx_L0;
29982 
29983  /* "View.MemoryView":992
29984  *
29985  * @property
29986  * def base(self): # <<<<<<<<<<<<<<
29987  * return self.from_object
29988  *
29989  */
29990 
29991  /* function exit code */
29992  __pyx_L0:;
29993  __Pyx_XGIVEREF(__pyx_r);
29994  __Pyx_RefNannyFinishContext();
29995  return __pyx_r;
29996 }
29997 
29998 /* "(tree fragment)":1
29999  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
30000  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
30001  * def __setstate_cython__(self, __pyx_state):
30002  */
30003 
30004 /* Python wrapper */
30005 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
30006 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
30007  PyObject *__pyx_r = 0;
30008  __Pyx_RefNannyDeclarations
30009  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
30010  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
30011 
30012  /* function exit code */
30013  __Pyx_RefNannyFinishContext();
30014  return __pyx_r;
30015 }
30016 
30017 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
30018  PyObject *__pyx_r = NULL;
30019  __Pyx_RefNannyDeclarations
30020  PyObject *__pyx_t_1 = NULL;
30021  int __pyx_lineno = 0;
30022  const char *__pyx_filename = NULL;
30023  int __pyx_clineno = 0;
30024  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
30025 
30026  /* "(tree fragment)":2
30027  * def __reduce_cython__(self):
30028  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
30029  * def __setstate_cython__(self, __pyx_state):
30030  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
30031  */
30032  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
30033  __Pyx_GOTREF(__pyx_t_1);
30034  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
30035  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30036  __PYX_ERR(1, 2, __pyx_L1_error)
30037 
30038  /* "(tree fragment)":1
30039  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
30040  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
30041  * def __setstate_cython__(self, __pyx_state):
30042  */
30043 
30044  /* function exit code */
30045  __pyx_L1_error:;
30046  __Pyx_XDECREF(__pyx_t_1);
30047  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30048  __pyx_r = NULL;
30049  __Pyx_XGIVEREF(__pyx_r);
30050  __Pyx_RefNannyFinishContext();
30051  return __pyx_r;
30052 }
30053 
30054 /* "(tree fragment)":3
30055  * def __reduce_cython__(self):
30056  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
30057  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
30058  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
30059  */
30060 
30061 /* Python wrapper */
30062 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
30063 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
30064  PyObject *__pyx_r = 0;
30065  __Pyx_RefNannyDeclarations
30066  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
30067  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
30068 
30069  /* function exit code */
30070  __Pyx_RefNannyFinishContext();
30071  return __pyx_r;
30072 }
30073 
30074 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) {
30075  PyObject *__pyx_r = NULL;
30076  __Pyx_RefNannyDeclarations
30077  PyObject *__pyx_t_1 = NULL;
30078  int __pyx_lineno = 0;
30079  const char *__pyx_filename = NULL;
30080  int __pyx_clineno = 0;
30081  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
30082 
30083  /* "(tree fragment)":4
30084  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
30085  * def __setstate_cython__(self, __pyx_state):
30086  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
30087  */
30088  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
30089  __Pyx_GOTREF(__pyx_t_1);
30090  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
30091  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30092  __PYX_ERR(1, 4, __pyx_L1_error)
30093 
30094  /* "(tree fragment)":3
30095  * def __reduce_cython__(self):
30096  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
30097  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
30098  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
30099  */
30100 
30101  /* function exit code */
30102  __pyx_L1_error:;
30103  __Pyx_XDECREF(__pyx_t_1);
30104  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30105  __pyx_r = NULL;
30106  __Pyx_XGIVEREF(__pyx_r);
30107  __Pyx_RefNannyFinishContext();
30108  return __pyx_r;
30109 }
30110 
30111 /* "View.MemoryView":999
30112  *
30113  * @cname('__pyx_memoryview_fromslice')
30114  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
30115  * int ndim,
30116  * object (*to_object_func)(char *),
30117  */
30118 
30119 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
30120  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
30121  Py_ssize_t __pyx_v_suboffset;
30122  PyObject *__pyx_v_length = NULL;
30123  PyObject *__pyx_r = NULL;
30124  __Pyx_RefNannyDeclarations
30125  int __pyx_t_1;
30126  PyObject *__pyx_t_2 = NULL;
30127  PyObject *__pyx_t_3 = NULL;
30128  __Pyx_TypeInfo *__pyx_t_4;
30129  Py_buffer __pyx_t_5;
30130  Py_ssize_t *__pyx_t_6;
30131  Py_ssize_t *__pyx_t_7;
30132  Py_ssize_t *__pyx_t_8;
30133  Py_ssize_t __pyx_t_9;
30134  int __pyx_lineno = 0;
30135  const char *__pyx_filename = NULL;
30136  int __pyx_clineno = 0;
30137  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
30138 
30139  /* "View.MemoryView":1007
30140  * cdef _memoryviewslice result
30141  *
30142  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
30143  * return None
30144  *
30145  */
30146  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
30147  if (__pyx_t_1) {
30148 
30149  /* "View.MemoryView":1008
30150  *
30151  * if <PyObject *> memviewslice.memview == Py_None:
30152  * return None # <<<<<<<<<<<<<<
30153  *
30154  *
30155  */
30156  __Pyx_XDECREF(__pyx_r);
30157  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30158  goto __pyx_L0;
30159 
30160  /* "View.MemoryView":1007
30161  * cdef _memoryviewslice result
30162  *
30163  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
30164  * return None
30165  *
30166  */
30167  }
30168 
30169  /* "View.MemoryView":1013
30170  *
30171  *
30172  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
30173  *
30174  * result.from_slice = memviewslice
30175  */
30176  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
30177  __Pyx_GOTREF(__pyx_t_2);
30178  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
30179  __Pyx_GOTREF(__pyx_t_3);
30180  __Pyx_INCREF(Py_None);
30181  __Pyx_GIVEREF(Py_None);
30182  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
30183  __Pyx_INCREF(__pyx_int_0);
30184  __Pyx_GIVEREF(__pyx_int_0);
30185  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
30186  __Pyx_GIVEREF(__pyx_t_2);
30187  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
30188  __pyx_t_2 = 0;
30189  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
30190  __Pyx_GOTREF(__pyx_t_2);
30191  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30192  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
30193  __pyx_t_2 = 0;
30194 
30195  /* "View.MemoryView":1015
30196  * result = _memoryviewslice(None, 0, dtype_is_object)
30197  *
30198  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
30199  * __PYX_INC_MEMVIEW(&memviewslice, 1)
30200  *
30201  */
30202  __pyx_v_result->from_slice = __pyx_v_memviewslice;
30203 
30204  /* "View.MemoryView":1016
30205  *
30206  * result.from_slice = memviewslice
30207  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
30208  *
30209  * result.from_object = (<memoryview> memviewslice.memview).base
30210  */
30211  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
30212 
30213  /* "View.MemoryView":1018
30214  * __PYX_INC_MEMVIEW(&memviewslice, 1)
30215  *
30216  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
30217  * result.typeinfo = memviewslice.memview.typeinfo
30218  *
30219  */
30220  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
30221  __Pyx_GOTREF(__pyx_t_2);
30222  __Pyx_GIVEREF(__pyx_t_2);
30223  __Pyx_GOTREF(__pyx_v_result->from_object);
30224  __Pyx_DECREF(__pyx_v_result->from_object);
30225  __pyx_v_result->from_object = __pyx_t_2;
30226  __pyx_t_2 = 0;
30227 
30228  /* "View.MemoryView":1019
30229  *
30230  * result.from_object = (<memoryview> memviewslice.memview).base
30231  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
30232  *
30233  * result.view = memviewslice.memview.view
30234  */
30235  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
30236  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
30237 
30238  /* "View.MemoryView":1021
30239  * result.typeinfo = memviewslice.memview.typeinfo
30240  *
30241  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
30242  * result.view.buf = <void *> memviewslice.data
30243  * result.view.ndim = ndim
30244  */
30245  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
30246  __pyx_v_result->__pyx_base.view = __pyx_t_5;
30247 
30248  /* "View.MemoryView":1022
30249  *
30250  * result.view = memviewslice.memview.view
30251  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
30252  * result.view.ndim = ndim
30253  * (<__pyx_buffer *> &result.view).obj = Py_None
30254  */
30255  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
30256 
30257  /* "View.MemoryView":1023
30258  * result.view = memviewslice.memview.view
30259  * result.view.buf = <void *> memviewslice.data
30260  * result.view.ndim = ndim # <<<<<<<<<<<<<<
30261  * (<__pyx_buffer *> &result.view).obj = Py_None
30262  * Py_INCREF(Py_None)
30263  */
30264  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
30265 
30266  /* "View.MemoryView":1024
30267  * result.view.buf = <void *> memviewslice.data
30268  * result.view.ndim = ndim
30269  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
30270  * Py_INCREF(Py_None)
30271  *
30272  */
30273  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
30274 
30275  /* "View.MemoryView":1025
30276  * result.view.ndim = ndim
30277  * (<__pyx_buffer *> &result.view).obj = Py_None
30278  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
30279  *
30280  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
30281  */
30282  Py_INCREF(Py_None);
30283 
30284  /* "View.MemoryView":1027
30285  * Py_INCREF(Py_None)
30286  *
30287  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
30288  * result.flags = PyBUF_RECORDS
30289  * else:
30290  */
30291  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
30292  if (__pyx_t_1) {
30293 
30294  /* "View.MemoryView":1028
30295  *
30296  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
30297  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
30298  * else:
30299  * result.flags = PyBUF_RECORDS_RO
30300  */
30301  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
30302 
30303  /* "View.MemoryView":1027
30304  * Py_INCREF(Py_None)
30305  *
30306  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
30307  * result.flags = PyBUF_RECORDS
30308  * else:
30309  */
30310  goto __pyx_L4;
30311  }
30312 
30313  /* "View.MemoryView":1030
30314  * result.flags = PyBUF_RECORDS
30315  * else:
30316  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
30317  *
30318  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
30319  */
30320  /*else*/ {
30321  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
30322  }
30323  __pyx_L4:;
30324 
30325  /* "View.MemoryView":1032
30326  * result.flags = PyBUF_RECORDS_RO
30327  *
30328  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
30329  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
30330  *
30331  */
30332  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
30333 
30334  /* "View.MemoryView":1033
30335  *
30336  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
30337  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
30338  *
30339  *
30340  */
30341  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
30342 
30343  /* "View.MemoryView":1036
30344  *
30345  *
30346  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
30347  * for suboffset in result.from_slice.suboffsets[:ndim]:
30348  * if suboffset >= 0:
30349  */
30350  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
30351 
30352  /* "View.MemoryView":1037
30353  *
30354  * result.view.suboffsets = NULL
30355  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
30356  * if suboffset >= 0:
30357  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
30358  */
30359  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
30360  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
30361  __pyx_t_6 = __pyx_t_8;
30362  __pyx_v_suboffset = (__pyx_t_6[0]);
30363 
30364  /* "View.MemoryView":1038
30365  * result.view.suboffsets = NULL
30366  * for suboffset in result.from_slice.suboffsets[:ndim]:
30367  * if suboffset >= 0: # <<<<<<<<<<<<<<
30368  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
30369  * break
30370  */
30371  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
30372  if (__pyx_t_1) {
30373 
30374  /* "View.MemoryView":1039
30375  * for suboffset in result.from_slice.suboffsets[:ndim]:
30376  * if suboffset >= 0:
30377  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
30378  * break
30379  *
30380  */
30381  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
30382 
30383  /* "View.MemoryView":1040
30384  * if suboffset >= 0:
30385  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
30386  * break # <<<<<<<<<<<<<<
30387  *
30388  * result.view.len = result.view.itemsize
30389  */
30390  goto __pyx_L6_break;
30391 
30392  /* "View.MemoryView":1038
30393  * result.view.suboffsets = NULL
30394  * for suboffset in result.from_slice.suboffsets[:ndim]:
30395  * if suboffset >= 0: # <<<<<<<<<<<<<<
30396  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
30397  * break
30398  */
30399  }
30400  }
30401  __pyx_L6_break:;
30402 
30403  /* "View.MemoryView":1042
30404  * break
30405  *
30406  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
30407  * for length in result.view.shape[:ndim]:
30408  * result.view.len *= length
30409  */
30410  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
30411  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
30412 
30413  /* "View.MemoryView":1043
30414  *
30415  * result.view.len = result.view.itemsize
30416  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
30417  * result.view.len *= length
30418  *
30419  */
30420  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
30421  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
30422  __pyx_t_6 = __pyx_t_8;
30423  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
30424  __Pyx_GOTREF(__pyx_t_2);
30425  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
30426  __pyx_t_2 = 0;
30427 
30428  /* "View.MemoryView":1044
30429  * result.view.len = result.view.itemsize
30430  * for length in result.view.shape[:ndim]:
30431  * result.view.len *= length # <<<<<<<<<<<<<<
30432  *
30433  * result.to_object_func = to_object_func
30434  */
30435  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
30436  __Pyx_GOTREF(__pyx_t_2);
30437  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
30438  __Pyx_GOTREF(__pyx_t_3);
30439  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30440  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
30441  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30442  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
30443  }
30444 
30445  /* "View.MemoryView":1046
30446  * result.view.len *= length
30447  *
30448  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
30449  * result.to_dtype_func = to_dtype_func
30450  *
30451  */
30452  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
30453 
30454  /* "View.MemoryView":1047
30455  *
30456  * result.to_object_func = to_object_func
30457  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
30458  *
30459  * return result
30460  */
30461  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
30462 
30463  /* "View.MemoryView":1049
30464  * result.to_dtype_func = to_dtype_func
30465  *
30466  * return result # <<<<<<<<<<<<<<
30467  *
30468  * @cname('__pyx_memoryview_get_slice_from_memoryview')
30469  */
30470  __Pyx_XDECREF(__pyx_r);
30471  __Pyx_INCREF(((PyObject *)__pyx_v_result));
30472  __pyx_r = ((PyObject *)__pyx_v_result);
30473  goto __pyx_L0;
30474 
30475  /* "View.MemoryView":999
30476  *
30477  * @cname('__pyx_memoryview_fromslice')
30478  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
30479  * int ndim,
30480  * object (*to_object_func)(char *),
30481  */
30482 
30483  /* function exit code */
30484  __pyx_L1_error:;
30485  __Pyx_XDECREF(__pyx_t_2);
30486  __Pyx_XDECREF(__pyx_t_3);
30487  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
30488  __pyx_r = 0;
30489  __pyx_L0:;
30490  __Pyx_XDECREF((PyObject *)__pyx_v_result);
30491  __Pyx_XDECREF(__pyx_v_length);
30492  __Pyx_XGIVEREF(__pyx_r);
30493  __Pyx_RefNannyFinishContext();
30494  return __pyx_r;
30495 }
30496 
30497 /* "View.MemoryView":1052
30498  *
30499  * @cname('__pyx_memoryview_get_slice_from_memoryview')
30500  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
30501  * __Pyx_memviewslice *mslice) except NULL:
30502  * cdef _memoryviewslice obj
30503  */
30504 
30505 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
30506  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
30507  __Pyx_memviewslice *__pyx_r;
30508  __Pyx_RefNannyDeclarations
30509  int __pyx_t_1;
30510  int __pyx_t_2;
30511  PyObject *__pyx_t_3 = NULL;
30512  int __pyx_lineno = 0;
30513  const char *__pyx_filename = NULL;
30514  int __pyx_clineno = 0;
30515  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
30516 
30517  /* "View.MemoryView":1055
30518  * __Pyx_memviewslice *mslice) except NULL:
30519  * cdef _memoryviewslice obj
30520  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
30521  * obj = memview
30522  * return &obj.from_slice
30523  */
30524  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
30525  __pyx_t_2 = (__pyx_t_1 != 0);
30526  if (__pyx_t_2) {
30527 
30528  /* "View.MemoryView":1056
30529  * cdef _memoryviewslice obj
30530  * if isinstance(memview, _memoryviewslice):
30531  * obj = memview # <<<<<<<<<<<<<<
30532  * return &obj.from_slice
30533  * else:
30534  */
30535  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
30536  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
30537  __Pyx_INCREF(__pyx_t_3);
30538  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
30539  __pyx_t_3 = 0;
30540 
30541  /* "View.MemoryView":1057
30542  * if isinstance(memview, _memoryviewslice):
30543  * obj = memview
30544  * return &obj.from_slice # <<<<<<<<<<<<<<
30545  * else:
30546  * slice_copy(memview, mslice)
30547  */
30548  __pyx_r = (&__pyx_v_obj->from_slice);
30549  goto __pyx_L0;
30550 
30551  /* "View.MemoryView":1055
30552  * __Pyx_memviewslice *mslice) except NULL:
30553  * cdef _memoryviewslice obj
30554  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
30555  * obj = memview
30556  * return &obj.from_slice
30557  */
30558  }
30559 
30560  /* "View.MemoryView":1059
30561  * return &obj.from_slice
30562  * else:
30563  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
30564  * return mslice
30565  *
30566  */
30567  /*else*/ {
30568  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
30569 
30570  /* "View.MemoryView":1060
30571  * else:
30572  * slice_copy(memview, mslice)
30573  * return mslice # <<<<<<<<<<<<<<
30574  *
30575  * @cname('__pyx_memoryview_slice_copy')
30576  */
30577  __pyx_r = __pyx_v_mslice;
30578  goto __pyx_L0;
30579  }
30580 
30581  /* "View.MemoryView":1052
30582  *
30583  * @cname('__pyx_memoryview_get_slice_from_memoryview')
30584  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
30585  * __Pyx_memviewslice *mslice) except NULL:
30586  * cdef _memoryviewslice obj
30587  */
30588 
30589  /* function exit code */
30590  __pyx_L1_error:;
30591  __Pyx_XDECREF(__pyx_t_3);
30592  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
30593  __pyx_r = NULL;
30594  __pyx_L0:;
30595  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
30596  __Pyx_RefNannyFinishContext();
30597  return __pyx_r;
30598 }
30599 
30600 /* "View.MemoryView":1063
30601  *
30602  * @cname('__pyx_memoryview_slice_copy')
30603  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
30604  * cdef int dim
30605  * cdef (Py_ssize_t*) shape, strides, suboffsets
30606  */
30607 
30608 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
30609  int __pyx_v_dim;
30610  Py_ssize_t *__pyx_v_shape;
30611  Py_ssize_t *__pyx_v_strides;
30612  Py_ssize_t *__pyx_v_suboffsets;
30613  __Pyx_RefNannyDeclarations
30614  Py_ssize_t *__pyx_t_1;
30615  int __pyx_t_2;
30616  int __pyx_t_3;
30617  int __pyx_t_4;
30618  Py_ssize_t __pyx_t_5;
30619  __Pyx_RefNannySetupContext("slice_copy", 0);
30620 
30621  /* "View.MemoryView":1067
30622  * cdef (Py_ssize_t*) shape, strides, suboffsets
30623  *
30624  * shape = memview.view.shape # <<<<<<<<<<<<<<
30625  * strides = memview.view.strides
30626  * suboffsets = memview.view.suboffsets
30627  */
30628  __pyx_t_1 = __pyx_v_memview->view.shape;
30629  __pyx_v_shape = __pyx_t_1;
30630 
30631  /* "View.MemoryView":1068
30632  *
30633  * shape = memview.view.shape
30634  * strides = memview.view.strides # <<<<<<<<<<<<<<
30635  * suboffsets = memview.view.suboffsets
30636  *
30637  */
30638  __pyx_t_1 = __pyx_v_memview->view.strides;
30639  __pyx_v_strides = __pyx_t_1;
30640 
30641  /* "View.MemoryView":1069
30642  * shape = memview.view.shape
30643  * strides = memview.view.strides
30644  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
30645  *
30646  * dst.memview = <__pyx_memoryview *> memview
30647  */
30648  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
30649  __pyx_v_suboffsets = __pyx_t_1;
30650 
30651  /* "View.MemoryView":1071
30652  * suboffsets = memview.view.suboffsets
30653  *
30654  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
30655  * dst.data = <char *> memview.view.buf
30656  *
30657  */
30658  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
30659 
30660  /* "View.MemoryView":1072
30661  *
30662  * dst.memview = <__pyx_memoryview *> memview
30663  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
30664  *
30665  * for dim in range(memview.view.ndim):
30666  */
30667  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
30668 
30669  /* "View.MemoryView":1074
30670  * dst.data = <char *> memview.view.buf
30671  *
30672  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
30673  * dst.shape[dim] = shape[dim]
30674  * dst.strides[dim] = strides[dim]
30675  */
30676  __pyx_t_2 = __pyx_v_memview->view.ndim;
30677  __pyx_t_3 = __pyx_t_2;
30678  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
30679  __pyx_v_dim = __pyx_t_4;
30680 
30681  /* "View.MemoryView":1075
30682  *
30683  * for dim in range(memview.view.ndim):
30684  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
30685  * dst.strides[dim] = strides[dim]
30686  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
30687  */
30688  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
30689 
30690  /* "View.MemoryView":1076
30691  * for dim in range(memview.view.ndim):
30692  * dst.shape[dim] = shape[dim]
30693  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
30694  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
30695  *
30696  */
30697  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
30698 
30699  /* "View.MemoryView":1077
30700  * dst.shape[dim] = shape[dim]
30701  * dst.strides[dim] = strides[dim]
30702  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
30703  *
30704  * @cname('__pyx_memoryview_copy_object')
30705  */
30706  if ((__pyx_v_suboffsets != 0)) {
30707  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
30708  } else {
30709  __pyx_t_5 = -1L;
30710  }
30711  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
30712  }
30713 
30714  /* "View.MemoryView":1063
30715  *
30716  * @cname('__pyx_memoryview_slice_copy')
30717  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
30718  * cdef int dim
30719  * cdef (Py_ssize_t*) shape, strides, suboffsets
30720  */
30721 
30722  /* function exit code */
30723  __Pyx_RefNannyFinishContext();
30724 }
30725 
30726 /* "View.MemoryView":1080
30727  *
30728  * @cname('__pyx_memoryview_copy_object')
30729  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
30730  * "Create a new memoryview object"
30731  * cdef __Pyx_memviewslice memviewslice
30732  */
30733 
30734 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
30735  __Pyx_memviewslice __pyx_v_memviewslice;
30736  PyObject *__pyx_r = NULL;
30737  __Pyx_RefNannyDeclarations
30738  PyObject *__pyx_t_1 = NULL;
30739  int __pyx_lineno = 0;
30740  const char *__pyx_filename = NULL;
30741  int __pyx_clineno = 0;
30742  __Pyx_RefNannySetupContext("memoryview_copy", 0);
30743 
30744  /* "View.MemoryView":1083
30745  * "Create a new memoryview object"
30746  * cdef __Pyx_memviewslice memviewslice
30747  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
30748  * return memoryview_copy_from_slice(memview, &memviewslice)
30749  *
30750  */
30751  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
30752 
30753  /* "View.MemoryView":1084
30754  * cdef __Pyx_memviewslice memviewslice
30755  * slice_copy(memview, &memviewslice)
30756  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
30757  *
30758  * @cname('__pyx_memoryview_copy_object_from_slice')
30759  */
30760  __Pyx_XDECREF(__pyx_r);
30761  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
30762  __Pyx_GOTREF(__pyx_t_1);
30763  __pyx_r = __pyx_t_1;
30764  __pyx_t_1 = 0;
30765  goto __pyx_L0;
30766 
30767  /* "View.MemoryView":1080
30768  *
30769  * @cname('__pyx_memoryview_copy_object')
30770  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
30771  * "Create a new memoryview object"
30772  * cdef __Pyx_memviewslice memviewslice
30773  */
30774 
30775  /* function exit code */
30776  __pyx_L1_error:;
30777  __Pyx_XDECREF(__pyx_t_1);
30778  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
30779  __pyx_r = 0;
30780  __pyx_L0:;
30781  __Pyx_XGIVEREF(__pyx_r);
30782  __Pyx_RefNannyFinishContext();
30783  return __pyx_r;
30784 }
30785 
30786 /* "View.MemoryView":1087
30787  *
30788  * @cname('__pyx_memoryview_copy_object_from_slice')
30789  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
30790  * """
30791  * Create a new memoryview object from a given memoryview object and slice.
30792  */
30793 
30794 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
30795  PyObject *(*__pyx_v_to_object_func)(char *);
30796  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
30797  PyObject *__pyx_r = NULL;
30798  __Pyx_RefNannyDeclarations
30799  int __pyx_t_1;
30800  int __pyx_t_2;
30801  PyObject *(*__pyx_t_3)(char *);
30802  int (*__pyx_t_4)(char *, PyObject *);
30803  PyObject *__pyx_t_5 = NULL;
30804  int __pyx_lineno = 0;
30805  const char *__pyx_filename = NULL;
30806  int __pyx_clineno = 0;
30807  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
30808 
30809  /* "View.MemoryView":1094
30810  * cdef int (*to_dtype_func)(char *, object) except 0
30811  *
30812  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
30813  * to_object_func = (<_memoryviewslice> memview).to_object_func
30814  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
30815  */
30816  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
30817  __pyx_t_2 = (__pyx_t_1 != 0);
30818  if (__pyx_t_2) {
30819 
30820  /* "View.MemoryView":1095
30821  *
30822  * if isinstance(memview, _memoryviewslice):
30823  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
30824  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
30825  * else:
30826  */
30827  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
30828  __pyx_v_to_object_func = __pyx_t_3;
30829 
30830  /* "View.MemoryView":1096
30831  * if isinstance(memview, _memoryviewslice):
30832  * to_object_func = (<_memoryviewslice> memview).to_object_func
30833  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
30834  * else:
30835  * to_object_func = NULL
30836  */
30837  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
30838  __pyx_v_to_dtype_func = __pyx_t_4;
30839 
30840  /* "View.MemoryView":1094
30841  * cdef int (*to_dtype_func)(char *, object) except 0
30842  *
30843  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
30844  * to_object_func = (<_memoryviewslice> memview).to_object_func
30845  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
30846  */
30847  goto __pyx_L3;
30848  }
30849 
30850  /* "View.MemoryView":1098
30851  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
30852  * else:
30853  * to_object_func = NULL # <<<<<<<<<<<<<<
30854  * to_dtype_func = NULL
30855  *
30856  */
30857  /*else*/ {
30858  __pyx_v_to_object_func = NULL;
30859 
30860  /* "View.MemoryView":1099
30861  * else:
30862  * to_object_func = NULL
30863  * to_dtype_func = NULL # <<<<<<<<<<<<<<
30864  *
30865  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
30866  */
30867  __pyx_v_to_dtype_func = NULL;
30868  }
30869  __pyx_L3:;
30870 
30871  /* "View.MemoryView":1101
30872  * to_dtype_func = NULL
30873  *
30874  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
30875  * to_object_func, to_dtype_func,
30876  * memview.dtype_is_object)
30877  */
30878  __Pyx_XDECREF(__pyx_r);
30879 
30880  /* "View.MemoryView":1103
30881  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
30882  * to_object_func, to_dtype_func,
30883  * memview.dtype_is_object) # <<<<<<<<<<<<<<
30884  *
30885  *
30886  */
30887  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
30888  __Pyx_GOTREF(__pyx_t_5);
30889  __pyx_r = __pyx_t_5;
30890  __pyx_t_5 = 0;
30891  goto __pyx_L0;
30892 
30893  /* "View.MemoryView":1087
30894  *
30895  * @cname('__pyx_memoryview_copy_object_from_slice')
30896  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
30897  * """
30898  * Create a new memoryview object from a given memoryview object and slice.
30899  */
30900 
30901  /* function exit code */
30902  __pyx_L1_error:;
30903  __Pyx_XDECREF(__pyx_t_5);
30904  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
30905  __pyx_r = 0;
30906  __pyx_L0:;
30907  __Pyx_XGIVEREF(__pyx_r);
30908  __Pyx_RefNannyFinishContext();
30909  return __pyx_r;
30910 }
30911 
30912 /* "View.MemoryView":1109
30913  *
30914  *
30915  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
30916  * if arg < 0:
30917  * return -arg
30918  */
30919 
30920 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
30921  Py_ssize_t __pyx_r;
30922  int __pyx_t_1;
30923 
30924  /* "View.MemoryView":1110
30925  *
30926  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
30927  * if arg < 0: # <<<<<<<<<<<<<<
30928  * return -arg
30929  * else:
30930  */
30931  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
30932  if (__pyx_t_1) {
30933 
30934  /* "View.MemoryView":1111
30935  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
30936  * if arg < 0:
30937  * return -arg # <<<<<<<<<<<<<<
30938  * else:
30939  * return arg
30940  */
30941  __pyx_r = (-__pyx_v_arg);
30942  goto __pyx_L0;
30943 
30944  /* "View.MemoryView":1110
30945  *
30946  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
30947  * if arg < 0: # <<<<<<<<<<<<<<
30948  * return -arg
30949  * else:
30950  */
30951  }
30952 
30953  /* "View.MemoryView":1113
30954  * return -arg
30955  * else:
30956  * return arg # <<<<<<<<<<<<<<
30957  *
30958  * @cname('__pyx_get_best_slice_order')
30959  */
30960  /*else*/ {
30961  __pyx_r = __pyx_v_arg;
30962  goto __pyx_L0;
30963  }
30964 
30965  /* "View.MemoryView":1109
30966  *
30967  *
30968  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
30969  * if arg < 0:
30970  * return -arg
30971  */
30972 
30973  /* function exit code */
30974  __pyx_L0:;
30975  return __pyx_r;
30976 }
30977 
30978 /* "View.MemoryView":1116
30979  *
30980  * @cname('__pyx_get_best_slice_order')
30981  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
30982  * """
30983  * Figure out the best memory access order for a given slice.
30984  */
30985 
30986 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
30987  int __pyx_v_i;
30988  Py_ssize_t __pyx_v_c_stride;
30989  Py_ssize_t __pyx_v_f_stride;
30990  char __pyx_r;
30991  int __pyx_t_1;
30992  int __pyx_t_2;
30993  int __pyx_t_3;
30994  int __pyx_t_4;
30995 
30996  /* "View.MemoryView":1121
30997  * """
30998  * cdef int i
30999  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
31000  * cdef Py_ssize_t f_stride = 0
31001  *
31002  */
31003  __pyx_v_c_stride = 0;
31004 
31005  /* "View.MemoryView":1122
31006  * cdef int i
31007  * cdef Py_ssize_t c_stride = 0
31008  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
31009  *
31010  * for i in range(ndim - 1, -1, -1):
31011  */
31012  __pyx_v_f_stride = 0;
31013 
31014  /* "View.MemoryView":1124
31015  * cdef Py_ssize_t f_stride = 0
31016  *
31017  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
31018  * if mslice.shape[i] > 1:
31019  * c_stride = mslice.strides[i]
31020  */
31021  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
31022  __pyx_v_i = __pyx_t_1;
31023 
31024  /* "View.MemoryView":1125
31025  *
31026  * for i in range(ndim - 1, -1, -1):
31027  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
31028  * c_stride = mslice.strides[i]
31029  * break
31030  */
31031  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
31032  if (__pyx_t_2) {
31033 
31034  /* "View.MemoryView":1126
31035  * for i in range(ndim - 1, -1, -1):
31036  * if mslice.shape[i] > 1:
31037  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
31038  * break
31039  *
31040  */
31041  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
31042 
31043  /* "View.MemoryView":1127
31044  * if mslice.shape[i] > 1:
31045  * c_stride = mslice.strides[i]
31046  * break # <<<<<<<<<<<<<<
31047  *
31048  * for i in range(ndim):
31049  */
31050  goto __pyx_L4_break;
31051 
31052  /* "View.MemoryView":1125
31053  *
31054  * for i in range(ndim - 1, -1, -1):
31055  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
31056  * c_stride = mslice.strides[i]
31057  * break
31058  */
31059  }
31060  }
31061  __pyx_L4_break:;
31062 
31063  /* "View.MemoryView":1129
31064  * break
31065  *
31066  * for i in range(ndim): # <<<<<<<<<<<<<<
31067  * if mslice.shape[i] > 1:
31068  * f_stride = mslice.strides[i]
31069  */
31070  __pyx_t_1 = __pyx_v_ndim;
31071  __pyx_t_3 = __pyx_t_1;
31072  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
31073  __pyx_v_i = __pyx_t_4;
31074 
31075  /* "View.MemoryView":1130
31076  *
31077  * for i in range(ndim):
31078  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
31079  * f_stride = mslice.strides[i]
31080  * break
31081  */
31082  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
31083  if (__pyx_t_2) {
31084 
31085  /* "View.MemoryView":1131
31086  * for i in range(ndim):
31087  * if mslice.shape[i] > 1:
31088  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
31089  * break
31090  *
31091  */
31092  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
31093 
31094  /* "View.MemoryView":1132
31095  * if mslice.shape[i] > 1:
31096  * f_stride = mslice.strides[i]
31097  * break # <<<<<<<<<<<<<<
31098  *
31099  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
31100  */
31101  goto __pyx_L7_break;
31102 
31103  /* "View.MemoryView":1130
31104  *
31105  * for i in range(ndim):
31106  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
31107  * f_stride = mslice.strides[i]
31108  * break
31109  */
31110  }
31111  }
31112  __pyx_L7_break:;
31113 
31114  /* "View.MemoryView":1134
31115  * break
31116  *
31117  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
31118  * return 'C'
31119  * else:
31120  */
31121  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
31122  if (__pyx_t_2) {
31123 
31124  /* "View.MemoryView":1135
31125  *
31126  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
31127  * return 'C' # <<<<<<<<<<<<<<
31128  * else:
31129  * return 'F'
31130  */
31131  __pyx_r = 'C';
31132  goto __pyx_L0;
31133 
31134  /* "View.MemoryView":1134
31135  * break
31136  *
31137  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
31138  * return 'C'
31139  * else:
31140  */
31141  }
31142 
31143  /* "View.MemoryView":1137
31144  * return 'C'
31145  * else:
31146  * return 'F' # <<<<<<<<<<<<<<
31147  *
31148  * @cython.cdivision(True)
31149  */
31150  /*else*/ {
31151  __pyx_r = 'F';
31152  goto __pyx_L0;
31153  }
31154 
31155  /* "View.MemoryView":1116
31156  *
31157  * @cname('__pyx_get_best_slice_order')
31158  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
31159  * """
31160  * Figure out the best memory access order for a given slice.
31161  */
31162 
31163  /* function exit code */
31164  __pyx_L0:;
31165  return __pyx_r;
31166 }
31167 
31168 /* "View.MemoryView":1140
31169  *
31170  * @cython.cdivision(True)
31171  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
31172  * char *dst_data, Py_ssize_t *dst_strides,
31173  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
31174  */
31175 
31176 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
31177  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
31178  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
31179  Py_ssize_t __pyx_v_dst_extent;
31180  Py_ssize_t __pyx_v_src_stride;
31181  Py_ssize_t __pyx_v_dst_stride;
31182  int __pyx_t_1;
31183  int __pyx_t_2;
31184  int __pyx_t_3;
31185  Py_ssize_t __pyx_t_4;
31186  Py_ssize_t __pyx_t_5;
31187  Py_ssize_t __pyx_t_6;
31188 
31189  /* "View.MemoryView":1147
31190  *
31191  * cdef Py_ssize_t i
31192  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
31193  * cdef Py_ssize_t dst_extent = dst_shape[0]
31194  * cdef Py_ssize_t src_stride = src_strides[0]
31195  */
31196  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
31197 
31198  /* "View.MemoryView":1148
31199  * cdef Py_ssize_t i
31200  * cdef Py_ssize_t src_extent = src_shape[0]
31201  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
31202  * cdef Py_ssize_t src_stride = src_strides[0]
31203  * cdef Py_ssize_t dst_stride = dst_strides[0]
31204  */
31205  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
31206 
31207  /* "View.MemoryView":1149
31208  * cdef Py_ssize_t src_extent = src_shape[0]
31209  * cdef Py_ssize_t dst_extent = dst_shape[0]
31210  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
31211  * cdef Py_ssize_t dst_stride = dst_strides[0]
31212  *
31213  */
31214  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
31215 
31216  /* "View.MemoryView":1150
31217  * cdef Py_ssize_t dst_extent = dst_shape[0]
31218  * cdef Py_ssize_t src_stride = src_strides[0]
31219  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
31220  *
31221  * if ndim == 1:
31222  */
31223  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
31224 
31225  /* "View.MemoryView":1152
31226  * cdef Py_ssize_t dst_stride = dst_strides[0]
31227  *
31228  * if ndim == 1: # <<<<<<<<<<<<<<
31229  * if (src_stride > 0 and dst_stride > 0 and
31230  * <size_t> src_stride == itemsize == <size_t> dst_stride):
31231  */
31232  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
31233  if (__pyx_t_1) {
31234 
31235  /* "View.MemoryView":1153
31236  *
31237  * if ndim == 1:
31238  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
31239  * <size_t> src_stride == itemsize == <size_t> dst_stride):
31240  * memcpy(dst_data, src_data, itemsize * dst_extent)
31241  */
31242  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
31243  if (__pyx_t_2) {
31244  } else {
31245  __pyx_t_1 = __pyx_t_2;
31246  goto __pyx_L5_bool_binop_done;
31247  }
31248  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
31249  if (__pyx_t_2) {
31250  } else {
31251  __pyx_t_1 = __pyx_t_2;
31252  goto __pyx_L5_bool_binop_done;
31253  }
31254 
31255  /* "View.MemoryView":1154
31256  * if ndim == 1:
31257  * if (src_stride > 0 and dst_stride > 0 and
31258  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
31259  * memcpy(dst_data, src_data, itemsize * dst_extent)
31260  * else:
31261  */
31262  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
31263  if (__pyx_t_2) {
31264  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
31265  }
31266  __pyx_t_3 = (__pyx_t_2 != 0);
31267  __pyx_t_1 = __pyx_t_3;
31268  __pyx_L5_bool_binop_done:;
31269 
31270  /* "View.MemoryView":1153
31271  *
31272  * if ndim == 1:
31273  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
31274  * <size_t> src_stride == itemsize == <size_t> dst_stride):
31275  * memcpy(dst_data, src_data, itemsize * dst_extent)
31276  */
31277  if (__pyx_t_1) {
31278 
31279  /* "View.MemoryView":1155
31280  * if (src_stride > 0 and dst_stride > 0 and
31281  * <size_t> src_stride == itemsize == <size_t> dst_stride):
31282  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
31283  * else:
31284  * for i in range(dst_extent):
31285  */
31286  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
31287 
31288  /* "View.MemoryView":1153
31289  *
31290  * if ndim == 1:
31291  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
31292  * <size_t> src_stride == itemsize == <size_t> dst_stride):
31293  * memcpy(dst_data, src_data, itemsize * dst_extent)
31294  */
31295  goto __pyx_L4;
31296  }
31297 
31298  /* "View.MemoryView":1157
31299  * memcpy(dst_data, src_data, itemsize * dst_extent)
31300  * else:
31301  * for i in range(dst_extent): # <<<<<<<<<<<<<<
31302  * memcpy(dst_data, src_data, itemsize)
31303  * src_data += src_stride
31304  */
31305  /*else*/ {
31306  __pyx_t_4 = __pyx_v_dst_extent;
31307  __pyx_t_5 = __pyx_t_4;
31308  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
31309  __pyx_v_i = __pyx_t_6;
31310 
31311  /* "View.MemoryView":1158
31312  * else:
31313  * for i in range(dst_extent):
31314  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
31315  * src_data += src_stride
31316  * dst_data += dst_stride
31317  */
31318  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
31319 
31320  /* "View.MemoryView":1159
31321  * for i in range(dst_extent):
31322  * memcpy(dst_data, src_data, itemsize)
31323  * src_data += src_stride # <<<<<<<<<<<<<<
31324  * dst_data += dst_stride
31325  * else:
31326  */
31327  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
31328 
31329  /* "View.MemoryView":1160
31330  * memcpy(dst_data, src_data, itemsize)
31331  * src_data += src_stride
31332  * dst_data += dst_stride # <<<<<<<<<<<<<<
31333  * else:
31334  * for i in range(dst_extent):
31335  */
31336  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
31337  }
31338  }
31339  __pyx_L4:;
31340 
31341  /* "View.MemoryView":1152
31342  * cdef Py_ssize_t dst_stride = dst_strides[0]
31343  *
31344  * if ndim == 1: # <<<<<<<<<<<<<<
31345  * if (src_stride > 0 and dst_stride > 0 and
31346  * <size_t> src_stride == itemsize == <size_t> dst_stride):
31347  */
31348  goto __pyx_L3;
31349  }
31350 
31351  /* "View.MemoryView":1162
31352  * dst_data += dst_stride
31353  * else:
31354  * for i in range(dst_extent): # <<<<<<<<<<<<<<
31355  * _copy_strided_to_strided(src_data, src_strides + 1,
31356  * dst_data, dst_strides + 1,
31357  */
31358  /*else*/ {
31359  __pyx_t_4 = __pyx_v_dst_extent;
31360  __pyx_t_5 = __pyx_t_4;
31361  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
31362  __pyx_v_i = __pyx_t_6;
31363 
31364  /* "View.MemoryView":1163
31365  * else:
31366  * for i in range(dst_extent):
31367  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
31368  * dst_data, dst_strides + 1,
31369  * src_shape + 1, dst_shape + 1,
31370  */
31371  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
31372 
31373  /* "View.MemoryView":1167
31374  * src_shape + 1, dst_shape + 1,
31375  * ndim - 1, itemsize)
31376  * src_data += src_stride # <<<<<<<<<<<<<<
31377  * dst_data += dst_stride
31378  *
31379  */
31380  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
31381 
31382  /* "View.MemoryView":1168
31383  * ndim - 1, itemsize)
31384  * src_data += src_stride
31385  * dst_data += dst_stride # <<<<<<<<<<<<<<
31386  *
31387  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
31388  */
31389  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
31390  }
31391  }
31392  __pyx_L3:;
31393 
31394  /* "View.MemoryView":1140
31395  *
31396  * @cython.cdivision(True)
31397  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
31398  * char *dst_data, Py_ssize_t *dst_strides,
31399  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
31400  */
31401 
31402  /* function exit code */
31403 }
31404 
31405 /* "View.MemoryView":1170
31406  * dst_data += dst_stride
31407  *
31408  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
31409  * __Pyx_memviewslice *dst,
31410  * int ndim, size_t itemsize) nogil:
31411  */
31412 
31413 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
31414 
31415  /* "View.MemoryView":1173
31416  * __Pyx_memviewslice *dst,
31417  * int ndim, size_t itemsize) nogil:
31418  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
31419  * src.shape, dst.shape, ndim, itemsize)
31420  *
31421  */
31422  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
31423 
31424  /* "View.MemoryView":1170
31425  * dst_data += dst_stride
31426  *
31427  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
31428  * __Pyx_memviewslice *dst,
31429  * int ndim, size_t itemsize) nogil:
31430  */
31431 
31432  /* function exit code */
31433 }
31434 
31435 /* "View.MemoryView":1177
31436  *
31437  * @cname('__pyx_memoryview_slice_get_size')
31438  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
31439  * "Return the size of the memory occupied by the slice in number of bytes"
31440  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
31441  */
31442 
31443 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
31444  Py_ssize_t __pyx_v_shape;
31445  Py_ssize_t __pyx_v_size;
31446  Py_ssize_t __pyx_r;
31447  Py_ssize_t __pyx_t_1;
31448  Py_ssize_t *__pyx_t_2;
31449  Py_ssize_t *__pyx_t_3;
31450  Py_ssize_t *__pyx_t_4;
31451 
31452  /* "View.MemoryView":1179
31453  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
31454  * "Return the size of the memory occupied by the slice in number of bytes"
31455  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
31456  *
31457  * for shape in src.shape[:ndim]:
31458  */
31459  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
31460  __pyx_v_size = __pyx_t_1;
31461 
31462  /* "View.MemoryView":1181
31463  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
31464  *
31465  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
31466  * size *= shape
31467  *
31468  */
31469  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
31470  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
31471  __pyx_t_2 = __pyx_t_4;
31472  __pyx_v_shape = (__pyx_t_2[0]);
31473 
31474  /* "View.MemoryView":1182
31475  *
31476  * for shape in src.shape[:ndim]:
31477  * size *= shape # <<<<<<<<<<<<<<
31478  *
31479  * return size
31480  */
31481  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
31482  }
31483 
31484  /* "View.MemoryView":1184
31485  * size *= shape
31486  *
31487  * return size # <<<<<<<<<<<<<<
31488  *
31489  * @cname('__pyx_fill_contig_strides_array')
31490  */
31491  __pyx_r = __pyx_v_size;
31492  goto __pyx_L0;
31493 
31494  /* "View.MemoryView":1177
31495  *
31496  * @cname('__pyx_memoryview_slice_get_size')
31497  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
31498  * "Return the size of the memory occupied by the slice in number of bytes"
31499  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
31500  */
31501 
31502  /* function exit code */
31503  __pyx_L0:;
31504  return __pyx_r;
31505 }
31506 
31507 /* "View.MemoryView":1187
31508  *
31509  * @cname('__pyx_fill_contig_strides_array')
31510  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
31511  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
31512  * int ndim, char order) nogil:
31513  */
31514 
31515 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
31516  int __pyx_v_idx;
31517  Py_ssize_t __pyx_r;
31518  int __pyx_t_1;
31519  int __pyx_t_2;
31520  int __pyx_t_3;
31521  int __pyx_t_4;
31522 
31523  /* "View.MemoryView":1196
31524  * cdef int idx
31525  *
31526  * if order == 'F': # <<<<<<<<<<<<<<
31527  * for idx in range(ndim):
31528  * strides[idx] = stride
31529  */
31530  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
31531  if (__pyx_t_1) {
31532 
31533  /* "View.MemoryView":1197
31534  *
31535  * if order == 'F':
31536  * for idx in range(ndim): # <<<<<<<<<<<<<<
31537  * strides[idx] = stride
31538  * stride *= shape[idx]
31539  */
31540  __pyx_t_2 = __pyx_v_ndim;
31541  __pyx_t_3 = __pyx_t_2;
31542  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
31543  __pyx_v_idx = __pyx_t_4;
31544 
31545  /* "View.MemoryView":1198
31546  * if order == 'F':
31547  * for idx in range(ndim):
31548  * strides[idx] = stride # <<<<<<<<<<<<<<
31549  * stride *= shape[idx]
31550  * else:
31551  */
31552  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
31553 
31554  /* "View.MemoryView":1199
31555  * for idx in range(ndim):
31556  * strides[idx] = stride
31557  * stride *= shape[idx] # <<<<<<<<<<<<<<
31558  * else:
31559  * for idx in range(ndim - 1, -1, -1):
31560  */
31561  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
31562  }
31563 
31564  /* "View.MemoryView":1196
31565  * cdef int idx
31566  *
31567  * if order == 'F': # <<<<<<<<<<<<<<
31568  * for idx in range(ndim):
31569  * strides[idx] = stride
31570  */
31571  goto __pyx_L3;
31572  }
31573 
31574  /* "View.MemoryView":1201
31575  * stride *= shape[idx]
31576  * else:
31577  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
31578  * strides[idx] = stride
31579  * stride *= shape[idx]
31580  */
31581  /*else*/ {
31582  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
31583  __pyx_v_idx = __pyx_t_2;
31584 
31585  /* "View.MemoryView":1202
31586  * else:
31587  * for idx in range(ndim - 1, -1, -1):
31588  * strides[idx] = stride # <<<<<<<<<<<<<<
31589  * stride *= shape[idx]
31590  *
31591  */
31592  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
31593 
31594  /* "View.MemoryView":1203
31595  * for idx in range(ndim - 1, -1, -1):
31596  * strides[idx] = stride
31597  * stride *= shape[idx] # <<<<<<<<<<<<<<
31598  *
31599  * return stride
31600  */
31601  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
31602  }
31603  }
31604  __pyx_L3:;
31605 
31606  /* "View.MemoryView":1205
31607  * stride *= shape[idx]
31608  *
31609  * return stride # <<<<<<<<<<<<<<
31610  *
31611  * @cname('__pyx_memoryview_copy_data_to_temp')
31612  */
31613  __pyx_r = __pyx_v_stride;
31614  goto __pyx_L0;
31615 
31616  /* "View.MemoryView":1187
31617  *
31618  * @cname('__pyx_fill_contig_strides_array')
31619  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
31620  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
31621  * int ndim, char order) nogil:
31622  */
31623 
31624  /* function exit code */
31625  __pyx_L0:;
31626  return __pyx_r;
31627 }
31628 
31629 /* "View.MemoryView":1208
31630  *
31631  * @cname('__pyx_memoryview_copy_data_to_temp')
31632  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
31633  * __Pyx_memviewslice *tmpslice,
31634  * char order,
31635  */
31636 
31637 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
31638  int __pyx_v_i;
31639  void *__pyx_v_result;
31640  size_t __pyx_v_itemsize;
31641  size_t __pyx_v_size;
31642  void *__pyx_r;
31643  Py_ssize_t __pyx_t_1;
31644  int __pyx_t_2;
31645  int __pyx_t_3;
31646  struct __pyx_memoryview_obj *__pyx_t_4;
31647  int __pyx_t_5;
31648  int __pyx_t_6;
31649  int __pyx_lineno = 0;
31650  const char *__pyx_filename = NULL;
31651  int __pyx_clineno = 0;
31652 
31653  /* "View.MemoryView":1219
31654  * cdef void *result
31655  *
31656  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
31657  * cdef size_t size = slice_get_size(src, ndim)
31658  *
31659  */
31660  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
31661  __pyx_v_itemsize = __pyx_t_1;
31662 
31663  /* "View.MemoryView":1220
31664  *
31665  * cdef size_t itemsize = src.memview.view.itemsize
31666  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
31667  *
31668  * result = malloc(size)
31669  */
31670  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
31671 
31672  /* "View.MemoryView":1222
31673  * cdef size_t size = slice_get_size(src, ndim)
31674  *
31675  * result = malloc(size) # <<<<<<<<<<<<<<
31676  * if not result:
31677  * _err(MemoryError, NULL)
31678  */
31679  __pyx_v_result = malloc(__pyx_v_size);
31680 
31681  /* "View.MemoryView":1223
31682  *
31683  * result = malloc(size)
31684  * if not result: # <<<<<<<<<<<<<<
31685  * _err(MemoryError, NULL)
31686  *
31687  */
31688  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
31689  if (__pyx_t_2) {
31690 
31691  /* "View.MemoryView":1224
31692  * result = malloc(size)
31693  * if not result:
31694  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
31695  *
31696  *
31697  */
31698  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
31699 
31700  /* "View.MemoryView":1223
31701  *
31702  * result = malloc(size)
31703  * if not result: # <<<<<<<<<<<<<<
31704  * _err(MemoryError, NULL)
31705  *
31706  */
31707  }
31708 
31709  /* "View.MemoryView":1227
31710  *
31711  *
31712  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
31713  * tmpslice.memview = src.memview
31714  * for i in range(ndim):
31715  */
31716  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
31717 
31718  /* "View.MemoryView":1228
31719  *
31720  * tmpslice.data = <char *> result
31721  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
31722  * for i in range(ndim):
31723  * tmpslice.shape[i] = src.shape[i]
31724  */
31725  __pyx_t_4 = __pyx_v_src->memview;
31726  __pyx_v_tmpslice->memview = __pyx_t_4;
31727 
31728  /* "View.MemoryView":1229
31729  * tmpslice.data = <char *> result
31730  * tmpslice.memview = src.memview
31731  * for i in range(ndim): # <<<<<<<<<<<<<<
31732  * tmpslice.shape[i] = src.shape[i]
31733  * tmpslice.suboffsets[i] = -1
31734  */
31735  __pyx_t_3 = __pyx_v_ndim;
31736  __pyx_t_5 = __pyx_t_3;
31737  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
31738  __pyx_v_i = __pyx_t_6;
31739 
31740  /* "View.MemoryView":1230
31741  * tmpslice.memview = src.memview
31742  * for i in range(ndim):
31743  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
31744  * tmpslice.suboffsets[i] = -1
31745  *
31746  */
31747  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
31748 
31749  /* "View.MemoryView":1231
31750  * for i in range(ndim):
31751  * tmpslice.shape[i] = src.shape[i]
31752  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
31753  *
31754  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
31755  */
31756  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
31757  }
31758 
31759  /* "View.MemoryView":1233
31760  * tmpslice.suboffsets[i] = -1
31761  *
31762  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
31763  * ndim, order)
31764  *
31765  */
31766  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
31767 
31768  /* "View.MemoryView":1237
31769  *
31770  *
31771  * for i in range(ndim): # <<<<<<<<<<<<<<
31772  * if tmpslice.shape[i] == 1:
31773  * tmpslice.strides[i] = 0
31774  */
31775  __pyx_t_3 = __pyx_v_ndim;
31776  __pyx_t_5 = __pyx_t_3;
31777  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
31778  __pyx_v_i = __pyx_t_6;
31779 
31780  /* "View.MemoryView":1238
31781  *
31782  * for i in range(ndim):
31783  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
31784  * tmpslice.strides[i] = 0
31785  *
31786  */
31787  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
31788  if (__pyx_t_2) {
31789 
31790  /* "View.MemoryView":1239
31791  * for i in range(ndim):
31792  * if tmpslice.shape[i] == 1:
31793  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
31794  *
31795  * if slice_is_contig(src[0], order, ndim):
31796  */
31797  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
31798 
31799  /* "View.MemoryView":1238
31800  *
31801  * for i in range(ndim):
31802  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
31803  * tmpslice.strides[i] = 0
31804  *
31805  */
31806  }
31807  }
31808 
31809  /* "View.MemoryView":1241
31810  * tmpslice.strides[i] = 0
31811  *
31812  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
31813  * memcpy(result, src.data, size)
31814  * else:
31815  */
31816  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
31817  if (__pyx_t_2) {
31818 
31819  /* "View.MemoryView":1242
31820  *
31821  * if slice_is_contig(src[0], order, ndim):
31822  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
31823  * else:
31824  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
31825  */
31826  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
31827 
31828  /* "View.MemoryView":1241
31829  * tmpslice.strides[i] = 0
31830  *
31831  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
31832  * memcpy(result, src.data, size)
31833  * else:
31834  */
31835  goto __pyx_L9;
31836  }
31837 
31838  /* "View.MemoryView":1244
31839  * memcpy(result, src.data, size)
31840  * else:
31841  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
31842  *
31843  * return result
31844  */
31845  /*else*/ {
31846  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
31847  }
31848  __pyx_L9:;
31849 
31850  /* "View.MemoryView":1246
31851  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
31852  *
31853  * return result # <<<<<<<<<<<<<<
31854  *
31855  *
31856  */
31857  __pyx_r = __pyx_v_result;
31858  goto __pyx_L0;
31859 
31860  /* "View.MemoryView":1208
31861  *
31862  * @cname('__pyx_memoryview_copy_data_to_temp')
31863  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
31864  * __Pyx_memviewslice *tmpslice,
31865  * char order,
31866  */
31867 
31868  /* function exit code */
31869  __pyx_L1_error:;
31870  {
31871  #ifdef WITH_THREAD
31872  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
31873  #endif
31874  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
31875  #ifdef WITH_THREAD
31876  __Pyx_PyGILState_Release(__pyx_gilstate_save);
31877  #endif
31878  }
31879  __pyx_r = NULL;
31880  __pyx_L0:;
31881  return __pyx_r;
31882 }
31883 
31884 /* "View.MemoryView":1251
31885  *
31886  * @cname('__pyx_memoryview_err_extents')
31887  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
31888  * Py_ssize_t extent2) except -1 with gil:
31889  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
31890  */
31891 
31892 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
31893  int __pyx_r;
31894  __Pyx_RefNannyDeclarations
31895  PyObject *__pyx_t_1 = NULL;
31896  PyObject *__pyx_t_2 = NULL;
31897  PyObject *__pyx_t_3 = NULL;
31898  PyObject *__pyx_t_4 = NULL;
31899  int __pyx_lineno = 0;
31900  const char *__pyx_filename = NULL;
31901  int __pyx_clineno = 0;
31902  #ifdef WITH_THREAD
31903  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
31904  #endif
31905  __Pyx_RefNannySetupContext("_err_extents", 0);
31906 
31907  /* "View.MemoryView":1254
31908  * Py_ssize_t extent2) except -1 with gil:
31909  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
31910  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
31911  *
31912  * @cname('__pyx_memoryview_err_dim')
31913  */
31914  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
31915  __Pyx_GOTREF(__pyx_t_1);
31916  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
31917  __Pyx_GOTREF(__pyx_t_2);
31918  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
31919  __Pyx_GOTREF(__pyx_t_3);
31920  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
31921  __Pyx_GOTREF(__pyx_t_4);
31922  __Pyx_GIVEREF(__pyx_t_1);
31923  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
31924  __Pyx_GIVEREF(__pyx_t_2);
31925  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
31926  __Pyx_GIVEREF(__pyx_t_3);
31927  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
31928  __pyx_t_1 = 0;
31929  __pyx_t_2 = 0;
31930  __pyx_t_3 = 0;
31931 
31932  /* "View.MemoryView":1253
31933  * cdef int _err_extents(int i, Py_ssize_t extent1,
31934  * Py_ssize_t extent2) except -1 with gil:
31935  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
31936  * (i, extent1, extent2))
31937  *
31938  */
31939  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
31940  __Pyx_GOTREF(__pyx_t_3);
31941  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31942  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
31943  __Pyx_GOTREF(__pyx_t_4);
31944  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31945  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
31946  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31947  __PYX_ERR(1, 1253, __pyx_L1_error)
31948 
31949  /* "View.MemoryView":1251
31950  *
31951  * @cname('__pyx_memoryview_err_extents')
31952  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
31953  * Py_ssize_t extent2) except -1 with gil:
31954  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
31955  */
31956 
31957  /* function exit code */
31958  __pyx_L1_error:;
31959  __Pyx_XDECREF(__pyx_t_1);
31960  __Pyx_XDECREF(__pyx_t_2);
31961  __Pyx_XDECREF(__pyx_t_3);
31962  __Pyx_XDECREF(__pyx_t_4);
31963  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
31964  __pyx_r = -1;
31965  __Pyx_RefNannyFinishContext();
31966  #ifdef WITH_THREAD
31967  __Pyx_PyGILState_Release(__pyx_gilstate_save);
31968  #endif
31969  return __pyx_r;
31970 }
31971 
31972 /* "View.MemoryView":1257
31973  *
31974  * @cname('__pyx_memoryview_err_dim')
31975  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
31976  * raise error(msg.decode('ascii') % dim)
31977  *
31978  */
31979 
31980 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
31981  int __pyx_r;
31982  __Pyx_RefNannyDeclarations
31983  PyObject *__pyx_t_1 = NULL;
31984  PyObject *__pyx_t_2 = NULL;
31985  PyObject *__pyx_t_3 = NULL;
31986  PyObject *__pyx_t_4 = NULL;
31987  int __pyx_lineno = 0;
31988  const char *__pyx_filename = NULL;
31989  int __pyx_clineno = 0;
31990  #ifdef WITH_THREAD
31991  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
31992  #endif
31993  __Pyx_RefNannySetupContext("_err_dim", 0);
31994  __Pyx_INCREF(__pyx_v_error);
31995 
31996  /* "View.MemoryView":1258
31997  * @cname('__pyx_memoryview_err_dim')
31998  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
31999  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
32000  *
32001  * @cname('__pyx_memoryview_err')
32002  */
32003  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
32004  __Pyx_GOTREF(__pyx_t_2);
32005  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
32006  __Pyx_GOTREF(__pyx_t_3);
32007  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
32008  __Pyx_GOTREF(__pyx_t_4);
32009  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32010  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32011  __Pyx_INCREF(__pyx_v_error);
32012  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
32013  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
32014  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
32015  if (likely(__pyx_t_2)) {
32016  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
32017  __Pyx_INCREF(__pyx_t_2);
32018  __Pyx_INCREF(function);
32019  __Pyx_DECREF_SET(__pyx_t_3, function);
32020  }
32021  }
32022  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
32023  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
32024  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32025  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
32026  __Pyx_GOTREF(__pyx_t_1);
32027  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32028  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
32029  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32030  __PYX_ERR(1, 1258, __pyx_L1_error)
32031 
32032  /* "View.MemoryView":1257
32033  *
32034  * @cname('__pyx_memoryview_err_dim')
32035  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
32036  * raise error(msg.decode('ascii') % dim)
32037  *
32038  */
32039 
32040  /* function exit code */
32041  __pyx_L1_error:;
32042  __Pyx_XDECREF(__pyx_t_1);
32043  __Pyx_XDECREF(__pyx_t_2);
32044  __Pyx_XDECREF(__pyx_t_3);
32045  __Pyx_XDECREF(__pyx_t_4);
32046  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
32047  __pyx_r = -1;
32048  __Pyx_XDECREF(__pyx_v_error);
32049  __Pyx_RefNannyFinishContext();
32050  #ifdef WITH_THREAD
32051  __Pyx_PyGILState_Release(__pyx_gilstate_save);
32052  #endif
32053  return __pyx_r;
32054 }
32055 
32056 /* "View.MemoryView":1261
32057  *
32058  * @cname('__pyx_memoryview_err')
32059  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
32060  * if msg != NULL:
32061  * raise error(msg.decode('ascii'))
32062  */
32063 
32064 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
32065  int __pyx_r;
32066  __Pyx_RefNannyDeclarations
32067  int __pyx_t_1;
32068  PyObject *__pyx_t_2 = NULL;
32069  PyObject *__pyx_t_3 = NULL;
32070  PyObject *__pyx_t_4 = NULL;
32071  PyObject *__pyx_t_5 = NULL;
32072  int __pyx_lineno = 0;
32073  const char *__pyx_filename = NULL;
32074  int __pyx_clineno = 0;
32075  #ifdef WITH_THREAD
32076  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
32077  #endif
32078  __Pyx_RefNannySetupContext("_err", 0);
32079  __Pyx_INCREF(__pyx_v_error);
32080 
32081  /* "View.MemoryView":1262
32082  * @cname('__pyx_memoryview_err')
32083  * cdef int _err(object error, char *msg) except -1 with gil:
32084  * if msg != NULL: # <<<<<<<<<<<<<<
32085  * raise error(msg.decode('ascii'))
32086  * else:
32087  */
32088  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
32089  if (unlikely(__pyx_t_1)) {
32090 
32091  /* "View.MemoryView":1263
32092  * cdef int _err(object error, char *msg) except -1 with gil:
32093  * if msg != NULL:
32094  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
32095  * else:
32096  * raise error
32097  */
32098  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
32099  __Pyx_GOTREF(__pyx_t_3);
32100  __Pyx_INCREF(__pyx_v_error);
32101  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
32102  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
32103  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
32104  if (likely(__pyx_t_5)) {
32105  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
32106  __Pyx_INCREF(__pyx_t_5);
32107  __Pyx_INCREF(function);
32108  __Pyx_DECREF_SET(__pyx_t_4, function);
32109  }
32110  }
32111  __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);
32112  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
32113  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32114  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
32115  __Pyx_GOTREF(__pyx_t_2);
32116  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32117  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
32118  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32119  __PYX_ERR(1, 1263, __pyx_L1_error)
32120 
32121  /* "View.MemoryView":1262
32122  * @cname('__pyx_memoryview_err')
32123  * cdef int _err(object error, char *msg) except -1 with gil:
32124  * if msg != NULL: # <<<<<<<<<<<<<<
32125  * raise error(msg.decode('ascii'))
32126  * else:
32127  */
32128  }
32129 
32130  /* "View.MemoryView":1265
32131  * raise error(msg.decode('ascii'))
32132  * else:
32133  * raise error # <<<<<<<<<<<<<<
32134  *
32135  * @cname('__pyx_memoryview_copy_contents')
32136  */
32137  /*else*/ {
32138  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
32139  __PYX_ERR(1, 1265, __pyx_L1_error)
32140  }
32141 
32142  /* "View.MemoryView":1261
32143  *
32144  * @cname('__pyx_memoryview_err')
32145  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
32146  * if msg != NULL:
32147  * raise error(msg.decode('ascii'))
32148  */
32149 
32150  /* function exit code */
32151  __pyx_L1_error:;
32152  __Pyx_XDECREF(__pyx_t_2);
32153  __Pyx_XDECREF(__pyx_t_3);
32154  __Pyx_XDECREF(__pyx_t_4);
32155  __Pyx_XDECREF(__pyx_t_5);
32156  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
32157  __pyx_r = -1;
32158  __Pyx_XDECREF(__pyx_v_error);
32159  __Pyx_RefNannyFinishContext();
32160  #ifdef WITH_THREAD
32161  __Pyx_PyGILState_Release(__pyx_gilstate_save);
32162  #endif
32163  return __pyx_r;
32164 }
32165 
32166 /* "View.MemoryView":1268
32167  *
32168  * @cname('__pyx_memoryview_copy_contents')
32169  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
32170  * __Pyx_memviewslice dst,
32171  * int src_ndim, int dst_ndim,
32172  */
32173 
32174 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
32175  void *__pyx_v_tmpdata;
32176  size_t __pyx_v_itemsize;
32177  int __pyx_v_i;
32178  char __pyx_v_order;
32179  int __pyx_v_broadcasting;
32180  int __pyx_v_direct_copy;
32181  __Pyx_memviewslice __pyx_v_tmp;
32182  int __pyx_v_ndim;
32183  int __pyx_r;
32184  Py_ssize_t __pyx_t_1;
32185  int __pyx_t_2;
32186  int __pyx_t_3;
32187  int __pyx_t_4;
32188  int __pyx_t_5;
32189  int __pyx_t_6;
32190  void *__pyx_t_7;
32191  int __pyx_t_8;
32192  int __pyx_lineno = 0;
32193  const char *__pyx_filename = NULL;
32194  int __pyx_clineno = 0;
32195 
32196  /* "View.MemoryView":1276
32197  * Check for overlapping memory and verify the shapes.
32198  * """
32199  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
32200  * cdef size_t itemsize = src.memview.view.itemsize
32201  * cdef int i
32202  */
32203  __pyx_v_tmpdata = NULL;
32204 
32205  /* "View.MemoryView":1277
32206  * """
32207  * cdef void *tmpdata = NULL
32208  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
32209  * cdef int i
32210  * cdef char order = get_best_order(&src, src_ndim)
32211  */
32212  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
32213  __pyx_v_itemsize = __pyx_t_1;
32214 
32215  /* "View.MemoryView":1279
32216  * cdef size_t itemsize = src.memview.view.itemsize
32217  * cdef int i
32218  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
32219  * cdef bint broadcasting = False
32220  * cdef bint direct_copy = False
32221  */
32222  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
32223 
32224  /* "View.MemoryView":1280
32225  * cdef int i
32226  * cdef char order = get_best_order(&src, src_ndim)
32227  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
32228  * cdef bint direct_copy = False
32229  * cdef __Pyx_memviewslice tmp
32230  */
32231  __pyx_v_broadcasting = 0;
32232 
32233  /* "View.MemoryView":1281
32234  * cdef char order = get_best_order(&src, src_ndim)
32235  * cdef bint broadcasting = False
32236  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
32237  * cdef __Pyx_memviewslice tmp
32238  *
32239  */
32240  __pyx_v_direct_copy = 0;
32241 
32242  /* "View.MemoryView":1284
32243  * cdef __Pyx_memviewslice tmp
32244  *
32245  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
32246  * broadcast_leading(&src, src_ndim, dst_ndim)
32247  * elif dst_ndim < src_ndim:
32248  */
32249  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
32250  if (__pyx_t_2) {
32251 
32252  /* "View.MemoryView":1285
32253  *
32254  * if src_ndim < dst_ndim:
32255  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
32256  * elif dst_ndim < src_ndim:
32257  * broadcast_leading(&dst, dst_ndim, src_ndim)
32258  */
32259  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
32260 
32261  /* "View.MemoryView":1284
32262  * cdef __Pyx_memviewslice tmp
32263  *
32264  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
32265  * broadcast_leading(&src, src_ndim, dst_ndim)
32266  * elif dst_ndim < src_ndim:
32267  */
32268  goto __pyx_L3;
32269  }
32270 
32271  /* "View.MemoryView":1286
32272  * if src_ndim < dst_ndim:
32273  * broadcast_leading(&src, src_ndim, dst_ndim)
32274  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
32275  * broadcast_leading(&dst, dst_ndim, src_ndim)
32276  *
32277  */
32278  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
32279  if (__pyx_t_2) {
32280 
32281  /* "View.MemoryView":1287
32282  * broadcast_leading(&src, src_ndim, dst_ndim)
32283  * elif dst_ndim < src_ndim:
32284  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
32285  *
32286  * cdef int ndim = max(src_ndim, dst_ndim)
32287  */
32288  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
32289 
32290  /* "View.MemoryView":1286
32291  * if src_ndim < dst_ndim:
32292  * broadcast_leading(&src, src_ndim, dst_ndim)
32293  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
32294  * broadcast_leading(&dst, dst_ndim, src_ndim)
32295  *
32296  */
32297  }
32298  __pyx_L3:;
32299 
32300  /* "View.MemoryView":1289
32301  * broadcast_leading(&dst, dst_ndim, src_ndim)
32302  *
32303  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
32304  *
32305  * for i in range(ndim):
32306  */
32307  __pyx_t_3 = __pyx_v_dst_ndim;
32308  __pyx_t_4 = __pyx_v_src_ndim;
32309  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
32310  __pyx_t_5 = __pyx_t_3;
32311  } else {
32312  __pyx_t_5 = __pyx_t_4;
32313  }
32314  __pyx_v_ndim = __pyx_t_5;
32315 
32316  /* "View.MemoryView":1291
32317  * cdef int ndim = max(src_ndim, dst_ndim)
32318  *
32319  * for i in range(ndim): # <<<<<<<<<<<<<<
32320  * if src.shape[i] != dst.shape[i]:
32321  * if src.shape[i] == 1:
32322  */
32323  __pyx_t_5 = __pyx_v_ndim;
32324  __pyx_t_3 = __pyx_t_5;
32325  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
32326  __pyx_v_i = __pyx_t_4;
32327 
32328  /* "View.MemoryView":1292
32329  *
32330  * for i in range(ndim):
32331  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
32332  * if src.shape[i] == 1:
32333  * broadcasting = True
32334  */
32335  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
32336  if (__pyx_t_2) {
32337 
32338  /* "View.MemoryView":1293
32339  * for i in range(ndim):
32340  * if src.shape[i] != dst.shape[i]:
32341  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
32342  * broadcasting = True
32343  * src.strides[i] = 0
32344  */
32345  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
32346  if (__pyx_t_2) {
32347 
32348  /* "View.MemoryView":1294
32349  * if src.shape[i] != dst.shape[i]:
32350  * if src.shape[i] == 1:
32351  * broadcasting = True # <<<<<<<<<<<<<<
32352  * src.strides[i] = 0
32353  * else:
32354  */
32355  __pyx_v_broadcasting = 1;
32356 
32357  /* "View.MemoryView":1295
32358  * if src.shape[i] == 1:
32359  * broadcasting = True
32360  * src.strides[i] = 0 # <<<<<<<<<<<<<<
32361  * else:
32362  * _err_extents(i, dst.shape[i], src.shape[i])
32363  */
32364  (__pyx_v_src.strides[__pyx_v_i]) = 0;
32365 
32366  /* "View.MemoryView":1293
32367  * for i in range(ndim):
32368  * if src.shape[i] != dst.shape[i]:
32369  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
32370  * broadcasting = True
32371  * src.strides[i] = 0
32372  */
32373  goto __pyx_L7;
32374  }
32375 
32376  /* "View.MemoryView":1297
32377  * src.strides[i] = 0
32378  * else:
32379  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
32380  *
32381  * if src.suboffsets[i] >= 0:
32382  */
32383  /*else*/ {
32384  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
32385  }
32386  __pyx_L7:;
32387 
32388  /* "View.MemoryView":1292
32389  *
32390  * for i in range(ndim):
32391  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
32392  * if src.shape[i] == 1:
32393  * broadcasting = True
32394  */
32395  }
32396 
32397  /* "View.MemoryView":1299
32398  * _err_extents(i, dst.shape[i], src.shape[i])
32399  *
32400  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
32401  * _err_dim(ValueError, "Dimension %d is not direct", i)
32402  *
32403  */
32404  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
32405  if (__pyx_t_2) {
32406 
32407  /* "View.MemoryView":1300
32408  *
32409  * if src.suboffsets[i] >= 0:
32410  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
32411  *
32412  * if slices_overlap(&src, &dst, ndim, itemsize):
32413  */
32414  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
32415 
32416  /* "View.MemoryView":1299
32417  * _err_extents(i, dst.shape[i], src.shape[i])
32418  *
32419  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
32420  * _err_dim(ValueError, "Dimension %d is not direct", i)
32421  *
32422  */
32423  }
32424  }
32425 
32426  /* "View.MemoryView":1302
32427  * _err_dim(ValueError, "Dimension %d is not direct", i)
32428  *
32429  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
32430  *
32431  * if not slice_is_contig(src, order, ndim):
32432  */
32433  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
32434  if (__pyx_t_2) {
32435 
32436  /* "View.MemoryView":1304
32437  * if slices_overlap(&src, &dst, ndim, itemsize):
32438  *
32439  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
32440  * order = get_best_order(&dst, ndim)
32441  *
32442  */
32443  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
32444  if (__pyx_t_2) {
32445 
32446  /* "View.MemoryView":1305
32447  *
32448  * if not slice_is_contig(src, order, ndim):
32449  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
32450  *
32451  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
32452  */
32453  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
32454 
32455  /* "View.MemoryView":1304
32456  * if slices_overlap(&src, &dst, ndim, itemsize):
32457  *
32458  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
32459  * order = get_best_order(&dst, ndim)
32460  *
32461  */
32462  }
32463 
32464  /* "View.MemoryView":1307
32465  * order = get_best_order(&dst, ndim)
32466  *
32467  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
32468  * src = tmp
32469  *
32470  */
32471  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
32472  __pyx_v_tmpdata = __pyx_t_7;
32473 
32474  /* "View.MemoryView":1308
32475  *
32476  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
32477  * src = tmp # <<<<<<<<<<<<<<
32478  *
32479  * if not broadcasting:
32480  */
32481  __pyx_v_src = __pyx_v_tmp;
32482 
32483  /* "View.MemoryView":1302
32484  * _err_dim(ValueError, "Dimension %d is not direct", i)
32485  *
32486  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
32487  *
32488  * if not slice_is_contig(src, order, ndim):
32489  */
32490  }
32491 
32492  /* "View.MemoryView":1310
32493  * src = tmp
32494  *
32495  * if not broadcasting: # <<<<<<<<<<<<<<
32496  *
32497  *
32498  */
32499  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
32500  if (__pyx_t_2) {
32501 
32502  /* "View.MemoryView":1313
32503  *
32504  *
32505  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
32506  * direct_copy = slice_is_contig(dst, 'C', ndim)
32507  * elif slice_is_contig(src, 'F', ndim):
32508  */
32509  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
32510  if (__pyx_t_2) {
32511 
32512  /* "View.MemoryView":1314
32513  *
32514  * if slice_is_contig(src, 'C', ndim):
32515  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
32516  * elif slice_is_contig(src, 'F', ndim):
32517  * direct_copy = slice_is_contig(dst, 'F', ndim)
32518  */
32519  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
32520 
32521  /* "View.MemoryView":1313
32522  *
32523  *
32524  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
32525  * direct_copy = slice_is_contig(dst, 'C', ndim)
32526  * elif slice_is_contig(src, 'F', ndim):
32527  */
32528  goto __pyx_L12;
32529  }
32530 
32531  /* "View.MemoryView":1315
32532  * if slice_is_contig(src, 'C', ndim):
32533  * direct_copy = slice_is_contig(dst, 'C', ndim)
32534  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
32535  * direct_copy = slice_is_contig(dst, 'F', ndim)
32536  *
32537  */
32538  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
32539  if (__pyx_t_2) {
32540 
32541  /* "View.MemoryView":1316
32542  * direct_copy = slice_is_contig(dst, 'C', ndim)
32543  * elif slice_is_contig(src, 'F', ndim):
32544  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
32545  *
32546  * if direct_copy:
32547  */
32548  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
32549 
32550  /* "View.MemoryView":1315
32551  * if slice_is_contig(src, 'C', ndim):
32552  * direct_copy = slice_is_contig(dst, 'C', ndim)
32553  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
32554  * direct_copy = slice_is_contig(dst, 'F', ndim)
32555  *
32556  */
32557  }
32558  __pyx_L12:;
32559 
32560  /* "View.MemoryView":1318
32561  * direct_copy = slice_is_contig(dst, 'F', ndim)
32562  *
32563  * if direct_copy: # <<<<<<<<<<<<<<
32564  *
32565  * refcount_copying(&dst, dtype_is_object, ndim, False)
32566  */
32567  __pyx_t_2 = (__pyx_v_direct_copy != 0);
32568  if (__pyx_t_2) {
32569 
32570  /* "View.MemoryView":1320
32571  * if direct_copy:
32572  *
32573  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
32574  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
32575  * refcount_copying(&dst, dtype_is_object, ndim, True)
32576  */
32577  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
32578 
32579  /* "View.MemoryView":1321
32580  *
32581  * refcount_copying(&dst, dtype_is_object, ndim, False)
32582  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
32583  * refcount_copying(&dst, dtype_is_object, ndim, True)
32584  * free(tmpdata)
32585  */
32586  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
32587 
32588  /* "View.MemoryView":1322
32589  * refcount_copying(&dst, dtype_is_object, ndim, False)
32590  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
32591  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
32592  * free(tmpdata)
32593  * return 0
32594  */
32595  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
32596 
32597  /* "View.MemoryView":1323
32598  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
32599  * refcount_copying(&dst, dtype_is_object, ndim, True)
32600  * free(tmpdata) # <<<<<<<<<<<<<<
32601  * return 0
32602  *
32603  */
32604  free(__pyx_v_tmpdata);
32605 
32606  /* "View.MemoryView":1324
32607  * refcount_copying(&dst, dtype_is_object, ndim, True)
32608  * free(tmpdata)
32609  * return 0 # <<<<<<<<<<<<<<
32610  *
32611  * if order == 'F' == get_best_order(&dst, ndim):
32612  */
32613  __pyx_r = 0;
32614  goto __pyx_L0;
32615 
32616  /* "View.MemoryView":1318
32617  * direct_copy = slice_is_contig(dst, 'F', ndim)
32618  *
32619  * if direct_copy: # <<<<<<<<<<<<<<
32620  *
32621  * refcount_copying(&dst, dtype_is_object, ndim, False)
32622  */
32623  }
32624 
32625  /* "View.MemoryView":1310
32626  * src = tmp
32627  *
32628  * if not broadcasting: # <<<<<<<<<<<<<<
32629  *
32630  *
32631  */
32632  }
32633 
32634  /* "View.MemoryView":1326
32635  * return 0
32636  *
32637  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
32638  *
32639  *
32640  */
32641  __pyx_t_2 = (__pyx_v_order == 'F');
32642  if (__pyx_t_2) {
32643  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
32644  }
32645  __pyx_t_8 = (__pyx_t_2 != 0);
32646  if (__pyx_t_8) {
32647 
32648  /* "View.MemoryView":1329
32649  *
32650  *
32651  * transpose_memslice(&src) # <<<<<<<<<<<<<<
32652  * transpose_memslice(&dst)
32653  *
32654  */
32655  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
32656 
32657  /* "View.MemoryView":1330
32658  *
32659  * transpose_memslice(&src)
32660  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
32661  *
32662  * refcount_copying(&dst, dtype_is_object, ndim, False)
32663  */
32664  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
32665 
32666  /* "View.MemoryView":1326
32667  * return 0
32668  *
32669  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
32670  *
32671  *
32672  */
32673  }
32674 
32675  /* "View.MemoryView":1332
32676  * transpose_memslice(&dst)
32677  *
32678  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
32679  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
32680  * refcount_copying(&dst, dtype_is_object, ndim, True)
32681  */
32682  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
32683 
32684  /* "View.MemoryView":1333
32685  *
32686  * refcount_copying(&dst, dtype_is_object, ndim, False)
32687  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
32688  * refcount_copying(&dst, dtype_is_object, ndim, True)
32689  *
32690  */
32691  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
32692 
32693  /* "View.MemoryView":1334
32694  * refcount_copying(&dst, dtype_is_object, ndim, False)
32695  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
32696  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
32697  *
32698  * free(tmpdata)
32699  */
32700  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
32701 
32702  /* "View.MemoryView":1336
32703  * refcount_copying(&dst, dtype_is_object, ndim, True)
32704  *
32705  * free(tmpdata) # <<<<<<<<<<<<<<
32706  * return 0
32707  *
32708  */
32709  free(__pyx_v_tmpdata);
32710 
32711  /* "View.MemoryView":1337
32712  *
32713  * free(tmpdata)
32714  * return 0 # <<<<<<<<<<<<<<
32715  *
32716  * @cname('__pyx_memoryview_broadcast_leading')
32717  */
32718  __pyx_r = 0;
32719  goto __pyx_L0;
32720 
32721  /* "View.MemoryView":1268
32722  *
32723  * @cname('__pyx_memoryview_copy_contents')
32724  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
32725  * __Pyx_memviewslice dst,
32726  * int src_ndim, int dst_ndim,
32727  */
32728 
32729  /* function exit code */
32730  __pyx_L1_error:;
32731  {
32732  #ifdef WITH_THREAD
32733  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
32734  #endif
32735  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
32736  #ifdef WITH_THREAD
32737  __Pyx_PyGILState_Release(__pyx_gilstate_save);
32738  #endif
32739  }
32740  __pyx_r = -1;
32741  __pyx_L0:;
32742  return __pyx_r;
32743 }
32744 
32745 /* "View.MemoryView":1340
32746  *
32747  * @cname('__pyx_memoryview_broadcast_leading')
32748  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
32749  * int ndim,
32750  * int ndim_other) nogil:
32751  */
32752 
32753 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
32754  int __pyx_v_i;
32755  int __pyx_v_offset;
32756  int __pyx_t_1;
32757  int __pyx_t_2;
32758  int __pyx_t_3;
32759 
32760  /* "View.MemoryView":1344
32761  * int ndim_other) nogil:
32762  * cdef int i
32763  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
32764  *
32765  * for i in range(ndim - 1, -1, -1):
32766  */
32767  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
32768 
32769  /* "View.MemoryView":1346
32770  * cdef int offset = ndim_other - ndim
32771  *
32772  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
32773  * mslice.shape[i + offset] = mslice.shape[i]
32774  * mslice.strides[i + offset] = mslice.strides[i]
32775  */
32776  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
32777  __pyx_v_i = __pyx_t_1;
32778 
32779  /* "View.MemoryView":1347
32780  *
32781  * for i in range(ndim - 1, -1, -1):
32782  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
32783  * mslice.strides[i + offset] = mslice.strides[i]
32784  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
32785  */
32786  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
32787 
32788  /* "View.MemoryView":1348
32789  * for i in range(ndim - 1, -1, -1):
32790  * mslice.shape[i + offset] = mslice.shape[i]
32791  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
32792  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
32793  *
32794  */
32795  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
32796 
32797  /* "View.MemoryView":1349
32798  * mslice.shape[i + offset] = mslice.shape[i]
32799  * mslice.strides[i + offset] = mslice.strides[i]
32800  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
32801  *
32802  * for i in range(offset):
32803  */
32804  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
32805  }
32806 
32807  /* "View.MemoryView":1351
32808  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
32809  *
32810  * for i in range(offset): # <<<<<<<<<<<<<<
32811  * mslice.shape[i] = 1
32812  * mslice.strides[i] = mslice.strides[0]
32813  */
32814  __pyx_t_1 = __pyx_v_offset;
32815  __pyx_t_2 = __pyx_t_1;
32816  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
32817  __pyx_v_i = __pyx_t_3;
32818 
32819  /* "View.MemoryView":1352
32820  *
32821  * for i in range(offset):
32822  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
32823  * mslice.strides[i] = mslice.strides[0]
32824  * mslice.suboffsets[i] = -1
32825  */
32826  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
32827 
32828  /* "View.MemoryView":1353
32829  * for i in range(offset):
32830  * mslice.shape[i] = 1
32831  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
32832  * mslice.suboffsets[i] = -1
32833  *
32834  */
32835  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
32836 
32837  /* "View.MemoryView":1354
32838  * mslice.shape[i] = 1
32839  * mslice.strides[i] = mslice.strides[0]
32840  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
32841  *
32842  *
32843  */
32844  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
32845  }
32846 
32847  /* "View.MemoryView":1340
32848  *
32849  * @cname('__pyx_memoryview_broadcast_leading')
32850  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
32851  * int ndim,
32852  * int ndim_other) nogil:
32853  */
32854 
32855  /* function exit code */
32856 }
32857 
32858 /* "View.MemoryView":1362
32859  *
32860  * @cname('__pyx_memoryview_refcount_copying')
32861  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
32862  * int ndim, bint inc) nogil:
32863  *
32864  */
32865 
32866 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
32867  int __pyx_t_1;
32868 
32869  /* "View.MemoryView":1366
32870  *
32871  *
32872  * if dtype_is_object: # <<<<<<<<<<<<<<
32873  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
32874  * dst.strides, ndim, inc)
32875  */
32876  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
32877  if (__pyx_t_1) {
32878 
32879  /* "View.MemoryView":1367
32880  *
32881  * if dtype_is_object:
32882  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
32883  * dst.strides, ndim, inc)
32884  *
32885  */
32886  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
32887 
32888  /* "View.MemoryView":1366
32889  *
32890  *
32891  * if dtype_is_object: # <<<<<<<<<<<<<<
32892  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
32893  * dst.strides, ndim, inc)
32894  */
32895  }
32896 
32897  /* "View.MemoryView":1362
32898  *
32899  * @cname('__pyx_memoryview_refcount_copying')
32900  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
32901  * int ndim, bint inc) nogil:
32902  *
32903  */
32904 
32905  /* function exit code */
32906 }
32907 
32908 /* "View.MemoryView":1371
32909  *
32910  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
32911  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
32912  * Py_ssize_t *strides, int ndim,
32913  * bint inc) with gil:
32914  */
32915 
32916 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
32917  __Pyx_RefNannyDeclarations
32918  #ifdef WITH_THREAD
32919  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
32920  #endif
32921  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
32922 
32923  /* "View.MemoryView":1374
32924  * Py_ssize_t *strides, int ndim,
32925  * bint inc) with gil:
32926  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
32927  *
32928  * @cname('__pyx_memoryview_refcount_objects_in_slice')
32929  */
32930  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
32931 
32932  /* "View.MemoryView":1371
32933  *
32934  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
32935  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
32936  * Py_ssize_t *strides, int ndim,
32937  * bint inc) with gil:
32938  */
32939 
32940  /* function exit code */
32941  __Pyx_RefNannyFinishContext();
32942  #ifdef WITH_THREAD
32943  __Pyx_PyGILState_Release(__pyx_gilstate_save);
32944  #endif
32945 }
32946 
32947 /* "View.MemoryView":1377
32948  *
32949  * @cname('__pyx_memoryview_refcount_objects_in_slice')
32950  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
32951  * Py_ssize_t *strides, int ndim, bint inc):
32952  * cdef Py_ssize_t i
32953  */
32954 
32955 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
32956  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
32957  __Pyx_RefNannyDeclarations
32958  Py_ssize_t __pyx_t_1;
32959  Py_ssize_t __pyx_t_2;
32960  Py_ssize_t __pyx_t_3;
32961  int __pyx_t_4;
32962  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
32963 
32964  /* "View.MemoryView":1381
32965  * cdef Py_ssize_t i
32966  *
32967  * for i in range(shape[0]): # <<<<<<<<<<<<<<
32968  * if ndim == 1:
32969  * if inc:
32970  */
32971  __pyx_t_1 = (__pyx_v_shape[0]);
32972  __pyx_t_2 = __pyx_t_1;
32973  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
32974  __pyx_v_i = __pyx_t_3;
32975 
32976  /* "View.MemoryView":1382
32977  *
32978  * for i in range(shape[0]):
32979  * if ndim == 1: # <<<<<<<<<<<<<<
32980  * if inc:
32981  * Py_INCREF((<PyObject **> data)[0])
32982  */
32983  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
32984  if (__pyx_t_4) {
32985 
32986  /* "View.MemoryView":1383
32987  * for i in range(shape[0]):
32988  * if ndim == 1:
32989  * if inc: # <<<<<<<<<<<<<<
32990  * Py_INCREF((<PyObject **> data)[0])
32991  * else:
32992  */
32993  __pyx_t_4 = (__pyx_v_inc != 0);
32994  if (__pyx_t_4) {
32995 
32996  /* "View.MemoryView":1384
32997  * if ndim == 1:
32998  * if inc:
32999  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
33000  * else:
33001  * Py_DECREF((<PyObject **> data)[0])
33002  */
33003  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
33004 
33005  /* "View.MemoryView":1383
33006  * for i in range(shape[0]):
33007  * if ndim == 1:
33008  * if inc: # <<<<<<<<<<<<<<
33009  * Py_INCREF((<PyObject **> data)[0])
33010  * else:
33011  */
33012  goto __pyx_L6;
33013  }
33014 
33015  /* "View.MemoryView":1386
33016  * Py_INCREF((<PyObject **> data)[0])
33017  * else:
33018  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
33019  * else:
33020  * refcount_objects_in_slice(data, shape + 1, strides + 1,
33021  */
33022  /*else*/ {
33023  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
33024  }
33025  __pyx_L6:;
33026 
33027  /* "View.MemoryView":1382
33028  *
33029  * for i in range(shape[0]):
33030  * if ndim == 1: # <<<<<<<<<<<<<<
33031  * if inc:
33032  * Py_INCREF((<PyObject **> data)[0])
33033  */
33034  goto __pyx_L5;
33035  }
33036 
33037  /* "View.MemoryView":1388
33038  * Py_DECREF((<PyObject **> data)[0])
33039  * else:
33040  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
33041  * ndim - 1, inc)
33042  *
33043  */
33044  /*else*/ {
33045 
33046  /* "View.MemoryView":1389
33047  * else:
33048  * refcount_objects_in_slice(data, shape + 1, strides + 1,
33049  * ndim - 1, inc) # <<<<<<<<<<<<<<
33050  *
33051  * data += strides[0]
33052  */
33053  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
33054  }
33055  __pyx_L5:;
33056 
33057  /* "View.MemoryView":1391
33058  * ndim - 1, inc)
33059  *
33060  * data += strides[0] # <<<<<<<<<<<<<<
33061  *
33062  *
33063  */
33064  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
33065  }
33066 
33067  /* "View.MemoryView":1377
33068  *
33069  * @cname('__pyx_memoryview_refcount_objects_in_slice')
33070  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
33071  * Py_ssize_t *strides, int ndim, bint inc):
33072  * cdef Py_ssize_t i
33073  */
33074 
33075  /* function exit code */
33076  __Pyx_RefNannyFinishContext();
33077 }
33078 
33079 /* "View.MemoryView":1397
33080  *
33081  * @cname('__pyx_memoryview_slice_assign_scalar')
33082  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
33083  * size_t itemsize, void *item,
33084  * bint dtype_is_object) nogil:
33085  */
33086 
33087 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
33088 
33089  /* "View.MemoryView":1400
33090  * size_t itemsize, void *item,
33091  * bint dtype_is_object) nogil:
33092  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
33093  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
33094  * itemsize, item)
33095  */
33096  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
33097 
33098  /* "View.MemoryView":1401
33099  * bint dtype_is_object) nogil:
33100  * refcount_copying(dst, dtype_is_object, ndim, False)
33101  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
33102  * itemsize, item)
33103  * refcount_copying(dst, dtype_is_object, ndim, True)
33104  */
33105  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
33106 
33107  /* "View.MemoryView":1403
33108  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
33109  * itemsize, item)
33110  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
33111  *
33112  *
33113  */
33114  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
33115 
33116  /* "View.MemoryView":1397
33117  *
33118  * @cname('__pyx_memoryview_slice_assign_scalar')
33119  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
33120  * size_t itemsize, void *item,
33121  * bint dtype_is_object) nogil:
33122  */
33123 
33124  /* function exit code */
33125 }
33126 
33127 /* "View.MemoryView":1407
33128  *
33129  * @cname('__pyx_memoryview__slice_assign_scalar')
33130  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
33131  * Py_ssize_t *strides, int ndim,
33132  * size_t itemsize, void *item) nogil:
33133  */
33134 
33135 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
33136  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
33137  Py_ssize_t __pyx_v_stride;
33138  Py_ssize_t __pyx_v_extent;
33139  int __pyx_t_1;
33140  Py_ssize_t __pyx_t_2;
33141  Py_ssize_t __pyx_t_3;
33142  Py_ssize_t __pyx_t_4;
33143 
33144  /* "View.MemoryView":1411
33145  * size_t itemsize, void *item) nogil:
33146  * cdef Py_ssize_t i
33147  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
33148  * cdef Py_ssize_t extent = shape[0]
33149  *
33150  */
33151  __pyx_v_stride = (__pyx_v_strides[0]);
33152 
33153  /* "View.MemoryView":1412
33154  * cdef Py_ssize_t i
33155  * cdef Py_ssize_t stride = strides[0]
33156  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
33157  *
33158  * if ndim == 1:
33159  */
33160  __pyx_v_extent = (__pyx_v_shape[0]);
33161 
33162  /* "View.MemoryView":1414
33163  * cdef Py_ssize_t extent = shape[0]
33164  *
33165  * if ndim == 1: # <<<<<<<<<<<<<<
33166  * for i in range(extent):
33167  * memcpy(data, item, itemsize)
33168  */
33169  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
33170  if (__pyx_t_1) {
33171 
33172  /* "View.MemoryView":1415
33173  *
33174  * if ndim == 1:
33175  * for i in range(extent): # <<<<<<<<<<<<<<
33176  * memcpy(data, item, itemsize)
33177  * data += stride
33178  */
33179  __pyx_t_2 = __pyx_v_extent;
33180  __pyx_t_3 = __pyx_t_2;
33181  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
33182  __pyx_v_i = __pyx_t_4;
33183 
33184  /* "View.MemoryView":1416
33185  * if ndim == 1:
33186  * for i in range(extent):
33187  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
33188  * data += stride
33189  * else:
33190  */
33191  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
33192 
33193  /* "View.MemoryView":1417
33194  * for i in range(extent):
33195  * memcpy(data, item, itemsize)
33196  * data += stride # <<<<<<<<<<<<<<
33197  * else:
33198  * for i in range(extent):
33199  */
33200  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
33201  }
33202 
33203  /* "View.MemoryView":1414
33204  * cdef Py_ssize_t extent = shape[0]
33205  *
33206  * if ndim == 1: # <<<<<<<<<<<<<<
33207  * for i in range(extent):
33208  * memcpy(data, item, itemsize)
33209  */
33210  goto __pyx_L3;
33211  }
33212 
33213  /* "View.MemoryView":1419
33214  * data += stride
33215  * else:
33216  * for i in range(extent): # <<<<<<<<<<<<<<
33217  * _slice_assign_scalar(data, shape + 1, strides + 1,
33218  * ndim - 1, itemsize, item)
33219  */
33220  /*else*/ {
33221  __pyx_t_2 = __pyx_v_extent;
33222  __pyx_t_3 = __pyx_t_2;
33223  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
33224  __pyx_v_i = __pyx_t_4;
33225 
33226  /* "View.MemoryView":1420
33227  * else:
33228  * for i in range(extent):
33229  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
33230  * ndim - 1, itemsize, item)
33231  * data += stride
33232  */
33233  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
33234 
33235  /* "View.MemoryView":1422
33236  * _slice_assign_scalar(data, shape + 1, strides + 1,
33237  * ndim - 1, itemsize, item)
33238  * data += stride # <<<<<<<<<<<<<<
33239  *
33240  *
33241  */
33242  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
33243  }
33244  }
33245  __pyx_L3:;
33246 
33247  /* "View.MemoryView":1407
33248  *
33249  * @cname('__pyx_memoryview__slice_assign_scalar')
33250  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
33251  * Py_ssize_t *strides, int ndim,
33252  * size_t itemsize, void *item) nogil:
33253  */
33254 
33255  /* function exit code */
33256 }
33257 
33258 /* "(tree fragment)":1
33259  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
33260  * cdef object __pyx_PickleError
33261  * cdef object __pyx_result
33262  */
33263 
33264 /* Python wrapper */
33265 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
33266 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
33267 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
33268  PyObject *__pyx_v___pyx_type = 0;
33269  long __pyx_v___pyx_checksum;
33270  PyObject *__pyx_v___pyx_state = 0;
33271  int __pyx_lineno = 0;
33272  const char *__pyx_filename = NULL;
33273  int __pyx_clineno = 0;
33274  PyObject *__pyx_r = 0;
33275  __Pyx_RefNannyDeclarations
33276  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
33277  {
33278  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
33279  PyObject* values[3] = {0,0,0};
33280  if (unlikely(__pyx_kwds)) {
33281  Py_ssize_t kw_args;
33282  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
33283  switch (pos_args) {
33284  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
33285  CYTHON_FALLTHROUGH;
33286  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
33287  CYTHON_FALLTHROUGH;
33288  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
33289  CYTHON_FALLTHROUGH;
33290  case 0: break;
33291  default: goto __pyx_L5_argtuple_error;
33292  }
33293  kw_args = PyDict_Size(__pyx_kwds);
33294  switch (pos_args) {
33295  case 0:
33296  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
33297  else goto __pyx_L5_argtuple_error;
33298  CYTHON_FALLTHROUGH;
33299  case 1:
33300  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
33301  else {
33302  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
33303  }
33304  CYTHON_FALLTHROUGH;
33305  case 2:
33306  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
33307  else {
33308  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
33309  }
33310  }
33311  if (unlikely(kw_args > 0)) {
33312  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
33313  }
33314  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
33315  goto __pyx_L5_argtuple_error;
33316  } else {
33317  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
33318  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
33319  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
33320  }
33321  __pyx_v___pyx_type = values[0];
33322  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
33323  __pyx_v___pyx_state = values[2];
33324  }
33325  goto __pyx_L4_argument_unpacking_done;
33326  __pyx_L5_argtuple_error:;
33327  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
33328  __pyx_L3_error:;
33329  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
33330  __Pyx_RefNannyFinishContext();
33331  return NULL;
33332  __pyx_L4_argument_unpacking_done:;
33333  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
33334 
33335  /* function exit code */
33336  __Pyx_RefNannyFinishContext();
33337  return __pyx_r;
33338 }
33339 
33340 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) {
33341  PyObject *__pyx_v___pyx_PickleError = 0;
33342  PyObject *__pyx_v___pyx_result = 0;
33343  PyObject *__pyx_r = NULL;
33344  __Pyx_RefNannyDeclarations
33345  PyObject *__pyx_t_1 = NULL;
33346  int __pyx_t_2;
33347  int __pyx_t_3;
33348  PyObject *__pyx_t_4 = NULL;
33349  PyObject *__pyx_t_5 = NULL;
33350  PyObject *__pyx_t_6 = NULL;
33351  int __pyx_lineno = 0;
33352  const char *__pyx_filename = NULL;
33353  int __pyx_clineno = 0;
33354  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
33355 
33356  /* "(tree fragment)":4
33357  * cdef object __pyx_PickleError
33358  * cdef object __pyx_result
33359  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
33360  * from pickle import PickleError as __pyx_PickleError
33361  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
33362  */
33363  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
33364  __Pyx_GOTREF(__pyx_t_1);
33365  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__30, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
33366  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33367  __pyx_t_3 = (__pyx_t_2 != 0);
33368  if (__pyx_t_3) {
33369 
33370  /* "(tree fragment)":5
33371  * cdef object __pyx_result
33372  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
33373  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
33374  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
33375  * __pyx_result = Enum.__new__(__pyx_type)
33376  */
33377  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
33378  __Pyx_GOTREF(__pyx_t_1);
33379  __Pyx_INCREF(__pyx_n_s_PickleError);
33380  __Pyx_GIVEREF(__pyx_n_s_PickleError);
33381  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
33382  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
33383  __Pyx_GOTREF(__pyx_t_4);
33384  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33385  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
33386  __Pyx_GOTREF(__pyx_t_1);
33387  __Pyx_INCREF(__pyx_t_1);
33388  __pyx_v___pyx_PickleError = __pyx_t_1;
33389  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33390  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33391 
33392  /* "(tree fragment)":6
33393  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
33394  * from pickle import PickleError as __pyx_PickleError
33395  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
33396  * __pyx_result = Enum.__new__(__pyx_type)
33397  * if __pyx_state is not None:
33398  */
33399  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
33400  __Pyx_GOTREF(__pyx_t_1);
33401  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
33402  __Pyx_GOTREF(__pyx_t_5);
33403  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33404  __Pyx_INCREF(__pyx_v___pyx_PickleError);
33405  __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
33406  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
33407  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
33408  if (likely(__pyx_t_6)) {
33409  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
33410  __Pyx_INCREF(__pyx_t_6);
33411  __Pyx_INCREF(function);
33412  __Pyx_DECREF_SET(__pyx_t_1, function);
33413  }
33414  }
33415  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
33416  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
33417  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33418  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
33419  __Pyx_GOTREF(__pyx_t_4);
33420  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33421  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
33422  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33423  __PYX_ERR(1, 6, __pyx_L1_error)
33424 
33425  /* "(tree fragment)":4
33426  * cdef object __pyx_PickleError
33427  * cdef object __pyx_result
33428  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
33429  * from pickle import PickleError as __pyx_PickleError
33430  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
33431  */
33432  }
33433 
33434  /* "(tree fragment)":7
33435  * from pickle import PickleError as __pyx_PickleError
33436  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
33437  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
33438  * if __pyx_state is not None:
33439  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
33440  */
33441  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
33442  __Pyx_GOTREF(__pyx_t_1);
33443  __pyx_t_5 = NULL;
33444  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
33445  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
33446  if (likely(__pyx_t_5)) {
33447  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
33448  __Pyx_INCREF(__pyx_t_5);
33449  __Pyx_INCREF(function);
33450  __Pyx_DECREF_SET(__pyx_t_1, function);
33451  }
33452  }
33453  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
33454  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
33455  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
33456  __Pyx_GOTREF(__pyx_t_4);
33457  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33458  __pyx_v___pyx_result = __pyx_t_4;
33459  __pyx_t_4 = 0;
33460 
33461  /* "(tree fragment)":8
33462  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
33463  * __pyx_result = Enum.__new__(__pyx_type)
33464  * if __pyx_state is not None: # <<<<<<<<<<<<<<
33465  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
33466  * return __pyx_result
33467  */
33468  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
33469  __pyx_t_2 = (__pyx_t_3 != 0);
33470  if (__pyx_t_2) {
33471 
33472  /* "(tree fragment)":9
33473  * __pyx_result = Enum.__new__(__pyx_type)
33474  * if __pyx_state is not None:
33475  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
33476  * return __pyx_result
33477  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
33478  */
33479  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
33480  __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
33481  __Pyx_GOTREF(__pyx_t_4);
33482  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33483 
33484  /* "(tree fragment)":8
33485  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
33486  * __pyx_result = Enum.__new__(__pyx_type)
33487  * if __pyx_state is not None: # <<<<<<<<<<<<<<
33488  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
33489  * return __pyx_result
33490  */
33491  }
33492 
33493  /* "(tree fragment)":10
33494  * if __pyx_state is not None:
33495  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
33496  * return __pyx_result # <<<<<<<<<<<<<<
33497  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
33498  * __pyx_result.name = __pyx_state[0]
33499  */
33500  __Pyx_XDECREF(__pyx_r);
33501  __Pyx_INCREF(__pyx_v___pyx_result);
33502  __pyx_r = __pyx_v___pyx_result;
33503  goto __pyx_L0;
33504 
33505  /* "(tree fragment)":1
33506  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
33507  * cdef object __pyx_PickleError
33508  * cdef object __pyx_result
33509  */
33510 
33511  /* function exit code */
33512  __pyx_L1_error:;
33513  __Pyx_XDECREF(__pyx_t_1);
33514  __Pyx_XDECREF(__pyx_t_4);
33515  __Pyx_XDECREF(__pyx_t_5);
33516  __Pyx_XDECREF(__pyx_t_6);
33517  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
33518  __pyx_r = NULL;
33519  __pyx_L0:;
33520  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
33521  __Pyx_XDECREF(__pyx_v___pyx_result);
33522  __Pyx_XGIVEREF(__pyx_r);
33523  __Pyx_RefNannyFinishContext();
33524  return __pyx_r;
33525 }
33526 
33527 /* "(tree fragment)":11
33528  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
33529  * return __pyx_result
33530  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
33531  * __pyx_result.name = __pyx_state[0]
33532  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
33533  */
33534 
33535 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
33536  PyObject *__pyx_r = NULL;
33537  __Pyx_RefNannyDeclarations
33538  PyObject *__pyx_t_1 = NULL;
33539  int __pyx_t_2;
33540  Py_ssize_t __pyx_t_3;
33541  int __pyx_t_4;
33542  int __pyx_t_5;
33543  PyObject *__pyx_t_6 = NULL;
33544  PyObject *__pyx_t_7 = NULL;
33545  PyObject *__pyx_t_8 = NULL;
33546  int __pyx_lineno = 0;
33547  const char *__pyx_filename = NULL;
33548  int __pyx_clineno = 0;
33549  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
33550 
33551  /* "(tree fragment)":12
33552  * return __pyx_result
33553  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
33554  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
33555  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
33556  * __pyx_result.__dict__.update(__pyx_state[1])
33557  */
33558  if (unlikely(__pyx_v___pyx_state == Py_None)) {
33559  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
33560  __PYX_ERR(1, 12, __pyx_L1_error)
33561  }
33562  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
33563  __Pyx_GOTREF(__pyx_t_1);
33564  __Pyx_GIVEREF(__pyx_t_1);
33565  __Pyx_GOTREF(__pyx_v___pyx_result->name);
33566  __Pyx_DECREF(__pyx_v___pyx_result->name);
33567  __pyx_v___pyx_result->name = __pyx_t_1;
33568  __pyx_t_1 = 0;
33569 
33570  /* "(tree fragment)":13
33571  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
33572  * __pyx_result.name = __pyx_state[0]
33573  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
33574  * __pyx_result.__dict__.update(__pyx_state[1])
33575  */
33576  if (unlikely(__pyx_v___pyx_state == Py_None)) {
33577  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
33578  __PYX_ERR(1, 13, __pyx_L1_error)
33579  }
33580  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
33581  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
33582  if (__pyx_t_4) {
33583  } else {
33584  __pyx_t_2 = __pyx_t_4;
33585  goto __pyx_L4_bool_binop_done;
33586  }
33587  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
33588  __pyx_t_5 = (__pyx_t_4 != 0);
33589  __pyx_t_2 = __pyx_t_5;
33590  __pyx_L4_bool_binop_done:;
33591  if (__pyx_t_2) {
33592 
33593  /* "(tree fragment)":14
33594  * __pyx_result.name = __pyx_state[0]
33595  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
33596  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
33597  */
33598  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
33599  __Pyx_GOTREF(__pyx_t_6);
33600  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
33601  __Pyx_GOTREF(__pyx_t_7);
33602  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
33603  if (unlikely(__pyx_v___pyx_state == Py_None)) {
33604  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
33605  __PYX_ERR(1, 14, __pyx_L1_error)
33606  }
33607  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
33608  __Pyx_GOTREF(__pyx_t_6);
33609  __pyx_t_8 = NULL;
33610  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
33611  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
33612  if (likely(__pyx_t_8)) {
33613  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
33614  __Pyx_INCREF(__pyx_t_8);
33615  __Pyx_INCREF(function);
33616  __Pyx_DECREF_SET(__pyx_t_7, function);
33617  }
33618  }
33619  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
33620  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
33621  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
33622  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
33623  __Pyx_GOTREF(__pyx_t_1);
33624  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33625  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33626 
33627  /* "(tree fragment)":13
33628  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
33629  * __pyx_result.name = __pyx_state[0]
33630  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
33631  * __pyx_result.__dict__.update(__pyx_state[1])
33632  */
33633  }
33634 
33635  /* "(tree fragment)":11
33636  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
33637  * return __pyx_result
33638  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
33639  * __pyx_result.name = __pyx_state[0]
33640  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
33641  */
33642 
33643  /* function exit code */
33644  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
33645  goto __pyx_L0;
33646  __pyx_L1_error:;
33647  __Pyx_XDECREF(__pyx_t_1);
33648  __Pyx_XDECREF(__pyx_t_6);
33649  __Pyx_XDECREF(__pyx_t_7);
33650  __Pyx_XDECREF(__pyx_t_8);
33651  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
33652  __pyx_r = 0;
33653  __pyx_L0:;
33654  __Pyx_XGIVEREF(__pyx_r);
33655  __Pyx_RefNannyFinishContext();
33656  return __pyx_r;
33657 }
33658 
33659 /* "BufferFormatFromTypeInfo":1463
33660  *
33661  * @cname('__pyx_format_from_typeinfo')
33662  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
33663  * cdef __Pyx_StructField *field
33664  * cdef __pyx_typeinfo_string fmt
33665  */
33666 
33667 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
33668  __Pyx_StructField *__pyx_v_field;
33669  struct __pyx_typeinfo_string __pyx_v_fmt;
33670  PyObject *__pyx_v_part = 0;
33671  PyObject *__pyx_v_result = 0;
33672  PyObject *__pyx_v_alignment = NULL;
33673  PyObject *__pyx_v_parts = NULL;
33674  PyObject *__pyx_v_extents = NULL;
33675  int __pyx_v_i;
33676  PyObject *__pyx_r = NULL;
33677  __Pyx_RefNannyDeclarations
33678  int __pyx_t_1;
33679  PyObject *__pyx_t_2 = NULL;
33680  __Pyx_StructField *__pyx_t_3;
33681  PyObject *__pyx_t_4 = NULL;
33682  PyObject *__pyx_t_5 = NULL;
33683  int __pyx_t_6;
33684  int __pyx_t_7;
33685  int __pyx_t_8;
33686  int __pyx_t_9;
33687  int __pyx_lineno = 0;
33688  const char *__pyx_filename = NULL;
33689  int __pyx_clineno = 0;
33690  __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
33691 
33692  /* "BufferFormatFromTypeInfo":1468
33693  * cdef bytes part, result
33694  *
33695  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
33696  * assert type.fields != NULL
33697  * assert type.fields.type != NULL
33698  */
33699  __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0);
33700  if (__pyx_t_1) {
33701 
33702  /* "BufferFormatFromTypeInfo":1469
33703  *
33704  * if type.typegroup == 'S':
33705  * assert type.fields != NULL # <<<<<<<<<<<<<<
33706  * assert type.fields.type != NULL
33707  *
33708  */
33709  #ifndef CYTHON_WITHOUT_ASSERTIONS
33710  if (unlikely(!Py_OptimizeFlag)) {
33711  if (unlikely(!((__pyx_v_type->fields != NULL) != 0))) {
33712  PyErr_SetNone(PyExc_AssertionError);
33713  __PYX_ERR(1, 1469, __pyx_L1_error)
33714  }
33715  }
33716  #endif
33717 
33718  /* "BufferFormatFromTypeInfo":1470
33719  * if type.typegroup == 'S':
33720  * assert type.fields != NULL
33721  * assert type.fields.type != NULL # <<<<<<<<<<<<<<
33722  *
33723  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
33724  */
33725  #ifndef CYTHON_WITHOUT_ASSERTIONS
33726  if (unlikely(!Py_OptimizeFlag)) {
33727  if (unlikely(!((__pyx_v_type->fields->type != NULL) != 0))) {
33728  PyErr_SetNone(PyExc_AssertionError);
33729  __PYX_ERR(1, 1470, __pyx_L1_error)
33730  }
33731  }
33732  #endif
33733 
33734  /* "BufferFormatFromTypeInfo":1472
33735  * assert type.fields.type != NULL
33736  *
33737  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
33738  * alignment = b'^'
33739  * else:
33740  */
33741  __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
33742  if (__pyx_t_1) {
33743 
33744  /* "BufferFormatFromTypeInfo":1473
33745  *
33746  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
33747  * alignment = b'^' # <<<<<<<<<<<<<<
33748  * else:
33749  * alignment = b''
33750  */
33751  __Pyx_INCREF(__pyx_kp_b__31);
33752  __pyx_v_alignment = __pyx_kp_b__31;
33753 
33754  /* "BufferFormatFromTypeInfo":1472
33755  * assert type.fields.type != NULL
33756  *
33757  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
33758  * alignment = b'^'
33759  * else:
33760  */
33761  goto __pyx_L4;
33762  }
33763 
33764  /* "BufferFormatFromTypeInfo":1475
33765  * alignment = b'^'
33766  * else:
33767  * alignment = b'' # <<<<<<<<<<<<<<
33768  *
33769  * parts = [b"T{"]
33770  */
33771  /*else*/ {
33772  __Pyx_INCREF(__pyx_kp_b__32);
33773  __pyx_v_alignment = __pyx_kp_b__32;
33774  }
33775  __pyx_L4:;
33776 
33777  /* "BufferFormatFromTypeInfo":1477
33778  * alignment = b''
33779  *
33780  * parts = [b"T{"] # <<<<<<<<<<<<<<
33781  * field = type.fields
33782  *
33783  */
33784  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1477, __pyx_L1_error)
33785  __Pyx_GOTREF(__pyx_t_2);
33786  __Pyx_INCREF(__pyx_kp_b_T);
33787  __Pyx_GIVEREF(__pyx_kp_b_T);
33788  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_T);
33789  __pyx_v_parts = ((PyObject*)__pyx_t_2);
33790  __pyx_t_2 = 0;
33791 
33792  /* "BufferFormatFromTypeInfo":1478
33793  *
33794  * parts = [b"T{"]
33795  * field = type.fields # <<<<<<<<<<<<<<
33796  *
33797  * while field.type:
33798  */
33799  __pyx_t_3 = __pyx_v_type->fields;
33800  __pyx_v_field = __pyx_t_3;
33801 
33802  /* "BufferFormatFromTypeInfo":1480
33803  * field = type.fields
33804  *
33805  * while field.type: # <<<<<<<<<<<<<<
33806  * part = format_from_typeinfo(field.type)
33807  * parts.append(part + b':' + field.name + b':')
33808  */
33809  while (1) {
33810  __pyx_t_1 = (__pyx_v_field->type != 0);
33811  if (!__pyx_t_1) break;
33812 
33813  /* "BufferFormatFromTypeInfo":1481
33814  *
33815  * while field.type:
33816  * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<<
33817  * parts.append(part + b':' + field.name + b':')
33818  * field += 1
33819  */
33820  __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1481, __pyx_L1_error)
33821  __Pyx_GOTREF(__pyx_t_2);
33822  __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
33823  __pyx_t_2 = 0;
33824 
33825  /* "BufferFormatFromTypeInfo":1482
33826  * while field.type:
33827  * part = format_from_typeinfo(field.type)
33828  * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<<
33829  * field += 1
33830  *
33831  */
33832  __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__33); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1482, __pyx_L1_error)
33833  __Pyx_GOTREF(__pyx_t_2);
33834  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1482, __pyx_L1_error)
33835  __Pyx_GOTREF(__pyx_t_4);
33836  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1482, __pyx_L1_error)
33837  __Pyx_GOTREF(__pyx_t_5);
33838  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33839  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33840  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__33); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1482, __pyx_L1_error)
33841  __Pyx_GOTREF(__pyx_t_4);
33842  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33843  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1482, __pyx_L1_error)
33844  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33845 
33846  /* "BufferFormatFromTypeInfo":1483
33847  * part = format_from_typeinfo(field.type)
33848  * parts.append(part + b':' + field.name + b':')
33849  * field += 1 # <<<<<<<<<<<<<<
33850  *
33851  * result = alignment.join(parts) + b'}'
33852  */
33853  __pyx_v_field = (__pyx_v_field + 1);
33854  }
33855 
33856  /* "BufferFormatFromTypeInfo":1485
33857  * field += 1
33858  *
33859  * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<<
33860  * else:
33861  * fmt = __Pyx_TypeInfoToFormat(type)
33862  */
33863  __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1485, __pyx_L1_error)
33864  __Pyx_GOTREF(__pyx_t_4);
33865  __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__34); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1485, __pyx_L1_error)
33866  __Pyx_GOTREF(__pyx_t_5);
33867  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33868  if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(1, 1485, __pyx_L1_error)
33869  __pyx_v_result = ((PyObject*)__pyx_t_5);
33870  __pyx_t_5 = 0;
33871 
33872  /* "BufferFormatFromTypeInfo":1468
33873  * cdef bytes part, result
33874  *
33875  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
33876  * assert type.fields != NULL
33877  * assert type.fields.type != NULL
33878  */
33879  goto __pyx_L3;
33880  }
33881 
33882  /* "BufferFormatFromTypeInfo":1487
33883  * result = alignment.join(parts) + b'}'
33884  * else:
33885  * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<<
33886  * if type.arraysize[0]:
33887  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
33888  */
33889  /*else*/ {
33890  __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
33891 
33892  /* "BufferFormatFromTypeInfo":1488
33893  * else:
33894  * fmt = __Pyx_TypeInfoToFormat(type)
33895  * if type.arraysize[0]: # <<<<<<<<<<<<<<
33896  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
33897  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
33898  */
33899  __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
33900  if (__pyx_t_1) {
33901 
33902  /* "BufferFormatFromTypeInfo":1489
33903  * fmt = __Pyx_TypeInfoToFormat(type)
33904  * if type.arraysize[0]:
33905  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] # <<<<<<<<<<<<<<
33906  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
33907  * else:
33908  */
33909  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1489, __pyx_L1_error)
33910  __Pyx_GOTREF(__pyx_t_5);
33911  __pyx_t_7 = __pyx_v_type->ndim;
33912  __pyx_t_8 = __pyx_t_7;
33913  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
33914  __pyx_v_i = __pyx_t_9;
33915  __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1489, __pyx_L1_error)
33916  __Pyx_GOTREF(__pyx_t_4);
33917  __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1489, __pyx_L1_error)
33918  __Pyx_GOTREF(__pyx_t_2);
33919  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33920  if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 1489, __pyx_L1_error)
33921  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33922  }
33923  __pyx_v_extents = ((PyObject*)__pyx_t_5);
33924  __pyx_t_5 = 0;
33925 
33926  /* "BufferFormatFromTypeInfo":1490
33927  * if type.arraysize[0]:
33928  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
33929  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string # <<<<<<<<<<<<<<
33930  * else:
33931  * result = fmt.string
33932  */
33933  __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__35, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1490, __pyx_L1_error)
33934  __Pyx_GOTREF(__pyx_t_5);
33935  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1490, __pyx_L1_error)
33936  __Pyx_GOTREF(__pyx_t_2);
33937  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33938  __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1490, __pyx_L1_error)
33939  __Pyx_GOTREF(__pyx_t_5);
33940  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33941  __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1490, __pyx_L1_error)
33942  __Pyx_GOTREF(__pyx_t_2);
33943  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1490, __pyx_L1_error)
33944  __Pyx_GOTREF(__pyx_t_4);
33945  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33946  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33947  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 1490, __pyx_L1_error)
33948  __pyx_v_result = ((PyObject*)__pyx_t_4);
33949  __pyx_t_4 = 0;
33950 
33951  /* "BufferFormatFromTypeInfo":1488
33952  * else:
33953  * fmt = __Pyx_TypeInfoToFormat(type)
33954  * if type.arraysize[0]: # <<<<<<<<<<<<<<
33955  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
33956  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
33957  */
33958  goto __pyx_L7;
33959  }
33960 
33961  /* "BufferFormatFromTypeInfo":1492
33962  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
33963  * else:
33964  * result = fmt.string # <<<<<<<<<<<<<<
33965  *
33966  * return result
33967  */
33968  /*else*/ {
33969  __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1492, __pyx_L1_error)
33970  __Pyx_GOTREF(__pyx_t_4);
33971  __pyx_v_result = ((PyObject*)__pyx_t_4);
33972  __pyx_t_4 = 0;
33973  }
33974  __pyx_L7:;
33975  }
33976  __pyx_L3:;
33977 
33978  /* "BufferFormatFromTypeInfo":1494
33979  * result = fmt.string
33980  *
33981  * return result # <<<<<<<<<<<<<<
33982  */
33983  __Pyx_XDECREF(__pyx_r);
33984  __Pyx_INCREF(__pyx_v_result);
33985  __pyx_r = __pyx_v_result;
33986  goto __pyx_L0;
33987 
33988  /* "BufferFormatFromTypeInfo":1463
33989  *
33990  * @cname('__pyx_format_from_typeinfo')
33991  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
33992  * cdef __Pyx_StructField *field
33993  * cdef __pyx_typeinfo_string fmt
33994  */
33995 
33996  /* function exit code */
33997  __pyx_L1_error:;
33998  __Pyx_XDECREF(__pyx_t_2);
33999  __Pyx_XDECREF(__pyx_t_4);
34000  __Pyx_XDECREF(__pyx_t_5);
34001  __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
34002  __pyx_r = 0;
34003  __pyx_L0:;
34004  __Pyx_XDECREF(__pyx_v_part);
34005  __Pyx_XDECREF(__pyx_v_result);
34006  __Pyx_XDECREF(__pyx_v_alignment);
34007  __Pyx_XDECREF(__pyx_v_parts);
34008  __Pyx_XDECREF(__pyx_v_extents);
34009  __Pyx_XGIVEREF(__pyx_r);
34010  __Pyx_RefNannyFinishContext();
34011  return __pyx_r;
34012 }
34013 static struct __pyx_vtabstruct_6mprans_16cMoveMeshMonitor_cCoefficients __pyx_vtable_6mprans_16cMoveMeshMonitor_cCoefficients;
34014 
34015 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor_cCoefficients(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34016  struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *p;
34017  PyObject *o;
34018  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
34019  o = (*t->tp_alloc)(t, 0);
34020  } else {
34021  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
34022  }
34023  if (unlikely(!o)) return 0;
34024  p = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)o);
34025  p->__pyx_vtab = __pyx_vtabptr_6mprans_16cMoveMeshMonitor_cCoefficients;
34026  p->pyCoefficients = Py_None; Py_INCREF(Py_None);
34027  if (unlikely(__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
34028  return o;
34029  bad:
34030  Py_DECREF(o); o = 0;
34031  return NULL;
34032 }
34033 
34034 static void __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor_cCoefficients(PyObject *o) {
34035  struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *p = (struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)o;
34036  #if CYTHON_USE_TP_FINALIZE
34037  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
34038  if (PyObject_CallFinalizerFromDealloc(o)) return;
34039  }
34040  #endif
34041  PyObject_GC_UnTrack(o);
34042  Py_CLEAR(p->pyCoefficients);
34043  (*Py_TYPE(o)->tp_free)(o);
34044 }
34045 
34046 static int __pyx_tp_traverse_6mprans_16cMoveMeshMonitor_cCoefficients(PyObject *o, visitproc v, void *a) {
34047  int e;
34048  struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *p = (struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)o;
34049  if (p->pyCoefficients) {
34050  e = (*v)(p->pyCoefficients, a); if (e) return e;
34051  }
34052  return 0;
34053 }
34054 
34055 static int __pyx_tp_clear_6mprans_16cMoveMeshMonitor_cCoefficients(PyObject *o) {
34056  PyObject* tmp;
34057  struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *p = (struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *)o;
34058  tmp = ((PyObject*)p->pyCoefficients);
34059  p->pyCoefficients = Py_None; Py_INCREF(Py_None);
34060  Py_XDECREF(tmp);
34061  return 0;
34062 }
34063 
34064 static PyObject *__pyx_getprop_6mprans_16cMoveMeshMonitor_13cCoefficients_pyCoefficients(PyObject *o, CYTHON_UNUSED void *x) {
34065  return __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_1__get__(o);
34066 }
34067 
34068 static int __pyx_setprop_6mprans_16cMoveMeshMonitor_13cCoefficients_pyCoefficients(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
34069  if (v) {
34070  return __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_3__set__(o, v);
34071  }
34072  else {
34073  return __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_14pyCoefficients_5__del__(o);
34074  }
34075 }
34076 
34077 static PyObject *__pyx_getprop_6mprans_16cMoveMeshMonitor_13cCoefficients_C(PyObject *o, CYTHON_UNUSED void *x) {
34078  return __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_1__get__(o);
34079 }
34080 
34081 static int __pyx_setprop_6mprans_16cMoveMeshMonitor_13cCoefficients_C(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
34082  if (v) {
34083  return __pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_1C_3__set__(o, v);
34084  }
34085  else {
34086  PyErr_SetString(PyExc_NotImplementedError, "__del__");
34087  return -1;
34088  }
34089 }
34090 
34091 static PyMethodDef __pyx_methods_6mprans_16cMoveMeshMonitor_cCoefficients[] = {
34092  {"attachPyCoefficients", (PyCFunction)__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_3attachPyCoefficients, METH_O, 0},
34093  {"preStep", (PyCFunction)__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_5preStep, METH_NOARGS, 0},
34094  {"postStep", (PyCFunction)__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_7postStep, METH_NOARGS, 0},
34095  {"pseudoTimeStepping", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_9pseudoTimeStepping, METH_VARARGS|METH_KEYWORDS, 0},
34096  {"__reduce_cython__", (PyCFunction)__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_11__reduce_cython__, METH_NOARGS, 0},
34097  {"__setstate_cython__", (PyCFunction)__pyx_pw_6mprans_16cMoveMeshMonitor_13cCoefficients_13__setstate_cython__, METH_O, 0},
34098  {0, 0, 0, 0}
34099 };
34100 
34101 static struct PyGetSetDef __pyx_getsets_6mprans_16cMoveMeshMonitor_cCoefficients[] = {
34102  {(char *)"pyCoefficients", __pyx_getprop_6mprans_16cMoveMeshMonitor_13cCoefficients_pyCoefficients, __pyx_setprop_6mprans_16cMoveMeshMonitor_13cCoefficients_pyCoefficients, (char *)0, 0},
34103  {(char *)"C", __pyx_getprop_6mprans_16cMoveMeshMonitor_13cCoefficients_C, __pyx_setprop_6mprans_16cMoveMeshMonitor_13cCoefficients_C, (char *)0, 0},
34104  {0, 0, 0, 0, 0}
34105 };
34106 
34107 static PyTypeObject __pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients = {
34108  PyVarObject_HEAD_INIT(0, 0)
34109  "mprans.cMoveMeshMonitor.cCoefficients", /*tp_name*/
34110  sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients), /*tp_basicsize*/
34111  0, /*tp_itemsize*/
34112  __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor_cCoefficients, /*tp_dealloc*/
34113  #if PY_VERSION_HEX < 0x030800b4
34114  0, /*tp_print*/
34115  #endif
34116  #if PY_VERSION_HEX >= 0x030800b4
34117  0, /*tp_vectorcall_offset*/
34118  #endif
34119  0, /*tp_getattr*/
34120  0, /*tp_setattr*/
34121  #if PY_MAJOR_VERSION < 3
34122  0, /*tp_compare*/
34123  #endif
34124  #if PY_MAJOR_VERSION >= 3
34125  0, /*tp_as_async*/
34126  #endif
34127  0, /*tp_repr*/
34128  0, /*tp_as_number*/
34129  0, /*tp_as_sequence*/
34130  0, /*tp_as_mapping*/
34131  0, /*tp_hash*/
34132  0, /*tp_call*/
34133  0, /*tp_str*/
34134  0, /*tp_getattro*/
34135  0, /*tp_setattro*/
34136  0, /*tp_as_buffer*/
34137  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34138  0, /*tp_doc*/
34139  __pyx_tp_traverse_6mprans_16cMoveMeshMonitor_cCoefficients, /*tp_traverse*/
34140  __pyx_tp_clear_6mprans_16cMoveMeshMonitor_cCoefficients, /*tp_clear*/
34141  0, /*tp_richcompare*/
34142  0, /*tp_weaklistoffset*/
34143  0, /*tp_iter*/
34144  0, /*tp_iternext*/
34145  __pyx_methods_6mprans_16cMoveMeshMonitor_cCoefficients, /*tp_methods*/
34146  0, /*tp_members*/
34147  __pyx_getsets_6mprans_16cMoveMeshMonitor_cCoefficients, /*tp_getset*/
34148  0, /*tp_base*/
34149  0, /*tp_dict*/
34150  0, /*tp_descr_get*/
34151  0, /*tp_descr_set*/
34152  0, /*tp_dictoffset*/
34153  0, /*tp_init*/
34154  0, /*tp_alloc*/
34155  __pyx_tp_new_6mprans_16cMoveMeshMonitor_cCoefficients, /*tp_new*/
34156  0, /*tp_free*/
34157  0, /*tp_is_gc*/
34158  0, /*tp_bases*/
34159  0, /*tp_mro*/
34160  0, /*tp_cache*/
34161  0, /*tp_subclasses*/
34162  0, /*tp_weaklist*/
34163  0, /*tp_del*/
34164  0, /*tp_version_tag*/
34165  #if PY_VERSION_HEX >= 0x030400a1
34166  0, /*tp_finalize*/
34167  #endif
34168  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34169  0, /*tp_vectorcall*/
34170  #endif
34171  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34172  0, /*tp_print*/
34173  #endif
34174  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34175  0, /*tp_pypy_flags*/
34176  #endif
34177 };
34178 
34179 static struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel[8];
34180 static int __pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel = 0;
34181 
34182 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34183  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *p;
34184  PyObject *o;
34185  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel)))) {
34186  o = (PyObject*)__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel[--__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel];
34187  memset(o, 0, sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel));
34188  (void) PyObject_INIT(o, t);
34189  } else {
34190  o = (*t->tp_alloc)(t, 0);
34191  if (unlikely(!o)) return 0;
34192  }
34193  p = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *)o);
34194  p->__pyx_v_coords_2doArray.data = NULL;
34195  p->__pyx_v_coords_2doArray.memview = NULL;
34196  p->__pyx_v_counts_in.data = NULL;
34197  p->__pyx_v_counts_in.memview = NULL;
34198  p->__pyx_v_displacements_in.data = NULL;
34199  p->__pyx_v_displacements_in.memview = NULL;
34200  return o;
34201 }
34202 
34203 static void __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel(PyObject *o) {
34204  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *p = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *)o;
34205  __PYX_XDEC_MEMVIEW(&p->__pyx_v_coords_2doArray, 1);
34206  __PYX_XDEC_MEMVIEW(&p->__pyx_v_counts_in, 1);
34207  __PYX_XDEC_MEMVIEW(&p->__pyx_v_displacements_in, 1);
34208  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel)))) {
34209  __pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel[__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel++] = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel *)o);
34210  } else {
34211  (*Py_TYPE(o)->tp_free)(o);
34212  }
34213 }
34214 
34215 static PyTypeObject __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel = {
34216  PyVarObject_HEAD_INIT(0, 0)
34217  "mprans.cMoveMeshMonitor.__pyx_scope_struct__cppPseudoTimeSteppingParallel", /*tp_name*/
34218  sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel), /*tp_basicsize*/
34219  0, /*tp_itemsize*/
34220  __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel, /*tp_dealloc*/
34221  #if PY_VERSION_HEX < 0x030800b4
34222  0, /*tp_print*/
34223  #endif
34224  #if PY_VERSION_HEX >= 0x030800b4
34225  0, /*tp_vectorcall_offset*/
34226  #endif
34227  0, /*tp_getattr*/
34228  0, /*tp_setattr*/
34229  #if PY_MAJOR_VERSION < 3
34230  0, /*tp_compare*/
34231  #endif
34232  #if PY_MAJOR_VERSION >= 3
34233  0, /*tp_as_async*/
34234  #endif
34235  0, /*tp_repr*/
34236  0, /*tp_as_number*/
34237  0, /*tp_as_sequence*/
34238  0, /*tp_as_mapping*/
34239  0, /*tp_hash*/
34240  0, /*tp_call*/
34241  0, /*tp_str*/
34242  0, /*tp_getattro*/
34243  0, /*tp_setattro*/
34244  0, /*tp_as_buffer*/
34245  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
34246  0, /*tp_doc*/
34247  0, /*tp_traverse*/
34248  0, /*tp_clear*/
34249  0, /*tp_richcompare*/
34250  0, /*tp_weaklistoffset*/
34251  0, /*tp_iter*/
34252  0, /*tp_iternext*/
34253  0, /*tp_methods*/
34254  0, /*tp_members*/
34255  0, /*tp_getset*/
34256  0, /*tp_base*/
34257  0, /*tp_dict*/
34258  0, /*tp_descr_get*/
34259  0, /*tp_descr_set*/
34260  0, /*tp_dictoffset*/
34261  0, /*tp_init*/
34262  0, /*tp_alloc*/
34263  __pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel, /*tp_new*/
34264  0, /*tp_free*/
34265  0, /*tp_is_gc*/
34266  0, /*tp_bases*/
34267  0, /*tp_mro*/
34268  0, /*tp_cache*/
34269  0, /*tp_subclasses*/
34270  0, /*tp_weaklist*/
34271  0, /*tp_del*/
34272  0, /*tp_version_tag*/
34273  #if PY_VERSION_HEX >= 0x030400a1
34274  0, /*tp_finalize*/
34275  #endif
34276  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34277  0, /*tp_vectorcall*/
34278  #endif
34279  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34280  0, /*tp_print*/
34281  #endif
34282  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34283  0, /*tp_pypy_flags*/
34284  #endif
34285 };
34286 
34287 static struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr[8];
34288 static int __pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr = 0;
34289 
34290 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34291  PyObject *o;
34292  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr)))) {
34293  o = (PyObject*)__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr[--__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr];
34294  memset(o, 0, sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr));
34295  (void) PyObject_INIT(o, t);
34296  PyObject_GC_Track(o);
34297  } else {
34298  o = (*t->tp_alloc)(t, 0);
34299  if (unlikely(!o)) return 0;
34300  }
34301  return o;
34302 }
34303 
34304 static void __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr(PyObject *o) {
34305  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *)o;
34306  PyObject_GC_UnTrack(o);
34307  Py_CLEAR(p->__pyx_outer_scope);
34308  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr)))) {
34309  __pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr[__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *)o);
34310  } else {
34311  (*Py_TYPE(o)->tp_free)(o);
34312  }
34313 }
34314 
34315 static int __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
34316  int e;
34317  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr *)o;
34318  if (p->__pyx_outer_scope) {
34319  e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
34320  }
34321  return 0;
34322 }
34323 
34324 static PyTypeObject __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr = {
34325  PyVarObject_HEAD_INIT(0, 0)
34326  "mprans.cMoveMeshMonitor.__pyx_scope_struct_1_genexpr", /*tp_name*/
34327  sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
34328  0, /*tp_itemsize*/
34329  __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
34330  #if PY_VERSION_HEX < 0x030800b4
34331  0, /*tp_print*/
34332  #endif
34333  #if PY_VERSION_HEX >= 0x030800b4
34334  0, /*tp_vectorcall_offset*/
34335  #endif
34336  0, /*tp_getattr*/
34337  0, /*tp_setattr*/
34338  #if PY_MAJOR_VERSION < 3
34339  0, /*tp_compare*/
34340  #endif
34341  #if PY_MAJOR_VERSION >= 3
34342  0, /*tp_as_async*/
34343  #endif
34344  0, /*tp_repr*/
34345  0, /*tp_as_number*/
34346  0, /*tp_as_sequence*/
34347  0, /*tp_as_mapping*/
34348  0, /*tp_hash*/
34349  0, /*tp_call*/
34350  0, /*tp_str*/
34351  0, /*tp_getattro*/
34352  0, /*tp_setattro*/
34353  0, /*tp_as_buffer*/
34354  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34355  0, /*tp_doc*/
34356  __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr, /*tp_traverse*/
34357  0, /*tp_clear*/
34358  0, /*tp_richcompare*/
34359  0, /*tp_weaklistoffset*/
34360  0, /*tp_iter*/
34361  0, /*tp_iternext*/
34362  0, /*tp_methods*/
34363  0, /*tp_members*/
34364  0, /*tp_getset*/
34365  0, /*tp_base*/
34366  0, /*tp_dict*/
34367  0, /*tp_descr_get*/
34368  0, /*tp_descr_set*/
34369  0, /*tp_dictoffset*/
34370  0, /*tp_init*/
34371  0, /*tp_alloc*/
34372  __pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr, /*tp_new*/
34373  0, /*tp_free*/
34374  0, /*tp_is_gc*/
34375  0, /*tp_bases*/
34376  0, /*tp_mro*/
34377  0, /*tp_cache*/
34378  0, /*tp_subclasses*/
34379  0, /*tp_weaklist*/
34380  0, /*tp_del*/
34381  0, /*tp_version_tag*/
34382  #if PY_VERSION_HEX >= 0x030400a1
34383  0, /*tp_finalize*/
34384  #endif
34385  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34386  0, /*tp_vectorcall*/
34387  #endif
34388  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34389  0, /*tp_print*/
34390  #endif
34391  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34392  0, /*tp_pypy_flags*/
34393  #endif
34394 };
34395 
34396 static struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr[8];
34397 static int __pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr = 0;
34398 
34399 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34400  PyObject *o;
34401  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr)))) {
34402  o = (PyObject*)__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr[--__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr];
34403  memset(o, 0, sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr));
34404  (void) PyObject_INIT(o, t);
34405  PyObject_GC_Track(o);
34406  } else {
34407  o = (*t->tp_alloc)(t, 0);
34408  if (unlikely(!o)) return 0;
34409  }
34410  return o;
34411 }
34412 
34413 static void __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr(PyObject *o) {
34414  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *)o;
34415  PyObject_GC_UnTrack(o);
34416  Py_CLEAR(p->__pyx_outer_scope);
34417  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr)))) {
34418  __pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr[__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *)o);
34419  } else {
34420  (*Py_TYPE(o)->tp_free)(o);
34421  }
34422 }
34423 
34424 static int __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
34425  int e;
34426  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr *)o;
34427  if (p->__pyx_outer_scope) {
34428  e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
34429  }
34430  return 0;
34431 }
34432 
34433 static PyTypeObject __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr = {
34434  PyVarObject_HEAD_INIT(0, 0)
34435  "mprans.cMoveMeshMonitor.__pyx_scope_struct_2_genexpr", /*tp_name*/
34436  sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
34437  0, /*tp_itemsize*/
34438  __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr, /*tp_dealloc*/
34439  #if PY_VERSION_HEX < 0x030800b4
34440  0, /*tp_print*/
34441  #endif
34442  #if PY_VERSION_HEX >= 0x030800b4
34443  0, /*tp_vectorcall_offset*/
34444  #endif
34445  0, /*tp_getattr*/
34446  0, /*tp_setattr*/
34447  #if PY_MAJOR_VERSION < 3
34448  0, /*tp_compare*/
34449  #endif
34450  #if PY_MAJOR_VERSION >= 3
34451  0, /*tp_as_async*/
34452  #endif
34453  0, /*tp_repr*/
34454  0, /*tp_as_number*/
34455  0, /*tp_as_sequence*/
34456  0, /*tp_as_mapping*/
34457  0, /*tp_hash*/
34458  0, /*tp_call*/
34459  0, /*tp_str*/
34460  0, /*tp_getattro*/
34461  0, /*tp_setattro*/
34462  0, /*tp_as_buffer*/
34463  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34464  0, /*tp_doc*/
34465  __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr, /*tp_traverse*/
34466  0, /*tp_clear*/
34467  0, /*tp_richcompare*/
34468  0, /*tp_weaklistoffset*/
34469  0, /*tp_iter*/
34470  0, /*tp_iternext*/
34471  0, /*tp_methods*/
34472  0, /*tp_members*/
34473  0, /*tp_getset*/
34474  0, /*tp_base*/
34475  0, /*tp_dict*/
34476  0, /*tp_descr_get*/
34477  0, /*tp_descr_set*/
34478  0, /*tp_dictoffset*/
34479  0, /*tp_init*/
34480  0, /*tp_alloc*/
34481  __pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr, /*tp_new*/
34482  0, /*tp_free*/
34483  0, /*tp_is_gc*/
34484  0, /*tp_bases*/
34485  0, /*tp_mro*/
34486  0, /*tp_cache*/
34487  0, /*tp_subclasses*/
34488  0, /*tp_weaklist*/
34489  0, /*tp_del*/
34490  0, /*tp_version_tag*/
34491  #if PY_VERSION_HEX >= 0x030400a1
34492  0, /*tp_finalize*/
34493  #endif
34494  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34495  0, /*tp_vectorcall*/
34496  #endif
34497  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34498  0, /*tp_print*/
34499  #endif
34500  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34501  0, /*tp_pypy_flags*/
34502  #endif
34503 };
34504 
34505 static struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr[8];
34506 static int __pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr = 0;
34507 
34508 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34509  PyObject *o;
34510  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr)))) {
34511  o = (PyObject*)__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr[--__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr];
34512  memset(o, 0, sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr));
34513  (void) PyObject_INIT(o, t);
34514  PyObject_GC_Track(o);
34515  } else {
34516  o = (*t->tp_alloc)(t, 0);
34517  if (unlikely(!o)) return 0;
34518  }
34519  return o;
34520 }
34521 
34522 static void __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr(PyObject *o) {
34523  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *)o;
34524  PyObject_GC_UnTrack(o);
34525  Py_CLEAR(p->__pyx_outer_scope);
34526  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr)))) {
34527  __pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr[__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *)o);
34528  } else {
34529  (*Py_TYPE(o)->tp_free)(o);
34530  }
34531 }
34532 
34533 static int __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
34534  int e;
34535  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr *)o;
34536  if (p->__pyx_outer_scope) {
34537  e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
34538  }
34539  return 0;
34540 }
34541 
34542 static PyTypeObject __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr = {
34543  PyVarObject_HEAD_INIT(0, 0)
34544  "mprans.cMoveMeshMonitor.__pyx_scope_struct_3_genexpr", /*tp_name*/
34545  sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
34546  0, /*tp_itemsize*/
34547  __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
34548  #if PY_VERSION_HEX < 0x030800b4
34549  0, /*tp_print*/
34550  #endif
34551  #if PY_VERSION_HEX >= 0x030800b4
34552  0, /*tp_vectorcall_offset*/
34553  #endif
34554  0, /*tp_getattr*/
34555  0, /*tp_setattr*/
34556  #if PY_MAJOR_VERSION < 3
34557  0, /*tp_compare*/
34558  #endif
34559  #if PY_MAJOR_VERSION >= 3
34560  0, /*tp_as_async*/
34561  #endif
34562  0, /*tp_repr*/
34563  0, /*tp_as_number*/
34564  0, /*tp_as_sequence*/
34565  0, /*tp_as_mapping*/
34566  0, /*tp_hash*/
34567  0, /*tp_call*/
34568  0, /*tp_str*/
34569  0, /*tp_getattro*/
34570  0, /*tp_setattro*/
34571  0, /*tp_as_buffer*/
34572  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34573  0, /*tp_doc*/
34574  __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr, /*tp_traverse*/
34575  0, /*tp_clear*/
34576  0, /*tp_richcompare*/
34577  0, /*tp_weaklistoffset*/
34578  0, /*tp_iter*/
34579  0, /*tp_iternext*/
34580  0, /*tp_methods*/
34581  0, /*tp_members*/
34582  0, /*tp_getset*/
34583  0, /*tp_base*/
34584  0, /*tp_dict*/
34585  0, /*tp_descr_get*/
34586  0, /*tp_descr_set*/
34587  0, /*tp_dictoffset*/
34588  0, /*tp_init*/
34589  0, /*tp_alloc*/
34590  __pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr, /*tp_new*/
34591  0, /*tp_free*/
34592  0, /*tp_is_gc*/
34593  0, /*tp_bases*/
34594  0, /*tp_mro*/
34595  0, /*tp_cache*/
34596  0, /*tp_subclasses*/
34597  0, /*tp_weaklist*/
34598  0, /*tp_del*/
34599  0, /*tp_version_tag*/
34600  #if PY_VERSION_HEX >= 0x030400a1
34601  0, /*tp_finalize*/
34602  #endif
34603  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34604  0, /*tp_vectorcall*/
34605  #endif
34606  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34607  0, /*tp_print*/
34608  #endif
34609  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34610  0, /*tp_pypy_flags*/
34611  #endif
34612 };
34613 
34614 static struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr[8];
34615 static int __pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr = 0;
34616 
34617 static PyObject *__pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34618  PyObject *o;
34619  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr)))) {
34620  o = (PyObject*)__pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr[--__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr];
34621  memset(o, 0, sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr));
34622  (void) PyObject_INIT(o, t);
34623  PyObject_GC_Track(o);
34624  } else {
34625  o = (*t->tp_alloc)(t, 0);
34626  if (unlikely(!o)) return 0;
34627  }
34628  return o;
34629 }
34630 
34631 static void __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr(PyObject *o) {
34632  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *)o;
34633  PyObject_GC_UnTrack(o);
34634  Py_CLEAR(p->__pyx_outer_scope);
34635  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr)))) {
34636  __pyx_freelist_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr[__pyx_freecount_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *)o);
34637  } else {
34638  (*Py_TYPE(o)->tp_free)(o);
34639  }
34640 }
34641 
34642 static int __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) {
34643  int e;
34644  struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr *)o;
34645  if (p->__pyx_outer_scope) {
34646  e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
34647  }
34648  return 0;
34649 }
34650 
34651 static PyTypeObject __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr = {
34652  PyVarObject_HEAD_INIT(0, 0)
34653  "mprans.cMoveMeshMonitor.__pyx_scope_struct_4_genexpr", /*tp_name*/
34654  sizeof(struct __pyx_obj_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr), /*tp_basicsize*/
34655  0, /*tp_itemsize*/
34656  __pyx_tp_dealloc_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr, /*tp_dealloc*/
34657  #if PY_VERSION_HEX < 0x030800b4
34658  0, /*tp_print*/
34659  #endif
34660  #if PY_VERSION_HEX >= 0x030800b4
34661  0, /*tp_vectorcall_offset*/
34662  #endif
34663  0, /*tp_getattr*/
34664  0, /*tp_setattr*/
34665  #if PY_MAJOR_VERSION < 3
34666  0, /*tp_compare*/
34667  #endif
34668  #if PY_MAJOR_VERSION >= 3
34669  0, /*tp_as_async*/
34670  #endif
34671  0, /*tp_repr*/
34672  0, /*tp_as_number*/
34673  0, /*tp_as_sequence*/
34674  0, /*tp_as_mapping*/
34675  0, /*tp_hash*/
34676  0, /*tp_call*/
34677  0, /*tp_str*/
34678  0, /*tp_getattro*/
34679  0, /*tp_setattro*/
34680  0, /*tp_as_buffer*/
34681  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34682  0, /*tp_doc*/
34683  __pyx_tp_traverse_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr, /*tp_traverse*/
34684  0, /*tp_clear*/
34685  0, /*tp_richcompare*/
34686  0, /*tp_weaklistoffset*/
34687  0, /*tp_iter*/
34688  0, /*tp_iternext*/
34689  0, /*tp_methods*/
34690  0, /*tp_members*/
34691  0, /*tp_getset*/
34692  0, /*tp_base*/
34693  0, /*tp_dict*/
34694  0, /*tp_descr_get*/
34695  0, /*tp_descr_set*/
34696  0, /*tp_dictoffset*/
34697  0, /*tp_init*/
34698  0, /*tp_alloc*/
34699  __pyx_tp_new_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr, /*tp_new*/
34700  0, /*tp_free*/
34701  0, /*tp_is_gc*/
34702  0, /*tp_bases*/
34703  0, /*tp_mro*/
34704  0, /*tp_cache*/
34705  0, /*tp_subclasses*/
34706  0, /*tp_weaklist*/
34707  0, /*tp_del*/
34708  0, /*tp_version_tag*/
34709  #if PY_VERSION_HEX >= 0x030400a1
34710  0, /*tp_finalize*/
34711  #endif
34712  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34713  0, /*tp_vectorcall*/
34714  #endif
34715  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34716  0, /*tp_print*/
34717  #endif
34718  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34719  0, /*tp_pypy_flags*/
34720  #endif
34721 };
34722 static struct __pyx_vtabstruct_array __pyx_vtable_array;
34723 
34724 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
34725  struct __pyx_array_obj *p;
34726  PyObject *o;
34727  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
34728  o = (*t->tp_alloc)(t, 0);
34729  } else {
34730  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
34731  }
34732  if (unlikely(!o)) return 0;
34733  p = ((struct __pyx_array_obj *)o);
34734  p->__pyx_vtab = __pyx_vtabptr_array;
34735  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
34736  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
34737  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
34738  return o;
34739  bad:
34740  Py_DECREF(o); o = 0;
34741  return NULL;
34742 }
34743 
34744 static void __pyx_tp_dealloc_array(PyObject *o) {
34745  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
34746  #if CYTHON_USE_TP_FINALIZE
34747  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
34748  if (PyObject_CallFinalizerFromDealloc(o)) return;
34749  }
34750  #endif
34751  {
34752  PyObject *etype, *eval, *etb;
34753  PyErr_Fetch(&etype, &eval, &etb);
34754  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
34755  __pyx_array___dealloc__(o);
34756  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
34757  PyErr_Restore(etype, eval, etb);
34758  }
34759  Py_CLEAR(p->mode);
34760  Py_CLEAR(p->_format);
34761  (*Py_TYPE(o)->tp_free)(o);
34762 }
34763 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
34764  PyObject *r;
34765  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
34766  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
34767  Py_DECREF(x);
34768  return r;
34769 }
34770 
34771 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
34772  if (v) {
34773  return __pyx_array___setitem__(o, i, v);
34774  }
34775  else {
34776  PyErr_Format(PyExc_NotImplementedError,
34777  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
34778  return -1;
34779  }
34780 }
34781 
34782 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
34783  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
34784  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
34785  PyErr_Clear();
34786  v = __pyx_array___getattr__(o, n);
34787  }
34788  return v;
34789 }
34790 
34791 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
34792  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
34793 }
34794 
34795 static PyMethodDef __pyx_methods_array[] = {
34796  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
34797  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
34798  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
34799  {0, 0, 0, 0}
34800 };
34801 
34802 static struct PyGetSetDef __pyx_getsets_array[] = {
34803  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
34804  {0, 0, 0, 0, 0}
34805 };
34806 
34807 static PySequenceMethods __pyx_tp_as_sequence_array = {
34808  __pyx_array___len__, /*sq_length*/
34809  0, /*sq_concat*/
34810  0, /*sq_repeat*/
34811  __pyx_sq_item_array, /*sq_item*/
34812  0, /*sq_slice*/
34813  0, /*sq_ass_item*/
34814  0, /*sq_ass_slice*/
34815  0, /*sq_contains*/
34816  0, /*sq_inplace_concat*/
34817  0, /*sq_inplace_repeat*/
34818 };
34819 
34820 static PyMappingMethods __pyx_tp_as_mapping_array = {
34821  __pyx_array___len__, /*mp_length*/
34822  __pyx_array___getitem__, /*mp_subscript*/
34823  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
34824 };
34825 
34826 static PyBufferProcs __pyx_tp_as_buffer_array = {
34827  #if PY_MAJOR_VERSION < 3
34828  0, /*bf_getreadbuffer*/
34829  #endif
34830  #if PY_MAJOR_VERSION < 3
34831  0, /*bf_getwritebuffer*/
34832  #endif
34833  #if PY_MAJOR_VERSION < 3
34834  0, /*bf_getsegcount*/
34835  #endif
34836  #if PY_MAJOR_VERSION < 3
34837  0, /*bf_getcharbuffer*/
34838  #endif
34839  __pyx_array_getbuffer, /*bf_getbuffer*/
34840  0, /*bf_releasebuffer*/
34841 };
34842 
34843 static PyTypeObject __pyx_type___pyx_array = {
34844  PyVarObject_HEAD_INIT(0, 0)
34845  "mprans.cMoveMeshMonitor.array", /*tp_name*/
34846  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
34847  0, /*tp_itemsize*/
34848  __pyx_tp_dealloc_array, /*tp_dealloc*/
34849  #if PY_VERSION_HEX < 0x030800b4
34850  0, /*tp_print*/
34851  #endif
34852  #if PY_VERSION_HEX >= 0x030800b4
34853  0, /*tp_vectorcall_offset*/
34854  #endif
34855  0, /*tp_getattr*/
34856  0, /*tp_setattr*/
34857  #if PY_MAJOR_VERSION < 3
34858  0, /*tp_compare*/
34859  #endif
34860  #if PY_MAJOR_VERSION >= 3
34861  0, /*tp_as_async*/
34862  #endif
34863  0, /*tp_repr*/
34864  0, /*tp_as_number*/
34865  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
34866  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
34867  0, /*tp_hash*/
34868  0, /*tp_call*/
34869  0, /*tp_str*/
34870  __pyx_tp_getattro_array, /*tp_getattro*/
34871  0, /*tp_setattro*/
34872  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
34873  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
34874  0, /*tp_doc*/
34875  0, /*tp_traverse*/
34876  0, /*tp_clear*/
34877  0, /*tp_richcompare*/
34878  0, /*tp_weaklistoffset*/
34879  0, /*tp_iter*/
34880  0, /*tp_iternext*/
34881  __pyx_methods_array, /*tp_methods*/
34882  0, /*tp_members*/
34883  __pyx_getsets_array, /*tp_getset*/
34884  0, /*tp_base*/
34885  0, /*tp_dict*/
34886  0, /*tp_descr_get*/
34887  0, /*tp_descr_set*/
34888  0, /*tp_dictoffset*/
34889  0, /*tp_init*/
34890  0, /*tp_alloc*/
34891  __pyx_tp_new_array, /*tp_new*/
34892  0, /*tp_free*/
34893  0, /*tp_is_gc*/
34894  0, /*tp_bases*/
34895  0, /*tp_mro*/
34896  0, /*tp_cache*/
34897  0, /*tp_subclasses*/
34898  0, /*tp_weaklist*/
34899  0, /*tp_del*/
34900  0, /*tp_version_tag*/
34901  #if PY_VERSION_HEX >= 0x030400a1
34902  0, /*tp_finalize*/
34903  #endif
34904  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
34905  0, /*tp_vectorcall*/
34906  #endif
34907  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34908  0, /*tp_print*/
34909  #endif
34910  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
34911  0, /*tp_pypy_flags*/
34912  #endif
34913 };
34914 
34915 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34916  struct __pyx_MemviewEnum_obj *p;
34917  PyObject *o;
34918  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
34919  o = (*t->tp_alloc)(t, 0);
34920  } else {
34921  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
34922  }
34923  if (unlikely(!o)) return 0;
34924  p = ((struct __pyx_MemviewEnum_obj *)o);
34925  p->name = Py_None; Py_INCREF(Py_None);
34926  return o;
34927 }
34928 
34929 static void __pyx_tp_dealloc_Enum(PyObject *o) {
34930  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
34931  #if CYTHON_USE_TP_FINALIZE
34932  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
34933  if (PyObject_CallFinalizerFromDealloc(o)) return;
34934  }
34935  #endif
34936  PyObject_GC_UnTrack(o);
34937  Py_CLEAR(p->name);
34938  (*Py_TYPE(o)->tp_free)(o);
34939 }
34940 
34941 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
34942  int e;
34943  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
34944  if (p->name) {
34945  e = (*v)(p->name, a); if (e) return e;
34946  }
34947  return 0;
34948 }
34949 
34950 static int __pyx_tp_clear_Enum(PyObject *o) {
34951  PyObject* tmp;
34952  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
34953  tmp = ((PyObject*)p->name);
34954  p->name = Py_None; Py_INCREF(Py_None);
34955  Py_XDECREF(tmp);
34956  return 0;
34957 }
34958 
34959 static PyMethodDef __pyx_methods_Enum[] = {
34960  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
34961  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
34962  {0, 0, 0, 0}
34963 };
34964 
34965 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
34966  PyVarObject_HEAD_INIT(0, 0)
34967  "mprans.cMoveMeshMonitor.Enum", /*tp_name*/
34968  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
34969  0, /*tp_itemsize*/
34970  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
34971  #if PY_VERSION_HEX < 0x030800b4
34972  0, /*tp_print*/
34973  #endif
34974  #if PY_VERSION_HEX >= 0x030800b4
34975  0, /*tp_vectorcall_offset*/
34976  #endif
34977  0, /*tp_getattr*/
34978  0, /*tp_setattr*/
34979  #if PY_MAJOR_VERSION < 3
34980  0, /*tp_compare*/
34981  #endif
34982  #if PY_MAJOR_VERSION >= 3
34983  0, /*tp_as_async*/
34984  #endif
34985  __pyx_MemviewEnum___repr__, /*tp_repr*/
34986  0, /*tp_as_number*/
34987  0, /*tp_as_sequence*/
34988  0, /*tp_as_mapping*/
34989  0, /*tp_hash*/
34990  0, /*tp_call*/
34991  0, /*tp_str*/
34992  0, /*tp_getattro*/
34993  0, /*tp_setattro*/
34994  0, /*tp_as_buffer*/
34995  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34996  0, /*tp_doc*/
34997  __pyx_tp_traverse_Enum, /*tp_traverse*/
34998  __pyx_tp_clear_Enum, /*tp_clear*/
34999  0, /*tp_richcompare*/
35000  0, /*tp_weaklistoffset*/
35001  0, /*tp_iter*/
35002  0, /*tp_iternext*/
35003  __pyx_methods_Enum, /*tp_methods*/
35004  0, /*tp_members*/
35005  0, /*tp_getset*/
35006  0, /*tp_base*/
35007  0, /*tp_dict*/
35008  0, /*tp_descr_get*/
35009  0, /*tp_descr_set*/
35010  0, /*tp_dictoffset*/
35011  __pyx_MemviewEnum___init__, /*tp_init*/
35012  0, /*tp_alloc*/
35013  __pyx_tp_new_Enum, /*tp_new*/
35014  0, /*tp_free*/
35015  0, /*tp_is_gc*/
35016  0, /*tp_bases*/
35017  0, /*tp_mro*/
35018  0, /*tp_cache*/
35019  0, /*tp_subclasses*/
35020  0, /*tp_weaklist*/
35021  0, /*tp_del*/
35022  0, /*tp_version_tag*/
35023  #if PY_VERSION_HEX >= 0x030400a1
35024  0, /*tp_finalize*/
35025  #endif
35026  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
35027  0, /*tp_vectorcall*/
35028  #endif
35029  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
35030  0, /*tp_print*/
35031  #endif
35032  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
35033  0, /*tp_pypy_flags*/
35034  #endif
35035 };
35036 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
35037 
35038 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
35039  struct __pyx_memoryview_obj *p;
35040  PyObject *o;
35041  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
35042  o = (*t->tp_alloc)(t, 0);
35043  } else {
35044  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
35045  }
35046  if (unlikely(!o)) return 0;
35047  p = ((struct __pyx_memoryview_obj *)o);
35048  p->__pyx_vtab = __pyx_vtabptr_memoryview;
35049  p->obj = Py_None; Py_INCREF(Py_None);
35050  p->_size = Py_None; Py_INCREF(Py_None);
35051  p->_array_interface = Py_None; Py_INCREF(Py_None);
35052  p->view.obj = NULL;
35053  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
35054  return o;
35055  bad:
35056  Py_DECREF(o); o = 0;
35057  return NULL;
35058 }
35059 
35060 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
35061  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
35062  #if CYTHON_USE_TP_FINALIZE
35063  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
35064  if (PyObject_CallFinalizerFromDealloc(o)) return;
35065  }
35066  #endif
35067  PyObject_GC_UnTrack(o);
35068  {
35069  PyObject *etype, *eval, *etb;
35070  PyErr_Fetch(&etype, &eval, &etb);
35071  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
35072  __pyx_memoryview___dealloc__(o);
35073  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
35074  PyErr_Restore(etype, eval, etb);
35075  }
35076  Py_CLEAR(p->obj);
35077  Py_CLEAR(p->_size);
35078  Py_CLEAR(p->_array_interface);
35079  (*Py_TYPE(o)->tp_free)(o);
35080 }
35081 
35082 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
35083  int e;
35084  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
35085  if (p->obj) {
35086  e = (*v)(p->obj, a); if (e) return e;
35087  }
35088  if (p->_size) {
35089  e = (*v)(p->_size, a); if (e) return e;
35090  }
35091  if (p->_array_interface) {
35092  e = (*v)(p->_array_interface, a); if (e) return e;
35093  }
35094  if (p->view.obj) {
35095  e = (*v)(p->view.obj, a); if (e) return e;
35096  }
35097  return 0;
35098 }
35099 
35100 static int __pyx_tp_clear_memoryview(PyObject *o) {
35101  PyObject* tmp;
35102  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
35103  tmp = ((PyObject*)p->obj);
35104  p->obj = Py_None; Py_INCREF(Py_None);
35105  Py_XDECREF(tmp);
35106  tmp = ((PyObject*)p->_size);
35107  p->_size = Py_None; Py_INCREF(Py_None);
35108  Py_XDECREF(tmp);
35109  tmp = ((PyObject*)p->_array_interface);
35110  p->_array_interface = Py_None; Py_INCREF(Py_None);
35111  Py_XDECREF(tmp);
35112  Py_CLEAR(p->view.obj);
35113  return 0;
35114 }
35115 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
35116  PyObject *r;
35117  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
35118  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
35119  Py_DECREF(x);
35120  return r;
35121 }
35122 
35123 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
35124  if (v) {
35125  return __pyx_memoryview___setitem__(o, i, v);
35126  }
35127  else {
35128  PyErr_Format(PyExc_NotImplementedError,
35129  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
35130  return -1;
35131  }
35132 }
35133 
35134 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
35135  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
35136 }
35137 
35138 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
35139  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
35140 }
35141 
35142 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
35143  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
35144 }
35145 
35146 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
35147  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
35148 }
35149 
35150 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
35151  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
35152 }
35153 
35154 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
35155  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
35156 }
35157 
35158 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
35159  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
35160 }
35161 
35162 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
35163  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
35164 }
35165 
35166 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
35167  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
35168 }
35169 
35170 static PyMethodDef __pyx_methods_memoryview[] = {
35171  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
35172  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
35173  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
35174  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
35175  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
35176  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
35177  {0, 0, 0, 0}
35178 };
35179 
35180 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
35181  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
35182  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
35183  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
35184  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
35185  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
35186  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
35187  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
35188  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
35189  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
35190  {0, 0, 0, 0, 0}
35191 };
35192 
35193 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
35194  __pyx_memoryview___len__, /*sq_length*/
35195  0, /*sq_concat*/
35196  0, /*sq_repeat*/
35197  __pyx_sq_item_memoryview, /*sq_item*/
35198  0, /*sq_slice*/
35199  0, /*sq_ass_item*/
35200  0, /*sq_ass_slice*/
35201  0, /*sq_contains*/
35202  0, /*sq_inplace_concat*/
35203  0, /*sq_inplace_repeat*/
35204 };
35205 
35206 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
35207  __pyx_memoryview___len__, /*mp_length*/
35208  __pyx_memoryview___getitem__, /*mp_subscript*/
35209  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
35210 };
35211 
35212 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
35213  #if PY_MAJOR_VERSION < 3
35214  0, /*bf_getreadbuffer*/
35215  #endif
35216  #if PY_MAJOR_VERSION < 3
35217  0, /*bf_getwritebuffer*/
35218  #endif
35219  #if PY_MAJOR_VERSION < 3
35220  0, /*bf_getsegcount*/
35221  #endif
35222  #if PY_MAJOR_VERSION < 3
35223  0, /*bf_getcharbuffer*/
35224  #endif
35225  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
35226  0, /*bf_releasebuffer*/
35227 };
35228 
35229 static PyTypeObject __pyx_type___pyx_memoryview = {
35230  PyVarObject_HEAD_INIT(0, 0)
35231  "mprans.cMoveMeshMonitor.memoryview", /*tp_name*/
35232  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
35233  0, /*tp_itemsize*/
35234  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
35235  #if PY_VERSION_HEX < 0x030800b4
35236  0, /*tp_print*/
35237  #endif
35238  #if PY_VERSION_HEX >= 0x030800b4
35239  0, /*tp_vectorcall_offset*/
35240  #endif
35241  0, /*tp_getattr*/
35242  0, /*tp_setattr*/
35243  #if PY_MAJOR_VERSION < 3
35244  0, /*tp_compare*/
35245  #endif
35246  #if PY_MAJOR_VERSION >= 3
35247  0, /*tp_as_async*/
35248  #endif
35249  __pyx_memoryview___repr__, /*tp_repr*/
35250  0, /*tp_as_number*/
35251  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
35252  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
35253  0, /*tp_hash*/
35254  0, /*tp_call*/
35255  __pyx_memoryview___str__, /*tp_str*/
35256  0, /*tp_getattro*/
35257  0, /*tp_setattro*/
35258  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
35259  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
35260  0, /*tp_doc*/
35261  __pyx_tp_traverse_memoryview, /*tp_traverse*/
35262  __pyx_tp_clear_memoryview, /*tp_clear*/
35263  0, /*tp_richcompare*/
35264  0, /*tp_weaklistoffset*/
35265  0, /*tp_iter*/
35266  0, /*tp_iternext*/
35267  __pyx_methods_memoryview, /*tp_methods*/
35268  0, /*tp_members*/
35269  __pyx_getsets_memoryview, /*tp_getset*/
35270  0, /*tp_base*/
35271  0, /*tp_dict*/
35272  0, /*tp_descr_get*/
35273  0, /*tp_descr_set*/
35274  0, /*tp_dictoffset*/
35275  0, /*tp_init*/
35276  0, /*tp_alloc*/
35277  __pyx_tp_new_memoryview, /*tp_new*/
35278  0, /*tp_free*/
35279  0, /*tp_is_gc*/
35280  0, /*tp_bases*/
35281  0, /*tp_mro*/
35282  0, /*tp_cache*/
35283  0, /*tp_subclasses*/
35284  0, /*tp_weaklist*/
35285  0, /*tp_del*/
35286  0, /*tp_version_tag*/
35287  #if PY_VERSION_HEX >= 0x030400a1
35288  0, /*tp_finalize*/
35289  #endif
35290  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
35291  0, /*tp_vectorcall*/
35292  #endif
35293  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
35294  0, /*tp_print*/
35295  #endif
35296  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
35297  0, /*tp_pypy_flags*/
35298  #endif
35299 };
35300 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
35301 
35302 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
35303  struct __pyx_memoryviewslice_obj *p;
35304  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
35305  if (unlikely(!o)) return 0;
35306  p = ((struct __pyx_memoryviewslice_obj *)o);
35307  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
35308  p->from_object = Py_None; Py_INCREF(Py_None);
35309  p->from_slice.memview = NULL;
35310  return o;
35311 }
35312 
35313 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
35314  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
35315  #if CYTHON_USE_TP_FINALIZE
35316  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
35317  if (PyObject_CallFinalizerFromDealloc(o)) return;
35318  }
35319  #endif
35320  PyObject_GC_UnTrack(o);
35321  {
35322  PyObject *etype, *eval, *etb;
35323  PyErr_Fetch(&etype, &eval, &etb);
35324  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
35325  __pyx_memoryviewslice___dealloc__(o);
35326  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
35327  PyErr_Restore(etype, eval, etb);
35328  }
35329  Py_CLEAR(p->from_object);
35330  PyObject_GC_Track(o);
35331  __pyx_tp_dealloc_memoryview(o);
35332 }
35333 
35334 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
35335  int e;
35336  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
35337  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
35338  if (p->from_object) {
35339  e = (*v)(p->from_object, a); if (e) return e;
35340  }
35341  return 0;
35342 }
35343 
35344 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
35345  PyObject* tmp;
35346  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
35347  __pyx_tp_clear_memoryview(o);
35348  tmp = ((PyObject*)p->from_object);
35349  p->from_object = Py_None; Py_INCREF(Py_None);
35350  Py_XDECREF(tmp);
35351  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
35352  return 0;
35353 }
35354 
35355 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
35356  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
35357 }
35358 
35359 static PyMethodDef __pyx_methods__memoryviewslice[] = {
35360  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
35361  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
35362  {0, 0, 0, 0}
35363 };
35364 
35365 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
35366  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
35367  {0, 0, 0, 0, 0}
35368 };
35369 
35370 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
35371  PyVarObject_HEAD_INIT(0, 0)
35372  "mprans.cMoveMeshMonitor._memoryviewslice", /*tp_name*/
35373  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
35374  0, /*tp_itemsize*/
35375  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
35376  #if PY_VERSION_HEX < 0x030800b4
35377  0, /*tp_print*/
35378  #endif
35379  #if PY_VERSION_HEX >= 0x030800b4
35380  0, /*tp_vectorcall_offset*/
35381  #endif
35382  0, /*tp_getattr*/
35383  0, /*tp_setattr*/
35384  #if PY_MAJOR_VERSION < 3
35385  0, /*tp_compare*/
35386  #endif
35387  #if PY_MAJOR_VERSION >= 3
35388  0, /*tp_as_async*/
35389  #endif
35390  #if CYTHON_COMPILING_IN_PYPY
35391  __pyx_memoryview___repr__, /*tp_repr*/
35392  #else
35393  0, /*tp_repr*/
35394  #endif
35395  0, /*tp_as_number*/
35396  0, /*tp_as_sequence*/
35397  0, /*tp_as_mapping*/
35398  0, /*tp_hash*/
35399  0, /*tp_call*/
35400  #if CYTHON_COMPILING_IN_PYPY
35401  __pyx_memoryview___str__, /*tp_str*/
35402  #else
35403  0, /*tp_str*/
35404  #endif
35405  0, /*tp_getattro*/
35406  0, /*tp_setattro*/
35407  0, /*tp_as_buffer*/
35408  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
35409  "Internal class for passing memoryview slices to Python", /*tp_doc*/
35410  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
35411  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
35412  0, /*tp_richcompare*/
35413  0, /*tp_weaklistoffset*/
35414  0, /*tp_iter*/
35415  0, /*tp_iternext*/
35416  __pyx_methods__memoryviewslice, /*tp_methods*/
35417  0, /*tp_members*/
35418  __pyx_getsets__memoryviewslice, /*tp_getset*/
35419  0, /*tp_base*/
35420  0, /*tp_dict*/
35421  0, /*tp_descr_get*/
35422  0, /*tp_descr_set*/
35423  0, /*tp_dictoffset*/
35424  0, /*tp_init*/
35425  0, /*tp_alloc*/
35426  __pyx_tp_new__memoryviewslice, /*tp_new*/
35427  0, /*tp_free*/
35428  0, /*tp_is_gc*/
35429  0, /*tp_bases*/
35430  0, /*tp_mro*/
35431  0, /*tp_cache*/
35432  0, /*tp_subclasses*/
35433  0, /*tp_weaklist*/
35434  0, /*tp_del*/
35435  0, /*tp_version_tag*/
35436  #if PY_VERSION_HEX >= 0x030400a1
35437  0, /*tp_finalize*/
35438  #endif
35439  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
35440  0, /*tp_vectorcall*/
35441  #endif
35442  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
35443  0, /*tp_print*/
35444  #endif
35445  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
35446  0, /*tp_pypy_flags*/
35447  #endif
35448 };
35449 
35450 static PyMethodDef __pyx_methods[] = {
35451  {0, 0, 0, 0}
35452 };
35453 
35454 #if PY_MAJOR_VERSION >= 3
35455 #if CYTHON_PEP489_MULTI_PHASE_INIT
35456 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
35457 static int __pyx_pymod_exec_cMoveMeshMonitor(PyObject* module); /*proto*/
35458 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
35459  {Py_mod_create, (void*)__pyx_pymod_create},
35460  {Py_mod_exec, (void*)__pyx_pymod_exec_cMoveMeshMonitor},
35461  {0, NULL}
35462 };
35463 #endif
35464 
35465 static struct PyModuleDef __pyx_moduledef = {
35466  PyModuleDef_HEAD_INIT,
35467  "cMoveMeshMonitor",
35468  0, /* m_doc */
35469  #if CYTHON_PEP489_MULTI_PHASE_INIT
35470  0, /* m_size */
35471  #else
35472  -1, /* m_size */
35473  #endif
35474  __pyx_methods /* m_methods */,
35475  #if CYTHON_PEP489_MULTI_PHASE_INIT
35476  __pyx_moduledef_slots, /* m_slots */
35477  #else
35478  NULL, /* m_reload */
35479  #endif
35480  NULL, /* m_traverse */
35481  NULL, /* m_clear */
35482  NULL /* m_free */
35483 };
35484 #endif
35485 #ifndef CYTHON_SMALL_CODE
35486 #if defined(__clang__)
35487  #define CYTHON_SMALL_CODE
35488 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
35489  #define CYTHON_SMALL_CODE __attribute__((cold))
35490 #else
35491  #define CYTHON_SMALL_CODE
35492 #endif
35493 #endif
35494 
35495 static __Pyx_StringTabEntry __pyx_string_tab[] = {
35496  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
35497  {&__pyx_n_s_Abort, __pyx_k_Abort, sizeof(__pyx_k_Abort), 0, 0, 1, 1},
35498  {&__pyx_n_s_Allgatherv, __pyx_k_Allgatherv, sizeof(__pyx_k_Allgatherv), 0, 0, 1, 1},
35499  {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
35500  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
35501  {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
35502  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
35503  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
35504  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
35505  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
35506  {&__pyx_n_s_Comm, __pyx_k_Comm, sizeof(__pyx_k_Comm), 0, 0, 1, 1},
35507  {&__pyx_n_s_Commit, __pyx_k_Commit, sizeof(__pyx_k_Commit), 0, 0, 1, 1},
35508  {&__pyx_n_s_Create_contiguous, __pyx_k_Create_contiguous, sizeof(__pyx_k_Create_contiguous), 0, 0, 1, 1},
35509  {&__pyx_n_s_DOUBLE, __pyx_k_DOUBLE, sizeof(__pyx_k_DOUBLE), 0, 0, 1, 1},
35510  {&__pyx_kp_s_Done_pseudo_timestepping, __pyx_k_Done_pseudo_timestepping, sizeof(__pyx_k_Done_pseudo_timestepping), 0, 0, 1, 0},
35511  {&__pyx_kp_s_Done_smoothing, __pyx_k_Done_smoothing, sizeof(__pyx_k_Done_smoothing), 0, 0, 1, 0},
35512  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
35513  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
35514  {&__pyx_kp_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 0},
35515  {&__pyx_n_s_Gatherv, __pyx_k_Gatherv, sizeof(__pyx_k_Gatherv), 0, 0, 1, 1},
35516  {&__pyx_n_s_INT, __pyx_k_INT, sizeof(__pyx_k_INT), 0, 0, 1, 1},
35517  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
35518  {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
35519  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
35520  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
35521  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
35522  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
35523  {&__pyx_n_s_MPI, __pyx_k_MPI, sizeof(__pyx_k_MPI), 0, 0, 1, 1},
35524  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
35525  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
35526  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
35527  {&__pyx_n_s_MeshSmoothing, __pyx_k_MeshSmoothing, sizeof(__pyx_k_MeshSmoothing), 0, 0, 1, 1},
35528  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
35529  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
35530  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
35531  {&__pyx_kp_s_Pseudo_time_stepping_t_t, __pyx_k_Pseudo_time_stepping_t_t, sizeof(__pyx_k_Pseudo_time_stepping_t_t), 0, 0, 1, 0},
35532  {&__pyx_kp_s_Pseudo_time_stepping_with_dt_eps, __pyx_k_Pseudo_time_stepping_with_dt_eps, sizeof(__pyx_k_Pseudo_time_stepping_with_dt_eps), 0, 0, 1, 0},
35533  {&__pyx_n_s_SUM, __pyx_k_SUM, sizeof(__pyx_k_SUM), 0, 0, 1, 1},
35534  {&__pyx_kp_s_Smoothing_Mesh_with_Laplace_Smoo, __pyx_k_Smoothing_Mesh_with_Laplace_Smoo, sizeof(__pyx_k_Smoothing_Mesh_with_Laplace_Smoo), 0, 0, 1, 0},
35535  {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0},
35536  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
35537  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
35538  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
35539  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
35540  {&__pyx_kp_b__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 0, 0, 0},
35541  {&__pyx_kp_b__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 0, 0},
35542  {&__pyx_kp_b__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 0, 0},
35543  {&__pyx_kp_b__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 0, 0},
35544  {&__pyx_kp_u__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 1, 0, 0},
35545  {&__pyx_kp_s_abs_det_J, __pyx_k_abs_det_J, sizeof(__pyx_k_abs_det_J), 0, 0, 1, 0},
35546  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
35547  {&__pyx_n_s_allreduce, __pyx_k_allreduce, sizeof(__pyx_k_allreduce), 0, 0, 1, 1},
35548  {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1},
35549  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
35550  {&__pyx_n_s_areas, __pyx_k_areas, sizeof(__pyx_k_areas), 0, 0, 1, 1},
35551  {&__pyx_n_s_areas_nodes, __pyx_k_areas_nodes, sizeof(__pyx_k_areas_nodes), 0, 0, 1, 1},
35552  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
35553  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
35554  {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1},
35555  {&__pyx_kp_s_b_i_and_nearestN_cannot_be_both, __pyx_k_b_i_and_nearestN_cannot_be_both, sizeof(__pyx_k_b_i_and_nearestN_cannot_be_both), 0, 0, 1, 0},
35556  {&__pyx_n_s_barrier, __pyx_k_barrier, sizeof(__pyx_k_barrier), 0, 0, 1, 1},
35557  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
35558  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
35559  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
35560  {&__pyx_n_s_cCoefficients, __pyx_k_cCoefficients, sizeof(__pyx_k_cCoefficients), 0, 0, 1, 1},
35561  {&__pyx_n_s_cCoefficients_cppPseudoTimeStepp, __pyx_k_cCoefficients_cppPseudoTimeStepp, sizeof(__pyx_k_cCoefficients_cppPseudoTimeStepp), 0, 0, 1, 1},
35562  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
35563  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
35564  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
35565  {&__pyx_n_s_comm, __pyx_k_comm, sizeof(__pyx_k_comm), 0, 0, 1, 1},
35566  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
35567  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
35568  {&__pyx_n_s_detJ_array, __pyx_k_detJ_array, sizeof(__pyx_k_detJ_array), 0, 0, 1, 1},
35569  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
35570  {&__pyx_kp_s_did_not_find_containing_element, __pyx_k_did_not_find_containing_element, sizeof(__pyx_k_did_not_find_containing_element), 0, 0, 1, 0},
35571  {&__pyx_kp_s_did_not_find_containing_element_2, __pyx_k_did_not_find_containing_element_2, sizeof(__pyx_k_did_not_find_containing_element_2), 0, 0, 1, 0},
35572  {&__pyx_kp_s_dot, __pyx_k_dot, sizeof(__pyx_k_dot), 0, 0, 1, 0},
35573  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
35574  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
35575  {&__pyx_n_s_elementBarycentersArray, __pyx_k_elementBarycentersArray, sizeof(__pyx_k_elementBarycentersArray), 0, 0, 1, 1},
35576  {&__pyx_n_s_elementBoundariesArray, __pyx_k_elementBoundariesArray, sizeof(__pyx_k_elementBoundariesArray), 0, 0, 1, 1},
35577  {&__pyx_n_s_elementBoundaryBarycentersArray, __pyx_k_elementBoundaryBarycentersArray, sizeof(__pyx_k_elementBoundaryBarycentersArray), 0, 0, 1, 1},
35578  {&__pyx_n_s_elementBoundaryElementsArray, __pyx_k_elementBoundaryElementsArray, sizeof(__pyx_k_elementBoundaryElementsArray), 0, 0, 1, 1},
35579  {&__pyx_n_s_elementBoundaryNodesArray, __pyx_k_elementBoundaryNodesArray, sizeof(__pyx_k_elementBoundaryNodesArray), 0, 0, 1, 1},
35580  {&__pyx_n_s_elementBoundaryNormalsArray, __pyx_k_elementBoundaryNormalsArray, sizeof(__pyx_k_elementBoundaryNormalsArray), 0, 0, 1, 1},
35581  {&__pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_k_elementBoundaryNumbering_subdoma, sizeof(__pyx_k_elementBoundaryNumbering_subdoma), 0, 0, 1, 1},
35582  {&__pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_k_elementBoundaryOffsets_subdomain, sizeof(__pyx_k_elementBoundaryOffsets_subdomain), 0, 0, 1, 1},
35583  {&__pyx_n_s_elementMaps, __pyx_k_elementMaps, sizeof(__pyx_k_elementMaps), 0, 0, 1, 1},
35584  {&__pyx_n_s_elementNeighborsArray, __pyx_k_elementNeighborsArray, sizeof(__pyx_k_elementNeighborsArray), 0, 0, 1, 1},
35585  {&__pyx_n_s_elementNodesArray, __pyx_k_elementNodesArray, sizeof(__pyx_k_elementNodesArray), 0, 0, 1, 1},
35586  {&__pyx_n_s_elementNumbering_subdomain2globa, __pyx_k_elementNumbering_subdomain2globa, sizeof(__pyx_k_elementNumbering_subdomain2globa), 0, 0, 1, 1},
35587  {&__pyx_n_s_elementOffsets_subdomain_owned, __pyx_k_elementOffsets_subdomain_owned, sizeof(__pyx_k_elementOffsets_subdomain_owned), 0, 0, 1, 1},
35588  {&__pyx_n_s_elementQuadratureWeights, __pyx_k_elementQuadratureWeights, sizeof(__pyx_k_elementQuadratureWeights), 0, 0, 1, 1},
35589  {&__pyx_kp_s_element_barycenter, __pyx_k_element_barycenter, sizeof(__pyx_k_element_barycenter), 0, 0, 1, 0},
35590  {&__pyx_kp_s_element_node, __pyx_k_element_node, sizeof(__pyx_k_element_node), 0, 0, 1, 0},
35591  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
35592  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
35593  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
35594  {&__pyx_n_s_eps, __pyx_k_eps, sizeof(__pyx_k_eps), 0, 0, 1, 1},
35595  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
35596  {&__pyx_n_s_evaluateFunAtX, __pyx_k_evaluateFunAtX, sizeof(__pyx_k_evaluateFunAtX), 0, 0, 1, 1},
35597  {&__pyx_n_s_exteriorElementBoundariesArray, __pyx_k_exteriorElementBoundariesArray, sizeof(__pyx_k_exteriorElementBoundariesArray), 0, 0, 1, 1},
35598  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
35599  {&__pyx_n_s_femSpace, __pyx_k_femSpace, sizeof(__pyx_k_femSpace), 0, 0, 1, 1},
35600  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
35601  {&__pyx_n_s_fixedNodesBoolArray, __pyx_k_fixedNodesBoolArray, sizeof(__pyx_k_fixedNodesBoolArray), 0, 0, 1, 1},
35602  {&__pyx_kp_s_fixed_dir, __pyx_k_fixed_dir, sizeof(__pyx_k_fixed_dir), 0, 0, 1, 0},
35603  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
35604  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
35605  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
35606  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
35607  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
35608  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
35609  {&__pyx_n_s_getAreaValue, __pyx_k_getAreaValue, sizeof(__pyx_k_getAreaValue), 0, 0, 1, 1},
35610  {&__pyx_n_s_getGradientValue, __pyx_k_getGradientValue, sizeof(__pyx_k_getGradientValue), 0, 0, 1, 1},
35611  {&__pyx_n_s_getInverseValue, __pyx_k_getInverseValue, sizeof(__pyx_k_getInverseValue), 0, 0, 1, 1},
35612  {&__pyx_n_s_getLevelSetValue, __pyx_k_getLevelSetValue, sizeof(__pyx_k_getLevelSetValue), 0, 0, 1, 1},
35613  {&__pyx_n_s_getNonOwnedNodeValues, __pyx_k_getNonOwnedNodeValues, sizeof(__pyx_k_getNonOwnedNodeValues), 0, 0, 1, 1},
35614  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
35615  {&__pyx_n_s_globalMesh, __pyx_k_globalMesh, sizeof(__pyx_k_globalMesh), 0, 0, 1, 1},
35616  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
35617  {&__pyx_n_s_gradientRecoveryAtNodes, __pyx_k_gradientRecoveryAtNodes, sizeof(__pyx_k_gradientRecoveryAtNodes), 0, 0, 1, 1},
35618  {&__pyx_n_s_gradientRecoveryAtNodesWeighted, __pyx_k_gradientRecoveryAtNodesWeighted, sizeof(__pyx_k_gradientRecoveryAtNodesWeighted), 0, 0, 1, 1},
35619  {&__pyx_n_s_grads, __pyx_k_grads, sizeof(__pyx_k_grads), 0, 0, 1, 1},
35620  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
35621  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
35622  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
35623  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
35624  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
35625  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
35626  {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1},
35627  {&__pyx_n_s_linspace, __pyx_k_linspace, sizeof(__pyx_k_linspace), 0, 0, 1, 1},
35628  {&__pyx_n_s_logEvent, __pyx_k_logEvent, sizeof(__pyx_k_logEvent), 0, 0, 1, 1},
35629  {&__pyx_n_s_ls_phi, __pyx_k_ls_phi, sizeof(__pyx_k_ls_phi), 0, 0, 1, 1},
35630  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
35631  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
35632  {&__pyx_n_s_mesh, __pyx_k_mesh, sizeof(__pyx_k_mesh), 0, 0, 1, 1},
35633  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
35634  {&__pyx_n_s_model, __pyx_k_model, sizeof(__pyx_k_model), 0, 0, 1, 1},
35635  {&__pyx_n_s_mpi4py, __pyx_k_mpi4py, sizeof(__pyx_k_mpi4py), 0, 0, 1, 1},
35636  {&__pyx_n_s_mprans_cMoveMeshMonitor, __pyx_k_mprans_cMoveMeshMonitor, sizeof(__pyx_k_mprans_cMoveMeshMonitor), 0, 0, 1, 1},
35637  {&__pyx_n_s_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 0, 1, 1},
35638  {&__pyx_n_s_nElementBoundaries_global, __pyx_k_nElementBoundaries_global, sizeof(__pyx_k_nElementBoundaries_global), 0, 0, 1, 1},
35639  {&__pyx_n_s_nElementBoundaries_owned, __pyx_k_nElementBoundaries_owned, sizeof(__pyx_k_nElementBoundaries_owned), 0, 0, 1, 1},
35640  {&__pyx_n_s_nElements_global, __pyx_k_nElements_global, sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
35641  {&__pyx_n_s_nElements_owned, __pyx_k_nElements_owned, sizeof(__pyx_k_nElements_owned), 0, 0, 1, 1},
35642  {&__pyx_n_s_nNodes, __pyx_k_nNodes, sizeof(__pyx_k_nNodes), 0, 0, 1, 1},
35643  {&__pyx_n_s_nNodes_element, __pyx_k_nNodes_element, sizeof(__pyx_k_nNodes_element), 0, 0, 1, 1},
35644  {&__pyx_n_s_nNodes_elementBoundary, __pyx_k_nNodes_elementBoundary, sizeof(__pyx_k_nNodes_elementBoundary), 0, 0, 1, 1},
35645  {&__pyx_n_s_nNodes_global, __pyx_k_nNodes_global, sizeof(__pyx_k_nNodes_global), 0, 0, 1, 1},
35646  {&__pyx_n_s_nNodes_owned, __pyx_k_nNodes_owned, sizeof(__pyx_k_nNodes_owned), 0, 0, 1, 1},
35647  {&__pyx_n_s_nSmoothIn, __pyx_k_nSmoothIn, sizeof(__pyx_k_nSmoothIn), 0, 0, 1, 1},
35648  {&__pyx_n_s_nSmoothOut, __pyx_k_nSmoothOut, sizeof(__pyx_k_nSmoothOut), 0, 0, 1, 1},
35649  {&__pyx_n_s_nVariables_owned, __pyx_k_nVariables_owned, sizeof(__pyx_k_nVariables_owned), 0, 0, 1, 1},
35650  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
35651  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
35652  {&__pyx_n_s_nd, __pyx_k_nd, sizeof(__pyx_k_nd), 0, 0, 1, 1},
35653  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
35654  {&__pyx_kp_s_nearestN_element, __pyx_k_nearestN_element, sizeof(__pyx_k_nearestN_element), 0, 0, 1, 0},
35655  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
35656  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
35657  {&__pyx_n_s_nodeArray, __pyx_k_nodeArray, sizeof(__pyx_k_nodeArray), 0, 0, 1, 1},
35658  {&__pyx_n_s_nodeArray_2, __pyx_k_nodeArray_2, sizeof(__pyx_k_nodeArray_2), 0, 0, 1, 1},
35659  {&__pyx_n_s_nodeElementOffsets, __pyx_k_nodeElementOffsets, sizeof(__pyx_k_nodeElementOffsets), 0, 0, 1, 1},
35660  {&__pyx_n_s_nodeElementsArray, __pyx_k_nodeElementsArray, sizeof(__pyx_k_nodeElementsArray), 0, 0, 1, 1},
35661  {&__pyx_n_s_nodeMaterialTypes, __pyx_k_nodeMaterialTypes, sizeof(__pyx_k_nodeMaterialTypes), 0, 0, 1, 1},
35662  {&__pyx_n_s_nodeNumbering_subdomain2global, __pyx_k_nodeNumbering_subdomain2global, sizeof(__pyx_k_nodeNumbering_subdomain2global), 0, 0, 1, 1},
35663  {&__pyx_n_s_nodeOffsets_subdomain_owned, __pyx_k_nodeOffsets_subdomain_owned, sizeof(__pyx_k_nodeOffsets_subdomain_owned), 0, 0, 1, 1},
35664  {&__pyx_n_s_nodeStarArray, __pyx_k_nodeStarArray, sizeof(__pyx_k_nodeStarArray), 0, 0, 1, 1},
35665  {&__pyx_n_s_nodeStarOffsets, __pyx_k_nodeStarOffsets, sizeof(__pyx_k_nodeStarOffsets), 0, 0, 1, 1},
35666  {&__pyx_kp_s_node_materialType, __pyx_k_node_materialType, sizeof(__pyx_k_node_materialType), 0, 0, 1, 0},
35667  {&__pyx_kp_s_node_new_coordinates, __pyx_k_node_new_coordinates, sizeof(__pyx_k_node_new_coordinates), 0, 0, 1, 0},
35668  {&__pyx_kp_s_node_number, __pyx_k_node_number, sizeof(__pyx_k_node_number), 0, 0, 1, 0},
35669  {&__pyx_kp_s_node_old_coordinates, __pyx_k_node_old_coordinates, sizeof(__pyx_k_node_old_coordinates), 0, 0, 1, 0},
35670  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
35671  {&__pyx_n_s_ntimes_i, __pyx_k_ntimes_i, sizeof(__pyx_k_ntimes_i), 0, 0, 1, 1},
35672  {&__pyx_n_s_ntimes_solved, __pyx_k_ntimes_solved, sizeof(__pyx_k_ntimes_solved), 0, 0, 1, 1},
35673  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
35674  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
35675  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
35676  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
35677  {&__pyx_n_s_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1},
35678  {&__pyx_n_s_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 0, 1, 1},
35679  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
35680  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
35681  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
35682  {&__pyx_n_s_proteus, __pyx_k_proteus, sizeof(__pyx_k_proteus), 0, 0, 1, 1},
35683  {&__pyx_n_s_proteus_Profiling, __pyx_k_proteus_Profiling, sizeof(__pyx_k_proteus_Profiling), 0, 0, 1, 1},
35684  {&__pyx_n_s_proteus_mprans, __pyx_k_proteus_mprans, sizeof(__pyx_k_proteus_mprans), 0, 0, 1, 1},
35685  {&__pyx_kp_s_proteus_mprans_cMoveMeshMonitor, __pyx_k_proteus_mprans_cMoveMeshMonitor, sizeof(__pyx_k_proteus_mprans_cMoveMeshMonitor), 0, 0, 1, 0},
35686  {&__pyx_n_s_pyCheckOwnedVariable, __pyx_k_pyCheckOwnedVariable, sizeof(__pyx_k_pyCheckOwnedVariable), 0, 0, 1, 1},
35687  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
35688  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
35689  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
35690  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
35691  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
35692  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
35693  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
35694  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
35695  {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1},
35696  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
35697  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
35698  {&__pyx_n_s_rank, __pyx_k_rank, sizeof(__pyx_k_rank), 0, 0, 1, 1},
35699  {&__pyx_n_s_recoveryAtNodes, __pyx_k_recoveryAtNodes, sizeof(__pyx_k_recoveryAtNodes), 0, 0, 1, 1},
35700  {&__pyx_n_s_recoveryAtNodesWeighted, __pyx_k_recoveryAtNodesWeighted, sizeof(__pyx_k_recoveryAtNodesWeighted), 0, 0, 1, 1},
35701  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
35702  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
35703  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
35704  {&__pyx_n_s_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 0, 1, 1},
35705  {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
35706  {&__pyx_n_s_scalars, __pyx_k_scalars, sizeof(__pyx_k_scalars), 0, 0, 1, 1},
35707  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
35708  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
35709  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
35710  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
35711  {&__pyx_n_s_simultaneous, __pyx_k_simultaneous, sizeof(__pyx_k_simultaneous), 0, 0, 1, 1},
35712  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
35713  {&__pyx_n_s_smoothBoundaries, __pyx_k_smoothBoundaries, sizeof(__pyx_k_smoothBoundaries), 0, 0, 1, 1},
35714  {&__pyx_n_s_smoothNodesLaplace, __pyx_k_smoothNodesLaplace, sizeof(__pyx_k_smoothNodesLaplace), 0, 0, 1, 1},
35715  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
35716  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
35717  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
35718  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
35719  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
35720  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
35721  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
35722  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
35723  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
35724  {&__pyx_n_s_t_max, __pyx_k_t_max, sizeof(__pyx_k_t_max), 0, 0, 1, 1},
35725  {&__pyx_n_s_t_min, __pyx_k_t_min, sizeof(__pyx_k_t_min), 0, 0, 1, 1},
35726  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
35727  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
35728  {&__pyx_n_s_tompi4py, __pyx_k_tompi4py, sizeof(__pyx_k_tompi4py), 0, 0, 1, 1},
35729  {&__pyx_kp_s_type_should_be_1, __pyx_k_type_should_be_1, sizeof(__pyx_k_type_should_be_1), 0, 0, 1, 0},
35730  {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1},
35731  {&__pyx_n_s_uOfXTatQuadrature, __pyx_k_uOfXTatQuadrature, sizeof(__pyx_k_uOfXTatQuadrature), 0, 0, 1, 1},
35732  {&__pyx_n_s_u_phi, __pyx_k_u_phi, sizeof(__pyx_k_u_phi), 0, 0, 1, 1},
35733  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
35734  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
35735  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
35736  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
35737  {&__pyx_n_s_variableNumbering_subdomain2glob, __pyx_k_variableNumbering_subdomain2glob, sizeof(__pyx_k_variableNumbering_subdomain2glob), 0, 0, 1, 1},
35738  {&__pyx_n_s_variableOffsets_subdomain_owned, __pyx_k_variableOffsets_subdomain_owned, sizeof(__pyx_k_variableOffsets_subdomain_owned), 0, 0, 1, 1},
35739  {&__pyx_n_s_variable_nb_local, __pyx_k_variable_nb_local, sizeof(__pyx_k_variable_nb_local), 0, 0, 1, 1},
35740  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
35741  {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
35742  {&__pyx_n_s_xx, __pyx_k_xx, sizeof(__pyx_k_xx), 0, 0, 1, 1},
35743  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
35744  {0, 0, 0, 0, 0, 0, 0}
35745 };
35746 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
35747  #if PY_MAJOR_VERSION >= 3
35748  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 51, __pyx_L1_error)
35749  #else
35750  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 51, __pyx_L1_error)
35751  #endif
35752  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 67, __pyx_L1_error)
35753  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 489, __pyx_L1_error)
35754  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
35755  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
35756  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
35757  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
35758  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
35759  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
35760  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
35761  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
35762  return 0;
35763  __pyx_L1_error:;
35764  return -1;
35765 }
35766 
35767 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
35768  __Pyx_RefNannyDeclarations
35769  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
35770 
35771  /* "mprans/cMoveMeshMonitor.pyx":31
35772  * self.cppPreStep(q_uOfX=pc.uOfXTatQuadrature,
35773  * q_J=pc.model.q['abs(det(J))'],
35774  * q_weights=pc.model.elementQuadratureWeights[('u', 0)], # <<<<<<<<<<<<<<
35775  * areas_=pc.areas,
35776  * q_rci=pc.model.q[('r', 0)],
35777  */
35778  __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_u, __pyx_int_0); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 31, __pyx_L1_error)
35779  __Pyx_GOTREF(__pyx_tuple_);
35780  __Pyx_GIVEREF(__pyx_tuple_);
35781 
35782  /* "mprans/cMoveMeshMonitor.pyx":33
35783  * q_weights=pc.model.elementQuadratureWeights[('u', 0)],
35784  * areas_=pc.areas,
35785  * q_rci=pc.model.q[('r', 0)], # <<<<<<<<<<<<<<
35786  * q_fci=pc.model.q[('f', 0)],
35787  * nElements_owned=pc.mesh.nElements_owned)
35788  */
35789  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_r, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 33, __pyx_L1_error)
35790  __Pyx_GOTREF(__pyx_tuple__2);
35791  __Pyx_GIVEREF(__pyx_tuple__2);
35792 
35793  /* "mprans/cMoveMeshMonitor.pyx":34
35794  * areas_=pc.areas,
35795  * q_rci=pc.model.q[('r', 0)],
35796  * q_fci=pc.model.q[('f', 0)], # <<<<<<<<<<<<<<
35797  * nElements_owned=pc.mesh.nElements_owned)
35798  *
35799  */
35800  __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_f, __pyx_int_0); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 34, __pyx_L1_error)
35801  __Pyx_GOTREF(__pyx_tuple__3);
35802  __Pyx_GIVEREF(__pyx_tuple__3);
35803 
35804  /* "mprans/cMoveMeshMonitor.pyx":212
35805  * logEvent("Pseudo-time stepping with dt={eps} ({t_min}<t<{t_max})".format(eps=eps, t_max=t_max, t_min=t_min),
35806  * level=3)
35807  * cdef double[:] t_range = np.linspace(t_min, t_max, int((t_max-t_min)/eps+1))[1:] # <<<<<<<<<<<<<<
35808  * cdef int ntimesteps = len(t_range)
35809  * cdef int[:] eN_phi = np.zeros(len(xx), dtype=np.int32)
35810  */
35811  __pyx_slice__4 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 212, __pyx_L1_error)
35812  __Pyx_GOTREF(__pyx_slice__4);
35813  __Pyx_GIVEREF(__pyx_slice__4);
35814 
35815  /* "mprans/cMoveMeshMonitor.pyx":351
35816  * # 13: fixed_dir[1]
35817  * # 14: fixed_dir[2]
35818  * coords_2rank[rank] = np.zeros((0, 15)) # <<<<<<<<<<<<<<
35819  * cdef double[:,:] coords_2doArray = np.zeros((0, 15))
35820  * # cdef int[:] solFound_2do
35821  */
35822  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_15); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 351, __pyx_L1_error)
35823  __Pyx_GOTREF(__pyx_tuple__5);
35824  __Pyx_GIVEREF(__pyx_tuple__5);
35825 
35826  /* "mprans/cMoveMeshMonitor.pyx":489
35827  * inside_eN = False
35828  * try:
35829  * raise AssertionError('did not find containing element! coords outside domain?') # <<<<<<<<<<<<<<
35830  * except AssertionError as exc:
35831  * print('Error: ', exc)
35832  */
35833  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_did_not_find_containing_element); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 489, __pyx_L1_error)
35834  __Pyx_GOTREF(__pyx_tuple__6);
35835  __Pyx_GIVEREF(__pyx_tuple__6);
35836 
35837  /* "mprans/cMoveMeshMonitor.pyx":689
35838  * inside_eN = False
35839  * try:
35840  * raise AssertionError('did not find containing element! coords outside domain??') # <<<<<<<<<<<<<<
35841  * except AssertionError as exc:
35842  * print('Error: ', exc)
35843  */
35844  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_did_not_find_containing_element_2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 689, __pyx_L1_error)
35845  __Pyx_GOTREF(__pyx_tuple__7);
35846  __Pyx_GIVEREF(__pyx_tuple__7);
35847 
35848  /* "(tree fragment)":2
35849  * def __reduce_cython__(self):
35850  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
35851  * def __setstate_cython__(self, __pyx_state):
35852  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
35853  */
35854  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 2, __pyx_L1_error)
35855  __Pyx_GOTREF(__pyx_tuple__8);
35856  __Pyx_GIVEREF(__pyx_tuple__8);
35857 
35858  /* "(tree fragment)":4
35859  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
35860  * def __setstate_cython__(self, __pyx_state):
35861  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
35862  */
35863  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 4, __pyx_L1_error)
35864  __Pyx_GOTREF(__pyx_tuple__9);
35865  __Pyx_GIVEREF(__pyx_tuple__9);
35866 
35867  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
35868  * __pyx_import_array()
35869  * except Exception:
35870  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
35871  *
35872  * cdef inline int import_umath() except -1:
35873  */
35874  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 945, __pyx_L1_error)
35875  __Pyx_GOTREF(__pyx_tuple__10);
35876  __Pyx_GIVEREF(__pyx_tuple__10);
35877 
35878  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
35879  * _import_umath()
35880  * except Exception:
35881  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
35882  *
35883  * cdef inline int import_ufunc() except -1:
35884  */
35885  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 951, __pyx_L1_error)
35886  __Pyx_GOTREF(__pyx_tuple__11);
35887  __Pyx_GIVEREF(__pyx_tuple__11);
35888 
35889  /* "View.MemoryView":133
35890  *
35891  * if not self.ndim:
35892  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
35893  *
35894  * if itemsize <= 0:
35895  */
35896  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 133, __pyx_L1_error)
35897  __Pyx_GOTREF(__pyx_tuple__12);
35898  __Pyx_GIVEREF(__pyx_tuple__12);
35899 
35900  /* "View.MemoryView":136
35901  *
35902  * if itemsize <= 0:
35903  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
35904  *
35905  * if not isinstance(format, bytes):
35906  */
35907  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 136, __pyx_L1_error)
35908  __Pyx_GOTREF(__pyx_tuple__13);
35909  __Pyx_GIVEREF(__pyx_tuple__13);
35910 
35911  /* "View.MemoryView":148
35912  *
35913  * if not self._shape:
35914  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
35915  *
35916  *
35917  */
35918  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 148, __pyx_L1_error)
35919  __Pyx_GOTREF(__pyx_tuple__14);
35920  __Pyx_GIVEREF(__pyx_tuple__14);
35921 
35922  /* "View.MemoryView":176
35923  * self.data = <char *>malloc(self.len)
35924  * if not self.data:
35925  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
35926  *
35927  * if self.dtype_is_object:
35928  */
35929  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 176, __pyx_L1_error)
35930  __Pyx_GOTREF(__pyx_tuple__15);
35931  __Pyx_GIVEREF(__pyx_tuple__15);
35932 
35933  /* "View.MemoryView":192
35934  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
35935  * if not (flags & bufmode):
35936  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
35937  * info.buf = self.data
35938  * info.len = self.len
35939  */
35940  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 192, __pyx_L1_error)
35941  __Pyx_GOTREF(__pyx_tuple__16);
35942  __Pyx_GIVEREF(__pyx_tuple__16);
35943 
35944  /* "(tree fragment)":2
35945  * def __reduce_cython__(self):
35946  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
35947  * def __setstate_cython__(self, __pyx_state):
35948  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
35949  */
35950  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 2, __pyx_L1_error)
35951  __Pyx_GOTREF(__pyx_tuple__17);
35952  __Pyx_GIVEREF(__pyx_tuple__17);
35953 
35954  /* "(tree fragment)":4
35955  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
35956  * def __setstate_cython__(self, __pyx_state):
35957  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
35958  */
35959  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 4, __pyx_L1_error)
35960  __Pyx_GOTREF(__pyx_tuple__18);
35961  __Pyx_GIVEREF(__pyx_tuple__18);
35962 
35963  /* "View.MemoryView":418
35964  * def __setitem__(memoryview self, object index, object value):
35965  * if self.view.readonly:
35966  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
35967  *
35968  * have_slices, index = _unellipsify(index, self.view.ndim)
35969  */
35970  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 418, __pyx_L1_error)
35971  __Pyx_GOTREF(__pyx_tuple__19);
35972  __Pyx_GIVEREF(__pyx_tuple__19);
35973 
35974  /* "View.MemoryView":495
35975  * result = struct.unpack(self.view.format, bytesitem)
35976  * except struct.error:
35977  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
35978  * else:
35979  * if len(self.view.format) == 1:
35980  */
35981  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 495, __pyx_L1_error)
35982  __Pyx_GOTREF(__pyx_tuple__20);
35983  __Pyx_GIVEREF(__pyx_tuple__20);
35984 
35985  /* "View.MemoryView":520
35986  * def __getbuffer__(self, Py_buffer *info, int flags):
35987  * if flags & PyBUF_WRITABLE and self.view.readonly:
35988  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
35989  *
35990  * if flags & PyBUF_ND:
35991  */
35992  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 520, __pyx_L1_error)
35993  __Pyx_GOTREF(__pyx_tuple__21);
35994  __Pyx_GIVEREF(__pyx_tuple__21);
35995 
35996  /* "View.MemoryView":570
35997  * if self.view.strides == NULL:
35998  *
35999  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
36000  *
36001  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
36002  */
36003  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 570, __pyx_L1_error)
36004  __Pyx_GOTREF(__pyx_tuple__22);
36005  __Pyx_GIVEREF(__pyx_tuple__22);
36006 
36007  /* "View.MemoryView":577
36008  * def suboffsets(self):
36009  * if self.view.suboffsets == NULL:
36010  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
36011  *
36012  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
36013  */
36014  __pyx_tuple__23 = PyTuple_New(1); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 577, __pyx_L1_error)
36015  __Pyx_GOTREF(__pyx_tuple__23);
36016  __Pyx_INCREF(__pyx_int_neg_1);
36017  __Pyx_GIVEREF(__pyx_int_neg_1);
36018  PyTuple_SET_ITEM(__pyx_tuple__23, 0, __pyx_int_neg_1);
36019  __Pyx_GIVEREF(__pyx_tuple__23);
36020 
36021  /* "(tree fragment)":2
36022  * def __reduce_cython__(self):
36023  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
36024  * def __setstate_cython__(self, __pyx_state):
36025  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
36026  */
36027  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 2, __pyx_L1_error)
36028  __Pyx_GOTREF(__pyx_tuple__24);
36029  __Pyx_GIVEREF(__pyx_tuple__24);
36030 
36031  /* "(tree fragment)":4
36032  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
36033  * def __setstate_cython__(self, __pyx_state):
36034  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
36035  */
36036  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 4, __pyx_L1_error)
36037  __Pyx_GOTREF(__pyx_tuple__25);
36038  __Pyx_GIVEREF(__pyx_tuple__25);
36039 
36040  /* "View.MemoryView":682
36041  * if item is Ellipsis:
36042  * if not seen_ellipsis:
36043  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
36044  * seen_ellipsis = True
36045  * else:
36046  */
36047  __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(1, 682, __pyx_L1_error)
36048  __Pyx_GOTREF(__pyx_slice__26);
36049  __Pyx_GIVEREF(__pyx_slice__26);
36050 
36051  /* "View.MemoryView":703
36052  * for suboffset in suboffsets[:ndim]:
36053  * if suboffset >= 0:
36054  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
36055  *
36056  *
36057  */
36058  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 703, __pyx_L1_error)
36059  __Pyx_GOTREF(__pyx_tuple__27);
36060  __Pyx_GIVEREF(__pyx_tuple__27);
36061 
36062  /* "(tree fragment)":2
36063  * def __reduce_cython__(self):
36064  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
36065  * def __setstate_cython__(self, __pyx_state):
36066  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
36067  */
36068  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 2, __pyx_L1_error)
36069  __Pyx_GOTREF(__pyx_tuple__28);
36070  __Pyx_GIVEREF(__pyx_tuple__28);
36071 
36072  /* "(tree fragment)":4
36073  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
36074  * def __setstate_cython__(self, __pyx_state):
36075  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
36076  */
36077  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 4, __pyx_L1_error)
36078  __Pyx_GOTREF(__pyx_tuple__29);
36079  __Pyx_GIVEREF(__pyx_tuple__29);
36080  __pyx_tuple__30 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 4, __pyx_L1_error)
36081  __Pyx_GOTREF(__pyx_tuple__30);
36082  __Pyx_GIVEREF(__pyx_tuple__30);
36083 
36084  /* "mprans/cMoveMeshMonitor.pyx":944
36085  * # self.uOfXTatQuadrature[e, k] = f
36086  *
36087  * def recoveryAtNodes(double[:] scalars, # <<<<<<<<<<<<<<
36088  * int[:] nodeElementsArray,
36089  * int[:] nodeElementOffsets):
36090  */
36091  __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_s_scalars, __pyx_n_s_nodeElementsArray, __pyx_n_s_nodeElementOffsets); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 944, __pyx_L1_error)
36092  __Pyx_GOTREF(__pyx_tuple__36);
36093  __Pyx_GIVEREF(__pyx_tuple__36);
36094  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_mprans_cMoveMeshMonitor, __pyx_n_s_recoveryAtNodes, 944, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 944, __pyx_L1_error)
36095 
36096  /* "mprans/cMoveMeshMonitor.pyx":971
36097  * return recovered_scalars
36098  *
36099  * def recoveryAtNodesWeighted(double[:] scalars, # <<<<<<<<<<<<<<
36100  * int[:] nodeElementsArray,
36101  * int[:] nodeElementOffsets,
36102  */
36103  __pyx_tuple__38 = PyTuple_Pack(5, __pyx_n_s_scalars, __pyx_n_s_nodeElementsArray, __pyx_n_s_nodeElementOffsets, __pyx_n_s_detJ_array, __pyx_n_s_nNodes); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 971, __pyx_L1_error)
36104  __Pyx_GOTREF(__pyx_tuple__38);
36105  __Pyx_GIVEREF(__pyx_tuple__38);
36106  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_mprans_cMoveMeshMonitor, __pyx_n_s_recoveryAtNodesWeighted, 971, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 971, __pyx_L1_error)
36107 
36108  /* "mprans/cMoveMeshMonitor.pyx":1012
36109  *
36110  *
36111  * def gradientRecoveryAtNodes(grads, # <<<<<<<<<<<<<<
36112  * nodeElementsArray,
36113  * nodeElementOffsets,
36114  */
36115  __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_grads, __pyx_n_s_nodeElementsArray, __pyx_n_s_nodeElementOffsets, __pyx_n_s_nd); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 1012, __pyx_L1_error)
36116  __Pyx_GOTREF(__pyx_tuple__40);
36117  __Pyx_GIVEREF(__pyx_tuple__40);
36118  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_mprans_cMoveMeshMonitor, __pyx_n_s_gradientRecoveryAtNodes, 1012, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 1012, __pyx_L1_error)
36119 
36120  /* "mprans/cMoveMeshMonitor.pyx":1046
36121  * return recovered_grads
36122  *
36123  * def gradientRecoveryAtNodesWeighted(double[:,:,:] grads, # <<<<<<<<<<<<<<
36124  * int[:] nodeElementsArray,
36125  * int[:] nodeElementOffsets,
36126  */
36127  __pyx_tuple__42 = PyTuple_Pack(5, __pyx_n_s_grads, __pyx_n_s_nodeElementsArray, __pyx_n_s_nodeElementOffsets, __pyx_n_s_detJ_array, __pyx_n_s_nd); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 1046, __pyx_L1_error)
36128  __Pyx_GOTREF(__pyx_tuple__42);
36129  __Pyx_GIVEREF(__pyx_tuple__42);
36130  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_mprans_cMoveMeshMonitor, __pyx_n_s_gradientRecoveryAtNodesWeighted, 1046, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 1046, __pyx_L1_error)
36131 
36132  /* "mprans/cMoveMeshMonitor.pyx":1171
36133  *
36134  *
36135  * def pyCheckOwnedVariable(int variable_nb_local, # <<<<<<<<<<<<<<
36136  * int rank,
36137  * int nVariables_owned,
36138  */
36139  __pyx_tuple__44 = PyTuple_Pack(5, __pyx_n_s_variable_nb_local, __pyx_n_s_rank, __pyx_n_s_nVariables_owned, __pyx_n_s_variableNumbering_subdomain2glob, __pyx_n_s_variableOffsets_subdomain_owned); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 1171, __pyx_L1_error)
36140  __Pyx_GOTREF(__pyx_tuple__44);
36141  __Pyx_GIVEREF(__pyx_tuple__44);
36142  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_mprans_cMoveMeshMonitor, __pyx_n_s_pyCheckOwnedVariable, 1171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 1171, __pyx_L1_error)
36143 
36144  /* "View.MemoryView":286
36145  * return self.name
36146  *
36147  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
36148  * cdef strided = Enum("<strided and direct>") # default
36149  * cdef indirect = Enum("<strided and indirect>")
36150  */
36151  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 286, __pyx_L1_error)
36152  __Pyx_GOTREF(__pyx_tuple__46);
36153  __Pyx_GIVEREF(__pyx_tuple__46);
36154 
36155  /* "View.MemoryView":287
36156  *
36157  * cdef generic = Enum("<strided and direct or indirect>")
36158  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
36159  * cdef indirect = Enum("<strided and indirect>")
36160  *
36161  */
36162  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 287, __pyx_L1_error)
36163  __Pyx_GOTREF(__pyx_tuple__47);
36164  __Pyx_GIVEREF(__pyx_tuple__47);
36165 
36166  /* "View.MemoryView":288
36167  * cdef generic = Enum("<strided and direct or indirect>")
36168  * cdef strided = Enum("<strided and direct>") # default
36169  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
36170  *
36171  *
36172  */
36173  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 288, __pyx_L1_error)
36174  __Pyx_GOTREF(__pyx_tuple__48);
36175  __Pyx_GIVEREF(__pyx_tuple__48);
36176 
36177  /* "View.MemoryView":291
36178  *
36179  *
36180  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
36181  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
36182  *
36183  */
36184  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 291, __pyx_L1_error)
36185  __Pyx_GOTREF(__pyx_tuple__49);
36186  __Pyx_GIVEREF(__pyx_tuple__49);
36187 
36188  /* "View.MemoryView":292
36189  *
36190  * cdef contiguous = Enum("<contiguous and direct>")
36191  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
36192  *
36193  *
36194  */
36195  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 292, __pyx_L1_error)
36196  __Pyx_GOTREF(__pyx_tuple__50);
36197  __Pyx_GIVEREF(__pyx_tuple__50);
36198 
36199  /* "(tree fragment)":1
36200  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
36201  * cdef object __pyx_PickleError
36202  * cdef object __pyx_result
36203  */
36204  __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 1, __pyx_L1_error)
36205  __Pyx_GOTREF(__pyx_tuple__51);
36206  __Pyx_GIVEREF(__pyx_tuple__51);
36207  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(1, 1, __pyx_L1_error)
36208  __Pyx_RefNannyFinishContext();
36209  return 0;
36210  __pyx_L1_error:;
36211  __Pyx_RefNannyFinishContext();
36212  return -1;
36213 }
36214 
36215 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
36216  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
36217  __pyx_float_0_ = PyFloat_FromDouble(0.); if (unlikely(!__pyx_float_0_)) __PYX_ERR(0, 1, __pyx_L1_error)
36218  __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) __PYX_ERR(0, 1, __pyx_L1_error)
36219  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
36220  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
36221  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
36222  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error)
36223  __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
36224  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
36225  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
36226  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
36227  return 0;
36228  __pyx_L1_error:;
36229  return -1;
36230 }
36231 
36232 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
36233 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
36234 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
36235 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
36236 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
36237 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
36238 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
36239 
36240 static int __Pyx_modinit_global_init_code(void) {
36241  __Pyx_RefNannyDeclarations
36242  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
36243  /*--- Global init code ---*/
36244  generic = Py_None; Py_INCREF(Py_None);
36245  strided = Py_None; Py_INCREF(Py_None);
36246  indirect = Py_None; Py_INCREF(Py_None);
36247  contiguous = Py_None; Py_INCREF(Py_None);
36248  indirect_contiguous = Py_None; Py_INCREF(Py_None);
36249  __Pyx_RefNannyFinishContext();
36250  return 0;
36251 }
36252 
36253 static int __Pyx_modinit_variable_export_code(void) {
36254  __Pyx_RefNannyDeclarations
36255  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
36256  /*--- Variable export code ---*/
36257  __Pyx_RefNannyFinishContext();
36258  return 0;
36259 }
36260 
36261 static int __Pyx_modinit_function_export_code(void) {
36262  __Pyx_RefNannyDeclarations
36263  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
36264  /*--- Function export code ---*/
36265  __Pyx_RefNannyFinishContext();
36266  return 0;
36267 }
36268 
36269 static int __Pyx_modinit_type_init_code(void) {
36270  __Pyx_RefNannyDeclarations
36271  int __pyx_lineno = 0;
36272  const char *__pyx_filename = NULL;
36273  int __pyx_clineno = 0;
36274  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
36275  /*--- Type init code ---*/
36276  __pyx_vtabptr_6mprans_16cMoveMeshMonitor_cCoefficients = &__pyx_vtable_6mprans_16cMoveMeshMonitor_cCoefficients;
36277  __pyx_vtable_6mprans_16cMoveMeshMonitor_cCoefficients.cppPreStep = (PyObject *(*)(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int))__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPreStep;
36278  __pyx_vtable_6mprans_16cMoveMeshMonitor_cCoefficients.cppPostStep = (PyObject *(*)(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *))__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPostStep;
36279  __pyx_vtable_6mprans_16cMoveMeshMonitor_cCoefficients.cppPseudoTimeSteppingParallel = (PyObject *(*)(struct __pyx_obj_6mprans_16cMoveMeshMonitor_cCoefficients *, __Pyx_memviewslice, double))__pyx_f_6mprans_16cMoveMeshMonitor_13cCoefficients_cppPseudoTimeSteppingParallel;
36280  if (PyType_Ready(&__pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
36281  #if PY_VERSION_HEX < 0x030800B1
36282  __pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients.tp_print = 0;
36283  #endif
36284  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients.tp_dictoffset && __pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients.tp_getattro == PyObject_GenericGetAttr)) {
36285  __pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36286  }
36287  if (__Pyx_SetVtable(__pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients.tp_dict, __pyx_vtabptr_6mprans_16cMoveMeshMonitor_cCoefficients) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
36288  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cCoefficients, (PyObject *)&__pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
36289  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
36290  __pyx_ptype_6mprans_16cMoveMeshMonitor_cCoefficients = &__pyx_type_6mprans_16cMoveMeshMonitor_cCoefficients;
36291  if (PyType_Ready(&__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
36292  #if PY_VERSION_HEX < 0x030800B1
36293  __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel.tp_print = 0;
36294  #endif
36295  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel.tp_dictoffset && __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel.tp_getattro == PyObject_GenericGetAttr)) {
36296  __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
36297  }
36298  __pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel = &__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct__cppPseudoTimeSteppingParallel;
36299  if (PyType_Ready(&__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
36300  #if PY_VERSION_HEX < 0x030800B1
36301  __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr.tp_print = 0;
36302  #endif
36303  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
36304  __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
36305  }
36306  __pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr = &__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_1_genexpr;
36307  if (PyType_Ready(&__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 598, __pyx_L1_error)
36308  #if PY_VERSION_HEX < 0x030800B1
36309  __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr.tp_print = 0;
36310  #endif
36311  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr.tp_dictoffset && __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
36312  __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
36313  }
36314  __pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr = &__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_2_genexpr;
36315  if (PyType_Ready(&__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 793, __pyx_L1_error)
36316  #if PY_VERSION_HEX < 0x030800B1
36317  __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr.tp_print = 0;
36318  #endif
36319  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr.tp_dictoffset && __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
36320  __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
36321  }
36322  __pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr = &__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_3_genexpr;
36323  if (PyType_Ready(&__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 794, __pyx_L1_error)
36324  #if PY_VERSION_HEX < 0x030800B1
36325  __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr.tp_print = 0;
36326  #endif
36327  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr.tp_dictoffset && __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
36328  __pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
36329  }
36330  __pyx_ptype_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr = &__pyx_type_6mprans_16cMoveMeshMonitor___pyx_scope_struct_4_genexpr;
36331  __pyx_vtabptr_array = &__pyx_vtable_array;
36332  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
36333  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
36334  #if PY_VERSION_HEX < 0x030800B1
36335  __pyx_type___pyx_array.tp_print = 0;
36336  #endif
36337  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
36338  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
36339  __pyx_array_type = &__pyx_type___pyx_array;
36340  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
36341  #if PY_VERSION_HEX < 0x030800B1
36342  __pyx_type___pyx_MemviewEnum.tp_print = 0;
36343  #endif
36344  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
36345  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36346  }
36347  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
36348  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
36349  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
36350  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
36351  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
36352  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
36353  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
36354  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
36355  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
36356  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
36357  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
36358  #if PY_VERSION_HEX < 0x030800B1
36359  __pyx_type___pyx_memoryview.tp_print = 0;
36360  #endif
36361  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
36362  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36363  }
36364  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
36365  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
36366  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
36367  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
36368  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
36369  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
36370  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
36371  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
36372  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
36373  #if PY_VERSION_HEX < 0x030800B1
36374  __pyx_type___pyx_memoryviewslice.tp_print = 0;
36375  #endif
36376  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
36377  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36378  }
36379  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
36380  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
36381  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
36382  __Pyx_RefNannyFinishContext();
36383  return 0;
36384  __pyx_L1_error:;
36385  __Pyx_RefNannyFinishContext();
36386  return -1;
36387 }
36388 
36389 static int __Pyx_modinit_type_import_code(void) {
36390  __Pyx_RefNannyDeclarations
36391  PyObject *__pyx_t_1 = NULL;
36392  int __pyx_lineno = 0;
36393  const char *__pyx_filename = NULL;
36394  int __pyx_clineno = 0;
36395  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
36396  /*--- Type import code ---*/
36397  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
36398  __Pyx_GOTREF(__pyx_t_1);
36399  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
36400  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
36401  sizeof(PyTypeObject),
36402  #else
36403  sizeof(PyHeapTypeObject),
36404  #endif
36405  __Pyx_ImportType_CheckSize_Warn);
36406  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
36407  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36408  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
36409  __Pyx_GOTREF(__pyx_t_1);
36410  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
36411  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
36412  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
36413  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
36414  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
36415  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
36416  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
36417  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
36418  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36419  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
36420  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36421  if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
36422  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36423  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
36424  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36425  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
36426  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36427  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
36428  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36429  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
36430  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36431  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
36432  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36433  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
36434  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36435  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
36436  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
36437  if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
36438  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
36439  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
36440  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36441  __Pyx_RefNannyFinishContext();
36442  return 0;
36443  __pyx_L1_error:;
36444  __Pyx_XDECREF(__pyx_t_1);
36445  __Pyx_RefNannyFinishContext();
36446  return -1;
36447 }
36448 
36449 static int __Pyx_modinit_variable_import_code(void) {
36450  __Pyx_RefNannyDeclarations
36451  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
36452  /*--- Variable import code ---*/
36453  __Pyx_RefNannyFinishContext();
36454  return 0;
36455 }
36456 
36457 static int __Pyx_modinit_function_import_code(void) {
36458  __Pyx_RefNannyDeclarations
36459  PyObject *__pyx_t_1 = NULL;
36460  int __pyx_lineno = 0;
36461  const char *__pyx_filename = NULL;
36462  int __pyx_clineno = 0;
36463  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
36464  /*--- Function import code ---*/
36465  __pyx_t_1 = PyImport_ImportModule("proteus.mprans.MeshSmoothing"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
36466  __Pyx_GOTREF(__pyx_t_1);
36467  if (__Pyx_ImportFunction(__pyx_t_1, "pyxGetLocalNearestNode", (void (**)(void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestNode, "int (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36468  if (__Pyx_ImportFunction(__pyx_t_1, "pyxGetLocalNearestElementIntersection", (void (**)(void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestElementIntersection, "__Pyx_memviewslice (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36469  if (__Pyx_ImportFunction(__pyx_t_1, "pyxGetLocalNearestElementAroundNode", (void (**)(void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxGetLocalNearestElementAroundNode, "int (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36470  if (__Pyx_ImportFunction(__pyx_t_1, "pyxUpdateElementBoundaryNormalsTetra", (void (**)(void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTetra, "void (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36471  if (__Pyx_ImportFunction(__pyx_t_1, "pyxUpdateElementBoundaryNormalsTriangle", (void (**)(void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_pyxUpdateElementBoundaryNormalsTriangle, "void (__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36472  if (__Pyx_ImportFunction(__pyx_t_1, "cyCheckOwnedVariable", (void (**)(void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_cyCheckOwnedVariable, "__Pyx_memviewslice (int, int, int, __Pyx_memviewslice, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36473  if (__Pyx_ImportFunction(__pyx_t_1, "cyGetGlobalVariable", (void (**)(void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_cyGetGlobalVariable, "__Pyx_memviewslice (int, int, __Pyx_memviewslice, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36474  if (__Pyx_ImportFunction(__pyx_t_1, "cyGetLocalVariable", (void (**)(void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_cyGetLocalVariable, "int (int, int, int, __Pyx_memviewslice, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36475  if (__Pyx_ImportFunction(__pyx_t_1, "cyFindBoundaryDirectionTriangle", (void (**)(void))&__pyx_f_7proteus_6mprans_13MeshSmoothing_cyFindBoundaryDirectionTriangle, "void (__Pyx_memviewslice, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36476  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36477  __Pyx_RefNannyFinishContext();
36478  return 0;
36479  __pyx_L1_error:;
36480  __Pyx_XDECREF(__pyx_t_1);
36481  __Pyx_RefNannyFinishContext();
36482  return -1;
36483 }
36484 
36485 
36486 #ifndef CYTHON_NO_PYINIT_EXPORT
36487 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
36488 #elif PY_MAJOR_VERSION < 3
36489 #ifdef __cplusplus
36490 #define __Pyx_PyMODINIT_FUNC extern "C" void
36491 #else
36492 #define __Pyx_PyMODINIT_FUNC void
36493 #endif
36494 #else
36495 #ifdef __cplusplus
36496 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
36497 #else
36498 #define __Pyx_PyMODINIT_FUNC PyObject *
36499 #endif
36500 #endif
36501 
36502 
36503 #if PY_MAJOR_VERSION < 3
36504 __Pyx_PyMODINIT_FUNC initcMoveMeshMonitor(void) CYTHON_SMALL_CODE; /*proto*/
36505 __Pyx_PyMODINIT_FUNC initcMoveMeshMonitor(void)
36506 #else
36507 __Pyx_PyMODINIT_FUNC PyInit_cMoveMeshMonitor(void) CYTHON_SMALL_CODE; /*proto*/
36508 __Pyx_PyMODINIT_FUNC PyInit_cMoveMeshMonitor(void)
36509 #if CYTHON_PEP489_MULTI_PHASE_INIT
36510 {
36511  return PyModuleDef_Init(&__pyx_moduledef);
36512 }
36513 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
36514  #if PY_VERSION_HEX >= 0x030700A1
36515  static PY_INT64_T main_interpreter_id = -1;
36516  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
36517  if (main_interpreter_id == -1) {
36518  main_interpreter_id = current_id;
36519  return (unlikely(current_id == -1)) ? -1 : 0;
36520  } else if (unlikely(main_interpreter_id != current_id))
36521  #else
36522  static PyInterpreterState *main_interpreter = NULL;
36523  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
36524  if (!main_interpreter) {
36525  main_interpreter = current_interpreter;
36526  } else if (unlikely(main_interpreter != current_interpreter))
36527  #endif
36528  {
36529  PyErr_SetString(
36530  PyExc_ImportError,
36531  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
36532  return -1;
36533  }
36534  return 0;
36535 }
36536 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
36537  PyObject *value = PyObject_GetAttrString(spec, from_name);
36538  int result = 0;
36539  if (likely(value)) {
36540  if (allow_none || value != Py_None) {
36541  result = PyDict_SetItemString(moddict, to_name, value);
36542  }
36543  Py_DECREF(value);
36544  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
36545  PyErr_Clear();
36546  } else {
36547  result = -1;
36548  }
36549  return result;
36550 }
36551 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
36552  PyObject *module = NULL, *moddict, *modname;
36553  if (__Pyx_check_single_interpreter())
36554  return NULL;
36555  if (__pyx_m)
36556  return __Pyx_NewRef(__pyx_m);
36557  modname = PyObject_GetAttrString(spec, "name");
36558  if (unlikely(!modname)) goto bad;
36559  module = PyModule_NewObject(modname);
36560  Py_DECREF(modname);
36561  if (unlikely(!module)) goto bad;
36562  moddict = PyModule_GetDict(module);
36563  if (unlikely(!moddict)) goto bad;
36564  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
36565  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
36566  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
36567  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
36568  return module;
36569 bad:
36570  Py_XDECREF(module);
36571  return NULL;
36572 }
36573 
36574 
36575 static CYTHON_SMALL_CODE int __pyx_pymod_exec_cMoveMeshMonitor(PyObject *__pyx_pyinit_module)
36576 #endif
36577 #endif
36578 {
36579  PyObject *__pyx_t_1 = NULL;
36580  PyObject *__pyx_t_2 = NULL;
36581  static PyThread_type_lock __pyx_t_3[8];
36582  int __pyx_lineno = 0;
36583  const char *__pyx_filename = NULL;
36584  int __pyx_clineno = 0;
36585  __Pyx_RefNannyDeclarations
36586  #if CYTHON_PEP489_MULTI_PHASE_INIT
36587  if (__pyx_m) {
36588  if (__pyx_m == __pyx_pyinit_module) return 0;
36589  PyErr_SetString(PyExc_RuntimeError, "Module 'cMoveMeshMonitor' has already been imported. Re-initialisation is not supported.");
36590  return -1;
36591  }
36592  #elif PY_MAJOR_VERSION >= 3
36593  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
36594  #endif
36595  #if CYTHON_REFNANNY
36596 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
36597 if (!__Pyx_RefNanny) {
36598  PyErr_Clear();
36599  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
36600  if (!__Pyx_RefNanny)
36601  Py_FatalError("failed to import 'refnanny' module");
36602 }
36603 #endif
36604  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cMoveMeshMonitor(void)", 0);
36605  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36606  #ifdef __Pxy_PyFrame_Initialize_Offsets
36607  __Pxy_PyFrame_Initialize_Offsets();
36608  #endif
36609  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
36610  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
36611  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
36612  #ifdef __Pyx_CyFunction_USED
36613  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36614  #endif
36615  #ifdef __Pyx_FusedFunction_USED
36616  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36617  #endif
36618  #ifdef __Pyx_Coroutine_USED
36619  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36620  #endif
36621  #ifdef __Pyx_Generator_USED
36622  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36623  #endif
36624  #ifdef __Pyx_AsyncGen_USED
36625  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36626  #endif
36627  #ifdef __Pyx_StopAsyncIteration_USED
36628  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36629  #endif
36630  /*--- Library function declarations ---*/
36631  /*--- Threads initialization code ---*/
36632  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
36633  PyEval_InitThreads();
36634  #endif
36635  /*--- Module creation code ---*/
36636  #if CYTHON_PEP489_MULTI_PHASE_INIT
36637  __pyx_m = __pyx_pyinit_module;
36638  Py_INCREF(__pyx_m);
36639  #else
36640  #if PY_MAJOR_VERSION < 3
36641  __pyx_m = Py_InitModule4("cMoveMeshMonitor", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
36642  #else
36643  __pyx_m = PyModule_Create(&__pyx_moduledef);
36644  #endif
36645  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
36646  #endif
36647  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
36648  Py_INCREF(__pyx_d);
36649  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
36650  Py_INCREF(__pyx_b);
36651  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
36652  Py_INCREF(__pyx_cython_runtime);
36653  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
36654  /*--- Initialize various global constants etc. ---*/
36655  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36656  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
36657  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36658  #endif
36659  if (__pyx_module_is_main_mprans__cMoveMeshMonitor) {
36660  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36661  }
36662  #if PY_MAJOR_VERSION >= 3
36663  {
36664  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
36665  if (!PyDict_GetItemString(modules, "mprans.cMoveMeshMonitor")) {
36666  if (unlikely(PyDict_SetItemString(modules, "mprans.cMoveMeshMonitor", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36667  }
36668  }
36669  #endif
36670  /*--- Builtin init code ---*/
36671  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36672  /*--- Constants init code ---*/
36673  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36674  /*--- Global type/function init code ---*/
36675  (void)__Pyx_modinit_global_init_code();
36676  (void)__Pyx_modinit_variable_export_code();
36677  (void)__Pyx_modinit_function_export_code();
36678  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36679  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36680  (void)__Pyx_modinit_variable_import_code();
36681  if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36682  /*--- Execution code ---*/
36683  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
36684  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36685  #endif
36686 
36687  /* "mprans/cMoveMeshMonitor.pyx":5
36688  *
36689  * cimport cython
36690  * import numpy as np # <<<<<<<<<<<<<<
36691  * cimport numpy as np
36692  * from libcpp cimport bool
36693  */
36694  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
36695  __Pyx_GOTREF(__pyx_t_1);
36696  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
36697  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36698 
36699  /* "mprans/cMoveMeshMonitor.pyx":8
36700  * cimport numpy as np
36701  * from libcpp cimport bool
36702  * from proteus.Profiling import logEvent # <<<<<<<<<<<<<<
36703  * from proteus.mprans import MeshSmoothing as ms
36704  * from proteus.mprans cimport MeshSmoothing as ms
36705  */
36706  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
36707  __Pyx_GOTREF(__pyx_t_1);
36708  __Pyx_INCREF(__pyx_n_s_logEvent);
36709  __Pyx_GIVEREF(__pyx_n_s_logEvent);
36710  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_logEvent);
36711  __pyx_t_2 = __Pyx_Import(__pyx_n_s_proteus_Profiling, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
36712  __Pyx_GOTREF(__pyx_t_2);
36713  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36714  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
36715  __Pyx_GOTREF(__pyx_t_1);
36716  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logEvent, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
36717  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36718  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36719 
36720  /* "mprans/cMoveMeshMonitor.pyx":9
36721  * from libcpp cimport bool
36722  * from proteus.Profiling import logEvent
36723  * from proteus.mprans import MeshSmoothing as ms # <<<<<<<<<<<<<<
36724  * from proteus.mprans cimport MeshSmoothing as ms
36725  * from proteus import Comm
36726  */
36727  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
36728  __Pyx_GOTREF(__pyx_t_2);
36729  __Pyx_INCREF(__pyx_n_s_MeshSmoothing);
36730  __Pyx_GIVEREF(__pyx_n_s_MeshSmoothing);
36731  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_MeshSmoothing);
36732  __pyx_t_1 = __Pyx_Import(__pyx_n_s_proteus_mprans, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
36733  __Pyx_GOTREF(__pyx_t_1);
36734  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36735  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_MeshSmoothing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
36736  __Pyx_GOTREF(__pyx_t_2);
36737  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ms, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
36738  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36739  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36740 
36741  /* "mprans/cMoveMeshMonitor.pyx":11
36742  * from proteus.mprans import MeshSmoothing as ms
36743  * from proteus.mprans cimport MeshSmoothing as ms
36744  * from proteus import Comm # <<<<<<<<<<<<<<
36745  * from mpi4py import MPI
36746  *
36747  */
36748  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
36749  __Pyx_GOTREF(__pyx_t_1);
36750  __Pyx_INCREF(__pyx_n_s_Comm);
36751  __Pyx_GIVEREF(__pyx_n_s_Comm);
36752  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Comm);
36753  __pyx_t_2 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
36754  __Pyx_GOTREF(__pyx_t_2);
36755  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36756  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Comm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
36757  __Pyx_GOTREF(__pyx_t_1);
36758  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Comm, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
36759  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36760  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36761 
36762  /* "mprans/cMoveMeshMonitor.pyx":12
36763  * from proteus.mprans cimport MeshSmoothing as ms
36764  * from proteus import Comm
36765  * from mpi4py import MPI # <<<<<<<<<<<<<<
36766  *
36767  *
36768  */
36769  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
36770  __Pyx_GOTREF(__pyx_t_2);
36771  __Pyx_INCREF(__pyx_n_s_MPI);
36772  __Pyx_GIVEREF(__pyx_n_s_MPI);
36773  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_MPI);
36774  __pyx_t_1 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
36775  __Pyx_GOTREF(__pyx_t_1);
36776  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36777  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_MPI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
36778  __Pyx_GOTREF(__pyx_t_2);
36779  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPI, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
36780  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36781  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36782 
36783  /* "mprans/cMoveMeshMonitor.pyx":944
36784  * # self.uOfXTatQuadrature[e, k] = f
36785  *
36786  * def recoveryAtNodes(double[:] scalars, # <<<<<<<<<<<<<<
36787  * int[:] nodeElementsArray,
36788  * int[:] nodeElementOffsets):
36789  */
36790  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6mprans_16cMoveMeshMonitor_1recoveryAtNodes, NULL, __pyx_n_s_mprans_cMoveMeshMonitor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
36791  __Pyx_GOTREF(__pyx_t_1);
36792  if (PyDict_SetItem(__pyx_d, __pyx_n_s_recoveryAtNodes, __pyx_t_1) < 0) __PYX_ERR(0, 944, __pyx_L1_error)
36793  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36794 
36795  /* "mprans/cMoveMeshMonitor.pyx":971
36796  * return recovered_scalars
36797  *
36798  * def recoveryAtNodesWeighted(double[:] scalars, # <<<<<<<<<<<<<<
36799  * int[:] nodeElementsArray,
36800  * int[:] nodeElementOffsets,
36801  */
36802  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6mprans_16cMoveMeshMonitor_3recoveryAtNodesWeighted, NULL, __pyx_n_s_mprans_cMoveMeshMonitor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error)
36803  __Pyx_GOTREF(__pyx_t_1);
36804  if (PyDict_SetItem(__pyx_d, __pyx_n_s_recoveryAtNodesWeighted, __pyx_t_1) < 0) __PYX_ERR(0, 971, __pyx_L1_error)
36805  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36806 
36807  /* "mprans/cMoveMeshMonitor.pyx":1012
36808  *
36809  *
36810  * def gradientRecoveryAtNodes(grads, # <<<<<<<<<<<<<<
36811  * nodeElementsArray,
36812  * nodeElementOffsets,
36813  */
36814  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6mprans_16cMoveMeshMonitor_5gradientRecoveryAtNodes, NULL, __pyx_n_s_mprans_cMoveMeshMonitor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error)
36815  __Pyx_GOTREF(__pyx_t_1);
36816  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gradientRecoveryAtNodes, __pyx_t_1) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
36817  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36818 
36819  /* "mprans/cMoveMeshMonitor.pyx":1046
36820  * return recovered_grads
36821  *
36822  * def gradientRecoveryAtNodesWeighted(double[:,:,:] grads, # <<<<<<<<<<<<<<
36823  * int[:] nodeElementsArray,
36824  * int[:] nodeElementOffsets,
36825  */
36826  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6mprans_16cMoveMeshMonitor_7gradientRecoveryAtNodesWeighted, NULL, __pyx_n_s_mprans_cMoveMeshMonitor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error)
36827  __Pyx_GOTREF(__pyx_t_1);
36828  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gradientRecoveryAtNodesWeighted, __pyx_t_1) < 0) __PYX_ERR(0, 1046, __pyx_L1_error)
36829  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36830 
36831  /* "mprans/cMoveMeshMonitor.pyx":1171
36832  *
36833  *
36834  * def pyCheckOwnedVariable(int variable_nb_local, # <<<<<<<<<<<<<<
36835  * int rank,
36836  * int nVariables_owned,
36837  */
36838  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6mprans_16cMoveMeshMonitor_9pyCheckOwnedVariable, NULL, __pyx_n_s_mprans_cMoveMeshMonitor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __pyx_L1_error)
36839  __Pyx_GOTREF(__pyx_t_1);
36840  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyCheckOwnedVariable, __pyx_t_1) < 0) __PYX_ERR(0, 1171, __pyx_L1_error)
36841  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36842 
36843  /* "mprans/cMoveMeshMonitor.pyx":1
36844  * #!python # <<<<<<<<<<<<<<
36845  * #cython: wraparound=True, boundscheck=False, initializedcheck=False, cdivision=True
36846  *
36847  */
36848  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
36849  __Pyx_GOTREF(__pyx_t_1);
36850  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36851  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36852 
36853  /* "View.MemoryView":209
36854  * info.obj = self
36855  *
36856  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
36857  *
36858  * def __dealloc__(array self):
36859  */
36860  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
36861  __Pyx_GOTREF(__pyx_t_1);
36862  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
36863  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36864  PyType_Modified(__pyx_array_type);
36865 
36866  /* "View.MemoryView":286
36867  * return self.name
36868  *
36869  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
36870  * cdef strided = Enum("<strided and direct>") # default
36871  * cdef indirect = Enum("<strided and indirect>")
36872  */
36873  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
36874  __Pyx_GOTREF(__pyx_t_1);
36875  __Pyx_XGOTREF(generic);
36876  __Pyx_DECREF_SET(generic, __pyx_t_1);
36877  __Pyx_GIVEREF(__pyx_t_1);
36878  __pyx_t_1 = 0;
36879 
36880  /* "View.MemoryView":287
36881  *
36882  * cdef generic = Enum("<strided and direct or indirect>")
36883  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
36884  * cdef indirect = Enum("<strided and indirect>")
36885  *
36886  */
36887  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
36888  __Pyx_GOTREF(__pyx_t_1);
36889  __Pyx_XGOTREF(strided);
36890  __Pyx_DECREF_SET(strided, __pyx_t_1);
36891  __Pyx_GIVEREF(__pyx_t_1);
36892  __pyx_t_1 = 0;
36893 
36894  /* "View.MemoryView":288
36895  * cdef generic = Enum("<strided and direct or indirect>")
36896  * cdef strided = Enum("<strided and direct>") # default
36897  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
36898  *
36899  *
36900  */
36901  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
36902  __Pyx_GOTREF(__pyx_t_1);
36903  __Pyx_XGOTREF(indirect);
36904  __Pyx_DECREF_SET(indirect, __pyx_t_1);
36905  __Pyx_GIVEREF(__pyx_t_1);
36906  __pyx_t_1 = 0;
36907 
36908  /* "View.MemoryView":291
36909  *
36910  *
36911  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
36912  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
36913  *
36914  */
36915  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
36916  __Pyx_GOTREF(__pyx_t_1);
36917  __Pyx_XGOTREF(contiguous);
36918  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
36919  __Pyx_GIVEREF(__pyx_t_1);
36920  __pyx_t_1 = 0;
36921 
36922  /* "View.MemoryView":292
36923  *
36924  * cdef contiguous = Enum("<contiguous and direct>")
36925  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
36926  *
36927  *
36928  */
36929  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
36930  __Pyx_GOTREF(__pyx_t_1);
36931  __Pyx_XGOTREF(indirect_contiguous);
36932  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
36933  __Pyx_GIVEREF(__pyx_t_1);
36934  __pyx_t_1 = 0;
36935 
36936  /* "View.MemoryView":316
36937  *
36938  * DEF THREAD_LOCKS_PREALLOCATED = 8
36939  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
36940  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
36941  * PyThread_allocate_lock(),
36942  */
36943  __pyx_memoryview_thread_locks_used = 0;
36944 
36945  /* "View.MemoryView":317
36946  * DEF THREAD_LOCKS_PREALLOCATED = 8
36947  * cdef int __pyx_memoryview_thread_locks_used = 0
36948  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
36949  * PyThread_allocate_lock(),
36950  * PyThread_allocate_lock(),
36951  */
36952  __pyx_t_3[0] = PyThread_allocate_lock();
36953  __pyx_t_3[1] = PyThread_allocate_lock();
36954  __pyx_t_3[2] = PyThread_allocate_lock();
36955  __pyx_t_3[3] = PyThread_allocate_lock();
36956  __pyx_t_3[4] = PyThread_allocate_lock();
36957  __pyx_t_3[5] = PyThread_allocate_lock();
36958  __pyx_t_3[6] = PyThread_allocate_lock();
36959  __pyx_t_3[7] = PyThread_allocate_lock();
36960  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
36961 
36962  /* "View.MemoryView":549
36963  * info.obj = self
36964  *
36965  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
36966  *
36967  *
36968  */
36969  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
36970  __Pyx_GOTREF(__pyx_t_1);
36971  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
36972  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36973  PyType_Modified(__pyx_memoryview_type);
36974 
36975  /* "View.MemoryView":995
36976  * return self.from_object
36977  *
36978  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
36979  *
36980  *
36981  */
36982  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
36983  __Pyx_GOTREF(__pyx_t_1);
36984  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
36985  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36986  PyType_Modified(__pyx_memoryviewslice_type);
36987 
36988  /* "(tree fragment)":1
36989  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
36990  * cdef object __pyx_PickleError
36991  * cdef object __pyx_result
36992  */
36993  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
36994  __Pyx_GOTREF(__pyx_t_1);
36995  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
36996  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36997 
36998  /* "BufferFormatFromTypeInfo":1463
36999  *
37000  * @cname('__pyx_format_from_typeinfo')
37001  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
37002  * cdef __Pyx_StructField *field
37003  * cdef __pyx_typeinfo_string fmt
37004  */
37005 
37006  /*--- Wrapped vars code ---*/
37007 
37008  goto __pyx_L0;
37009  __pyx_L1_error:;
37010  __Pyx_XDECREF(__pyx_t_1);
37011  __Pyx_XDECREF(__pyx_t_2);
37012  if (__pyx_m) {
37013  if (__pyx_d) {
37014  __Pyx_AddTraceback("init mprans.cMoveMeshMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
37015  }
37016  Py_CLEAR(__pyx_m);
37017  } else if (!PyErr_Occurred()) {
37018  PyErr_SetString(PyExc_ImportError, "init mprans.cMoveMeshMonitor");
37019  }
37020  __pyx_L0:;
37021  __Pyx_RefNannyFinishContext();
37022  #if CYTHON_PEP489_MULTI_PHASE_INIT
37023  return (__pyx_m != NULL) ? 0 : -1;
37024  #elif PY_MAJOR_VERSION >= 3
37025  return __pyx_m;
37026  #else
37027  return;
37028  #endif
37029 }
37030 
37031 /* --- Runtime support code --- */
37032 /* Refnanny */
37033 #if CYTHON_REFNANNY
37034 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
37035  PyObject *m = NULL, *p = NULL;
37036  void *r = NULL;
37037  m = PyImport_ImportModule(modname);
37038  if (!m) goto end;
37039  p = PyObject_GetAttrString(m, "RefNannyAPI");
37040  if (!p) goto end;
37041  r = PyLong_AsVoidPtr(p);
37042 end:
37043  Py_XDECREF(p);
37044  Py_XDECREF(m);
37045  return (__Pyx_RefNannyAPIStruct *)r;
37046 }
37047 #endif
37048 
37049 /* PyObjectGetAttrStr */
37050 #if CYTHON_USE_TYPE_SLOTS
37051 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
37052  PyTypeObject* tp = Py_TYPE(obj);
37053  if (likely(tp->tp_getattro))
37054  return tp->tp_getattro(obj, attr_name);
37055 #if PY_MAJOR_VERSION < 3
37056  if (likely(tp->tp_getattr))
37057  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
37058 #endif
37059  return PyObject_GetAttr(obj, attr_name);
37060 }
37061 #endif
37062 
37063 /* GetBuiltinName */
37064 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
37065  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
37066  if (unlikely(!result)) {
37067  PyErr_Format(PyExc_NameError,
37068 #if PY_MAJOR_VERSION >= 3
37069  "name '%U' is not defined", name);
37070 #else
37071  "name '%.200s' is not defined", PyString_AS_STRING(name));
37072 #endif
37073  }
37074  return result;
37075 }
37076 
37077 /* RaiseArgTupleInvalid */
37078 static void __Pyx_RaiseArgtupleInvalid(
37079  const char* func_name,
37080  int exact,
37081  Py_ssize_t num_min,
37082  Py_ssize_t num_max,
37083  Py_ssize_t num_found)
37084 {
37085  Py_ssize_t num_expected;
37086  const char *more_or_less;
37087  if (num_found < num_min) {
37088  num_expected = num_min;
37089  more_or_less = "at least";
37090  } else {
37091  num_expected = num_max;
37092  more_or_less = "at most";
37093  }
37094  if (exact) {
37095  more_or_less = "exactly";
37096  }
37097  PyErr_Format(PyExc_TypeError,
37098  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
37099  func_name, more_or_less, num_expected,
37100  (num_expected == 1) ? "" : "s", num_found);
37101 }
37102 
37103 /* KeywordStringCheck */
37104 static int __Pyx_CheckKeywordStrings(
37105  PyObject *kwdict,
37106  const char* function_name,
37107  int kw_allowed)
37108 {
37109  PyObject* key = 0;
37110  Py_ssize_t pos = 0;
37111 #if CYTHON_COMPILING_IN_PYPY
37112  if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
37113  goto invalid_keyword;
37114  return 1;
37115 #else
37116  while (PyDict_Next(kwdict, &pos, &key, 0)) {
37117  #if PY_MAJOR_VERSION < 3
37118  if (unlikely(!PyString_Check(key)))
37119  #endif
37120  if (unlikely(!PyUnicode_Check(key)))
37121  goto invalid_keyword_type;
37122  }
37123  if ((!kw_allowed) && unlikely(key))
37124  goto invalid_keyword;
37125  return 1;
37126 invalid_keyword_type:
37127  PyErr_Format(PyExc_TypeError,
37128  "%.200s() keywords must be strings", function_name);
37129  return 0;
37130 #endif
37131 invalid_keyword:
37132  PyErr_Format(PyExc_TypeError,
37133  #if PY_MAJOR_VERSION < 3
37134  "%.200s() got an unexpected keyword argument '%.200s'",
37135  function_name, PyString_AsString(key));
37136  #else
37137  "%s() got an unexpected keyword argument '%U'",
37138  function_name, key);
37139  #endif
37140  return 0;
37141 }
37142 
37143 /* DictGetItem */
37144 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
37145 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
37146  PyObject *value;
37147  value = PyDict_GetItemWithError(d, key);
37148  if (unlikely(!value)) {
37149  if (!PyErr_Occurred()) {
37150  if (unlikely(PyTuple_Check(key))) {
37151  PyObject* args = PyTuple_Pack(1, key);
37152  if (likely(args)) {
37153  PyErr_SetObject(PyExc_KeyError, args);
37154  Py_DECREF(args);
37155  }
37156  } else {
37157  PyErr_SetObject(PyExc_KeyError, key);
37158  }
37159  }
37160  return NULL;
37161  }
37162  Py_INCREF(value);
37163  return value;
37164 }
37165 #endif
37166 
37167 /* GetItemInt */
37168 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
37169  PyObject *r;
37170  if (!j) return NULL;
37171  r = PyObject_GetItem(o, j);
37172  Py_DECREF(j);
37173  return r;
37174 }
37175 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
37176  CYTHON_NCP_UNUSED int wraparound,
37177  CYTHON_NCP_UNUSED int boundscheck) {
37178 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37179  Py_ssize_t wrapped_i = i;
37180  if (wraparound & unlikely(i < 0)) {
37181  wrapped_i += PyList_GET_SIZE(o);
37182  }
37183  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
37184  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
37185  Py_INCREF(r);
37186  return r;
37187  }
37188  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
37189 #else
37190  return PySequence_GetItem(o, i);
37191 #endif
37192 }
37193 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
37194  CYTHON_NCP_UNUSED int wraparound,
37195  CYTHON_NCP_UNUSED int boundscheck) {
37196 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37197  Py_ssize_t wrapped_i = i;
37198  if (wraparound & unlikely(i < 0)) {
37199  wrapped_i += PyTuple_GET_SIZE(o);
37200  }
37201  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
37202  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
37203  Py_INCREF(r);
37204  return r;
37205  }
37206  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
37207 #else
37208  return PySequence_GetItem(o, i);
37209 #endif
37210 }
37211 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
37212  CYTHON_NCP_UNUSED int wraparound,
37213  CYTHON_NCP_UNUSED int boundscheck) {
37214 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
37215  if (is_list || PyList_CheckExact(o)) {
37216  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
37217  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
37218  PyObject *r = PyList_GET_ITEM(o, n);
37219  Py_INCREF(r);
37220  return r;
37221  }
37222  }
37223  else if (PyTuple_CheckExact(o)) {
37224  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
37225  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
37226  PyObject *r = PyTuple_GET_ITEM(o, n);
37227  Py_INCREF(r);
37228  return r;
37229  }
37230  } else {
37231  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
37232  if (likely(m && m->sq_item)) {
37233  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
37234  Py_ssize_t l = m->sq_length(o);
37235  if (likely(l >= 0)) {
37236  i += l;
37237  } else {
37238  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
37239  return NULL;
37240  PyErr_Clear();
37241  }
37242  }
37243  return m->sq_item(o, i);
37244  }
37245  }
37246 #else
37247  if (is_list || PySequence_Check(o)) {
37248  return PySequence_GetItem(o, i);
37249  }
37250 #endif
37251  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
37252 }
37253 
37254 /* ObjectGetItem */
37255 #if CYTHON_USE_TYPE_SLOTS
37256 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
37257  PyObject *runerr;
37258  Py_ssize_t key_value;
37259  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
37260  if (unlikely(!(m && m->sq_item))) {
37261  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
37262  return NULL;
37263  }
37264  key_value = __Pyx_PyIndex_AsSsize_t(index);
37265  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
37266  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
37267  }
37268  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
37269  PyErr_Clear();
37270  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
37271  }
37272  return NULL;
37273 }
37274 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
37275  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
37276  if (likely(m && m->mp_subscript)) {
37277  return m->mp_subscript(obj, key);
37278  }
37279  return __Pyx_PyObject_GetIndex(obj, key);
37280 }
37281 #endif
37282 
37283 /* MemviewSliceInit */
37284 static int
37285 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
37286  int ndim,
37287  __Pyx_memviewslice *memviewslice,
37288  int memview_is_new_reference)
37289 {
37290  __Pyx_RefNannyDeclarations
37291  int i, retval=-1;
37292  Py_buffer *buf = &memview->view;
37293  __Pyx_RefNannySetupContext("init_memviewslice", 0);
37294  if (unlikely(memviewslice->memview || memviewslice->data)) {
37295  PyErr_SetString(PyExc_ValueError,
37296  "memviewslice is already initialized!");
37297  goto fail;
37298  }
37299  if (buf->strides) {
37300  for (i = 0; i < ndim; i++) {
37301  memviewslice->strides[i] = buf->strides[i];
37302  }
37303  } else {
37304  Py_ssize_t stride = buf->itemsize;
37305  for (i = ndim - 1; i >= 0; i--) {
37306  memviewslice->strides[i] = stride;
37307  stride *= buf->shape[i];
37308  }
37309  }
37310  for (i = 0; i < ndim; i++) {
37311  memviewslice->shape[i] = buf->shape[i];
37312  if (buf->suboffsets) {
37313  memviewslice->suboffsets[i] = buf->suboffsets[i];
37314  } else {
37315  memviewslice->suboffsets[i] = -1;
37316  }
37317  }
37318  memviewslice->memview = memview;
37319  memviewslice->data = (char *)buf->buf;
37320  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
37321  Py_INCREF(memview);
37322  }
37323  retval = 0;
37324  goto no_fail;
37325 fail:
37326  memviewslice->memview = 0;
37327  memviewslice->data = 0;
37328  retval = -1;
37329 no_fail:
37330  __Pyx_RefNannyFinishContext();
37331  return retval;
37332 }
37333 #ifndef Py_NO_RETURN
37334 #define Py_NO_RETURN
37335 #endif
37336 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
37337  va_list vargs;
37338  char msg[200];
37339 #ifdef HAVE_STDARG_PROTOTYPES
37340  va_start(vargs, fmt);
37341 #else
37342  va_start(vargs);
37343 #endif
37344  vsnprintf(msg, 200, fmt, vargs);
37345  va_end(vargs);
37346  Py_FatalError(msg);
37347 }
37348 static CYTHON_INLINE int
37349 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
37350  PyThread_type_lock lock)
37351 {
37352  int result;
37353  PyThread_acquire_lock(lock, 1);
37354  result = (*acquisition_count)++;
37355  PyThread_release_lock(lock);
37356  return result;
37357 }
37358 static CYTHON_INLINE int
37359 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
37360  PyThread_type_lock lock)
37361 {
37362  int result;
37363  PyThread_acquire_lock(lock, 1);
37364  result = (*acquisition_count)--;
37365  PyThread_release_lock(lock);
37366  return result;
37367 }
37368 static CYTHON_INLINE void
37369 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
37370 {
37371  int first_time;
37372  struct __pyx_memoryview_obj *memview = memslice->memview;
37373  if (unlikely(!memview || (PyObject *) memview == Py_None))
37374  return;
37375  if (unlikely(__pyx_get_slice_count(memview) < 0))
37376  __pyx_fatalerror("Acquisition count is %d (line %d)",
37377  __pyx_get_slice_count(memview), lineno);
37378  first_time = __pyx_add_acquisition_count(memview) == 0;
37379  if (unlikely(first_time)) {
37380  if (have_gil) {
37381  Py_INCREF((PyObject *) memview);
37382  } else {
37383  PyGILState_STATE _gilstate = PyGILState_Ensure();
37384  Py_INCREF((PyObject *) memview);
37385  PyGILState_Release(_gilstate);
37386  }
37387  }
37388 }
37389 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
37390  int have_gil, int lineno) {
37391  int last_time;
37392  struct __pyx_memoryview_obj *memview = memslice->memview;
37393  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
37394  memslice->memview = NULL;
37395  return;
37396  }
37397  if (unlikely(__pyx_get_slice_count(memview) <= 0))
37398  __pyx_fatalerror("Acquisition count is %d (line %d)",
37399  __pyx_get_slice_count(memview), lineno);
37400  last_time = __pyx_sub_acquisition_count(memview) == 1;
37401  memslice->data = NULL;
37402  if (unlikely(last_time)) {
37403  if (have_gil) {
37404  Py_CLEAR(memslice->memview);
37405  } else {
37406  PyGILState_STATE _gilstate = PyGILState_Ensure();
37407  Py_CLEAR(memslice->memview);
37408  PyGILState_Release(_gilstate);
37409  }
37410  } else {
37411  memslice->memview = NULL;
37412  }
37413 }
37414 
37415 /* PyDictVersioning */
37416 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
37417 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
37418  PyObject *dict = Py_TYPE(obj)->tp_dict;
37419  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
37420 }
37421 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
37422  PyObject **dictptr = NULL;
37423  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
37424  if (offset) {
37425 #if CYTHON_COMPILING_IN_CPYTHON
37426  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
37427 #else
37428  dictptr = _PyObject_GetDictPtr(obj);
37429 #endif
37430  }
37431  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
37432 }
37433 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
37434  PyObject *dict = Py_TYPE(obj)->tp_dict;
37435  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
37436  return 0;
37437  return obj_dict_version == __Pyx_get_object_dict_version(obj);
37438 }
37439 #endif
37440 
37441 /* GetModuleGlobalName */
37442 #if CYTHON_USE_DICT_VERSIONS
37443 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
37444 #else
37445 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
37446 #endif
37447 {
37448  PyObject *result;
37449 #if !CYTHON_AVOID_BORROWED_REFS
37450 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
37451  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
37452  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
37453  if (likely(result)) {
37454  return __Pyx_NewRef(result);
37455  } else if (unlikely(PyErr_Occurred())) {
37456  return NULL;
37457  }
37458 #else
37459  result = PyDict_GetItem(__pyx_d, name);
37460  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
37461  if (likely(result)) {
37462  return __Pyx_NewRef(result);
37463  }
37464 #endif
37465 #else
37466  result = PyObject_GetItem(__pyx_d, name);
37467  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
37468  if (likely(result)) {
37469  return __Pyx_NewRef(result);
37470  }
37471  PyErr_Clear();
37472 #endif
37473  return __Pyx_GetBuiltinName(name);
37474 }
37475 
37476 /* PyFunctionFastCall */
37477 #if CYTHON_FAST_PYCALL
37478 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
37479  PyObject *globals) {
37480  PyFrameObject *f;
37481  PyThreadState *tstate = __Pyx_PyThreadState_Current;
37482  PyObject **fastlocals;
37483  Py_ssize_t i;
37484  PyObject *result;
37485  assert(globals != NULL);
37486  /* XXX Perhaps we should create a specialized
37487  PyFrame_New() that doesn't take locals, but does
37488  take builtins without sanity checking them.
37489  */
37490  assert(tstate != NULL);
37491  f = PyFrame_New(tstate, co, globals, NULL);
37492  if (f == NULL) {
37493  return NULL;
37494  }
37495  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
37496  for (i = 0; i < na; i++) {
37497  Py_INCREF(*args);
37498  fastlocals[i] = *args++;
37499  }
37500  result = PyEval_EvalFrameEx(f,0);
37501  ++tstate->recursion_depth;
37502  Py_DECREF(f);
37503  --tstate->recursion_depth;
37504  return result;
37505 }
37506 #if 1 || PY_VERSION_HEX < 0x030600B1
37507 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
37508  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
37509  PyObject *globals = PyFunction_GET_GLOBALS(func);
37510  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
37511  PyObject *closure;
37512 #if PY_MAJOR_VERSION >= 3
37513  PyObject *kwdefs;
37514 #endif
37515  PyObject *kwtuple, **k;
37516  PyObject **d;
37517  Py_ssize_t nd;
37518  Py_ssize_t nk;
37519  PyObject *result;
37520  assert(kwargs == NULL || PyDict_Check(kwargs));
37521  nk = kwargs ? PyDict_Size(kwargs) : 0;
37522  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
37523  return NULL;
37524  }
37525  if (
37526 #if PY_MAJOR_VERSION >= 3
37527  co->co_kwonlyargcount == 0 &&
37528 #endif
37529  likely(kwargs == NULL || nk == 0) &&
37530  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
37531  if (argdefs == NULL && co->co_argcount == nargs) {
37532  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
37533  goto done;
37534  }
37535  else if (nargs == 0 && argdefs != NULL
37536  && co->co_argcount == Py_SIZE(argdefs)) {
37537  /* function called with no arguments, but all parameters have
37538  a default value: use default values as arguments .*/
37539  args = &PyTuple_GET_ITEM(argdefs, 0);
37540  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
37541  goto done;
37542  }
37543  }
37544  if (kwargs != NULL) {
37545  Py_ssize_t pos, i;
37546  kwtuple = PyTuple_New(2 * nk);
37547  if (kwtuple == NULL) {
37548  result = NULL;
37549  goto done;
37550  }
37551  k = &PyTuple_GET_ITEM(kwtuple, 0);
37552  pos = i = 0;
37553  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
37554  Py_INCREF(k[i]);
37555  Py_INCREF(k[i+1]);
37556  i += 2;
37557  }
37558  nk = i / 2;
37559  }
37560  else {
37561  kwtuple = NULL;
37562  k = NULL;
37563  }
37564  closure = PyFunction_GET_CLOSURE(func);
37565 #if PY_MAJOR_VERSION >= 3
37566  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
37567 #endif
37568  if (argdefs != NULL) {
37569  d = &PyTuple_GET_ITEM(argdefs, 0);
37570  nd = Py_SIZE(argdefs);
37571  }
37572  else {
37573  d = NULL;
37574  nd = 0;
37575  }
37576 #if PY_MAJOR_VERSION >= 3
37577  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
37578  args, (int)nargs,
37579  k, (int)nk,
37580  d, (int)nd, kwdefs, closure);
37581 #else
37582  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
37583  args, (int)nargs,
37584  k, (int)nk,
37585  d, (int)nd, closure);
37586 #endif
37587  Py_XDECREF(kwtuple);
37588 done:
37589  Py_LeaveRecursiveCall();
37590  return result;
37591 }
37592 #endif
37593 #endif
37594 
37595 /* PyObjectCall */
37596 #if CYTHON_COMPILING_IN_CPYTHON
37597 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
37598  PyObject *result;
37599  ternaryfunc call = Py_TYPE(func)->tp_call;
37600  if (unlikely(!call))
37601  return PyObject_Call(func, arg, kw);
37602  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
37603  return NULL;
37604  result = (*call)(func, arg, kw);
37605  Py_LeaveRecursiveCall();
37606  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
37607  PyErr_SetString(
37608  PyExc_SystemError,
37609  "NULL result without error in PyObject_Call");
37610  }
37611  return result;
37612 }
37613 #endif
37614 
37615 /* PyObjectCallMethO */
37616 #if CYTHON_COMPILING_IN_CPYTHON
37617 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
37618  PyObject *self, *result;
37619  PyCFunction cfunc;
37620  cfunc = PyCFunction_GET_FUNCTION(func);
37621  self = PyCFunction_GET_SELF(func);
37622  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
37623  return NULL;
37624  result = cfunc(self, arg);
37625  Py_LeaveRecursiveCall();
37626  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
37627  PyErr_SetString(
37628  PyExc_SystemError,
37629  "NULL result without error in PyObject_Call");
37630  }
37631  return result;
37632 }
37633 #endif
37634 
37635 /* PyObjectCallNoArg */
37636 #if CYTHON_COMPILING_IN_CPYTHON
37637 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
37638 #if CYTHON_FAST_PYCALL
37639  if (PyFunction_Check(func)) {
37640  return __Pyx_PyFunction_FastCall(func, NULL, 0);
37641  }
37642 #endif
37643 #ifdef __Pyx_CyFunction_USED
37644  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
37645 #else
37646  if (likely(PyCFunction_Check(func)))
37647 #endif
37648  {
37649  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
37650  return __Pyx_PyObject_CallMethO(func, NULL);
37651  }
37652  }
37653  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
37654 }
37655 #endif
37656 
37657 /* PyCFunctionFastCall */
37658 #if CYTHON_FAST_PYCCALL
37659 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
37660  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
37661  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
37662  PyObject *self = PyCFunction_GET_SELF(func);
37663  int flags = PyCFunction_GET_FLAGS(func);
37664  assert(PyCFunction_Check(func));
37665  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
37666  assert(nargs >= 0);
37667  assert(nargs == 0 || args != NULL);
37668  /* _PyCFunction_FastCallDict() must not be called with an exception set,
37669  because it may clear it (directly or indirectly) and so the
37670  caller loses its exception */
37671  assert(!PyErr_Occurred());
37672  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
37673  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
37674  } else {
37675  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
37676  }
37677 }
37678 #endif
37679 
37680 /* PyObjectCallOneArg */
37681 #if CYTHON_COMPILING_IN_CPYTHON
37682 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
37683  PyObject *result;
37684  PyObject *args = PyTuple_New(1);
37685  if (unlikely(!args)) return NULL;
37686  Py_INCREF(arg);
37687  PyTuple_SET_ITEM(args, 0, arg);
37688  result = __Pyx_PyObject_Call(func, args, NULL);
37689  Py_DECREF(args);
37690  return result;
37691 }
37692 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
37693 #if CYTHON_FAST_PYCALL
37694  if (PyFunction_Check(func)) {
37695  return __Pyx_PyFunction_FastCall(func, &arg, 1);
37696  }
37697 #endif
37698  if (likely(PyCFunction_Check(func))) {
37699  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
37700  return __Pyx_PyObject_CallMethO(func, arg);
37701 #if CYTHON_FAST_PYCCALL
37702  } else if (__Pyx_PyFastCFunction_Check(func)) {
37703  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
37704 #endif
37705  }
37706  }
37707  return __Pyx__PyObject_CallOneArg(func, arg);
37708 }
37709 #else
37710 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
37711  PyObject *result;
37712  PyObject *args = PyTuple_Pack(1, arg);
37713  if (unlikely(!args)) return NULL;
37714  result = __Pyx_PyObject_Call(func, args, NULL);
37715  Py_DECREF(args);
37716  return result;
37717 }
37718 #endif
37719 
37720 /* RaiseDoubleKeywords */
37721 static void __Pyx_RaiseDoubleKeywordsError(
37722  const char* func_name,
37723  PyObject* kw_name)
37724 {
37725  PyErr_Format(PyExc_TypeError,
37726  #if PY_MAJOR_VERSION >= 3
37727  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
37728  #else
37729  "%s() got multiple values for keyword argument '%s'", func_name,
37730  PyString_AsString(kw_name));
37731  #endif
37732 }
37733 
37734 /* ParseKeywords */
37735 static int __Pyx_ParseOptionalKeywords(
37736  PyObject *kwds,
37737  PyObject **argnames[],
37738  PyObject *kwds2,
37739  PyObject *values[],
37740  Py_ssize_t num_pos_args,
37741  const char* function_name)
37742 {
37743  PyObject *key = 0, *value = 0;
37744  Py_ssize_t pos = 0;
37745  PyObject*** name;
37746  PyObject*** first_kw_arg = argnames + num_pos_args;
37747  while (PyDict_Next(kwds, &pos, &key, &value)) {
37748  name = first_kw_arg;
37749  while (*name && (**name != key)) name++;
37750  if (*name) {
37751  values[name-argnames] = value;
37752  continue;
37753  }
37754  name = first_kw_arg;
37755  #if PY_MAJOR_VERSION < 3
37756  if (likely(PyString_Check(key))) {
37757  while (*name) {
37758  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
37759  && _PyString_Eq(**name, key)) {
37760  values[name-argnames] = value;
37761  break;
37762  }
37763  name++;
37764  }
37765  if (*name) continue;
37766  else {
37767  PyObject*** argname = argnames;
37768  while (argname != first_kw_arg) {
37769  if ((**argname == key) || (
37770  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
37771  && _PyString_Eq(**argname, key))) {
37772  goto arg_passed_twice;
37773  }
37774  argname++;
37775  }
37776  }
37777  } else
37778  #endif
37779  if (likely(PyUnicode_Check(key))) {
37780  while (*name) {
37781  int cmp = (**name == key) ? 0 :
37782  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
37783  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
37784  #endif
37785  PyUnicode_Compare(**name, key);
37786  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
37787  if (cmp == 0) {
37788  values[name-argnames] = value;
37789  break;
37790  }
37791  name++;
37792  }
37793  if (*name) continue;
37794  else {
37795  PyObject*** argname = argnames;
37796  while (argname != first_kw_arg) {
37797  int cmp = (**argname == key) ? 0 :
37798  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
37799  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
37800  #endif
37801  PyUnicode_Compare(**argname, key);
37802  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
37803  if (cmp == 0) goto arg_passed_twice;
37804  argname++;
37805  }
37806  }
37807  } else
37808  goto invalid_keyword_type;
37809  if (kwds2) {
37810  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
37811  } else {
37812  goto invalid_keyword;
37813  }
37814  }
37815  return 0;
37816 arg_passed_twice:
37817  __Pyx_RaiseDoubleKeywordsError(function_name, key);
37818  goto bad;
37819 invalid_keyword_type:
37820  PyErr_Format(PyExc_TypeError,
37821  "%.200s() keywords must be strings", function_name);
37822  goto bad;
37823 invalid_keyword:
37824  PyErr_Format(PyExc_TypeError,
37825  #if PY_MAJOR_VERSION < 3
37826  "%.200s() got an unexpected keyword argument '%.200s'",
37827  function_name, PyString_AsString(key));
37828  #else
37829  "%s() got an unexpected keyword argument '%U'",
37830  function_name, key);
37831  #endif
37832 bad:
37833  return -1;
37834 }
37835 
37836 /* PyIntFromDouble */
37837 #if PY_MAJOR_VERSION < 3
37838 static CYTHON_INLINE PyObject* __Pyx_PyInt_FromDouble(double value) {
37839  if (value >= (double)LONG_MIN && value <= (double)LONG_MAX) {
37840  return PyInt_FromLong((long)value);
37841  }
37842  return PyLong_FromDouble(value);
37843 }
37844 #endif
37845 
37846 /* SliceObject */
37847 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
37848  Py_ssize_t cstart, Py_ssize_t cstop,
37849  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
37850  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
37851 #if CYTHON_USE_TYPE_SLOTS
37852  PyMappingMethods* mp;
37853 #if PY_MAJOR_VERSION < 3
37854  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
37855  if (likely(ms && ms->sq_slice)) {
37856  if (!has_cstart) {
37857  if (_py_start && (*_py_start != Py_None)) {
37858  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
37859  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
37860  } else
37861  cstart = 0;
37862  }
37863  if (!has_cstop) {
37864  if (_py_stop && (*_py_stop != Py_None)) {
37865  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
37866  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
37867  } else
37868  cstop = PY_SSIZE_T_MAX;
37869  }
37870  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
37871  Py_ssize_t l = ms->sq_length(obj);
37872  if (likely(l >= 0)) {
37873  if (cstop < 0) {
37874  cstop += l;
37875  if (cstop < 0) cstop = 0;
37876  }
37877  if (cstart < 0) {
37878  cstart += l;
37879  if (cstart < 0) cstart = 0;
37880  }
37881  } else {
37882  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
37883  goto bad;
37884  PyErr_Clear();
37885  }
37886  }
37887  return ms->sq_slice(obj, cstart, cstop);
37888  }
37889 #endif
37890  mp = Py_TYPE(obj)->tp_as_mapping;
37891  if (likely(mp && mp->mp_subscript))
37892 #endif
37893  {
37894  PyObject* result;
37895  PyObject *py_slice, *py_start, *py_stop;
37896  if (_py_slice) {
37897  py_slice = *_py_slice;
37898  } else {
37899  PyObject* owned_start = NULL;
37900  PyObject* owned_stop = NULL;
37901  if (_py_start) {
37902  py_start = *_py_start;
37903  } else {
37904  if (has_cstart) {
37905  owned_start = py_start = PyInt_FromSsize_t(cstart);
37906  if (unlikely(!py_start)) goto bad;
37907  } else
37908  py_start = Py_None;
37909  }
37910  if (_py_stop) {
37911  py_stop = *_py_stop;
37912  } else {
37913  if (has_cstop) {
37914  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
37915  if (unlikely(!py_stop)) {
37916  Py_XDECREF(owned_start);
37917  goto bad;
37918  }
37919  } else
37920  py_stop = Py_None;
37921  }
37922  py_slice = PySlice_New(py_start, py_stop, Py_None);
37923  Py_XDECREF(owned_start);
37924  Py_XDECREF(owned_stop);
37925  if (unlikely(!py_slice)) goto bad;
37926  }
37927 #if CYTHON_USE_TYPE_SLOTS
37928  result = mp->mp_subscript(obj, py_slice);
37929 #else
37930  result = PyObject_GetItem(obj, py_slice);
37931 #endif
37932  if (!_py_slice) {
37933  Py_DECREF(py_slice);
37934  }
37935  return result;
37936  }
37937  PyErr_Format(PyExc_TypeError,
37938  "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
37939 bad:
37940  return NULL;
37941 }
37942 
37943 /* PyObjectCall2Args */
37944 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
37945  PyObject *args, *result = NULL;
37946  #if CYTHON_FAST_PYCALL
37947  if (PyFunction_Check(function)) {
37948  PyObject *args[2] = {arg1, arg2};
37949  return __Pyx_PyFunction_FastCall(function, args, 2);
37950  }
37951  #endif
37952  #if CYTHON_FAST_PYCCALL
37953  if (__Pyx_PyFastCFunction_Check(function)) {
37954  PyObject *args[2] = {arg1, arg2};
37955  return __Pyx_PyCFunction_FastCall(function, args, 2);
37956  }
37957  #endif
37958  args = PyTuple_New(2);
37959  if (unlikely(!args)) goto done;
37960  Py_INCREF(arg1);
37961  PyTuple_SET_ITEM(args, 0, arg1);
37962  Py_INCREF(arg2);
37963  PyTuple_SET_ITEM(args, 1, arg2);
37964  Py_INCREF(function);
37965  result = __Pyx_PyObject_Call(function, args, NULL);
37966  Py_DECREF(args);
37967  Py_DECREF(function);
37968 done:
37969  return result;
37970 }
37971 
37972 /* PyErrFetchRestore */
37973 #if CYTHON_FAST_THREAD_STATE
37974 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
37975  PyObject *tmp_type, *tmp_value, *tmp_tb;
37976  tmp_type = tstate->curexc_type;
37977  tmp_value = tstate->curexc_value;
37978  tmp_tb = tstate->curexc_traceback;
37979  tstate->curexc_type = type;
37980  tstate->curexc_value = value;
37981  tstate->curexc_traceback = tb;
37982  Py_XDECREF(tmp_type);
37983  Py_XDECREF(tmp_value);
37984  Py_XDECREF(tmp_tb);
37985 }
37986 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
37987  *type = tstate->curexc_type;
37988  *value = tstate->curexc_value;
37989  *tb = tstate->curexc_traceback;
37990  tstate->curexc_type = 0;
37991  tstate->curexc_value = 0;
37992  tstate->curexc_traceback = 0;
37993 }
37994 #endif
37995 
37996 /* RaiseException */
37997 #if PY_MAJOR_VERSION < 3
37998 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
37999  CYTHON_UNUSED PyObject *cause) {
38000  __Pyx_PyThreadState_declare
38001  Py_XINCREF(type);
38002  if (!value || value == Py_None)
38003  value = NULL;
38004  else
38005  Py_INCREF(value);
38006  if (!tb || tb == Py_None)
38007  tb = NULL;
38008  else {
38009  Py_INCREF(tb);
38010  if (!PyTraceBack_Check(tb)) {
38011  PyErr_SetString(PyExc_TypeError,
38012  "raise: arg 3 must be a traceback or None");
38013  goto raise_error;
38014  }
38015  }
38016  if (PyType_Check(type)) {
38017 #if CYTHON_COMPILING_IN_PYPY
38018  if (!value) {
38019  Py_INCREF(Py_None);
38020  value = Py_None;
38021  }
38022 #endif
38023  PyErr_NormalizeException(&type, &value, &tb);
38024  } else {
38025  if (value) {
38026  PyErr_SetString(PyExc_TypeError,
38027  "instance exception may not have a separate value");
38028  goto raise_error;
38029  }
38030  value = type;
38031  type = (PyObject*) Py_TYPE(type);
38032  Py_INCREF(type);
38033  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
38034  PyErr_SetString(PyExc_TypeError,
38035  "raise: exception class must be a subclass of BaseException");
38036  goto raise_error;
38037  }
38038  }
38039  __Pyx_PyThreadState_assign
38040  __Pyx_ErrRestore(type, value, tb);
38041  return;
38042 raise_error:
38043  Py_XDECREF(value);
38044  Py_XDECREF(type);
38045  Py_XDECREF(tb);
38046  return;
38047 }
38048 #else
38049 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
38050  PyObject* owned_instance = NULL;
38051  if (tb == Py_None) {
38052  tb = 0;
38053  } else if (tb && !PyTraceBack_Check(tb)) {
38054  PyErr_SetString(PyExc_TypeError,
38055  "raise: arg 3 must be a traceback or None");
38056  goto bad;
38057  }
38058  if (value == Py_None)
38059  value = 0;
38060  if (PyExceptionInstance_Check(type)) {
38061  if (value) {
38062  PyErr_SetString(PyExc_TypeError,
38063  "instance exception may not have a separate value");
38064  goto bad;
38065  }
38066  value = type;
38067  type = (PyObject*) Py_TYPE(value);
38068  } else if (PyExceptionClass_Check(type)) {
38069  PyObject *instance_class = NULL;
38070  if (value && PyExceptionInstance_Check(value)) {
38071  instance_class = (PyObject*) Py_TYPE(value);
38072  if (instance_class != type) {
38073  int is_subclass = PyObject_IsSubclass(instance_class, type);
38074  if (!is_subclass) {
38075  instance_class = NULL;
38076  } else if (unlikely(is_subclass == -1)) {
38077  goto bad;
38078  } else {
38079  type = instance_class;
38080  }
38081  }
38082  }
38083  if (!instance_class) {
38084  PyObject *args;
38085  if (!value)
38086  args = PyTuple_New(0);
38087  else if (PyTuple_Check(value)) {
38088  Py_INCREF(value);
38089  args = value;
38090  } else
38091  args = PyTuple_Pack(1, value);
38092  if (!args)
38093  goto bad;
38094  owned_instance = PyObject_Call(type, args, NULL);
38095  Py_DECREF(args);
38096  if (!owned_instance)
38097  goto bad;
38098  value = owned_instance;
38099  if (!PyExceptionInstance_Check(value)) {
38100  PyErr_Format(PyExc_TypeError,
38101  "calling %R should have returned an instance of "
38102  "BaseException, not %R",
38103  type, Py_TYPE(value));
38104  goto bad;
38105  }
38106  }
38107  } else {
38108  PyErr_SetString(PyExc_TypeError,
38109  "raise: exception class must be a subclass of BaseException");
38110  goto bad;
38111  }
38112  if (cause) {
38113  PyObject *fixed_cause;
38114  if (cause == Py_None) {
38115  fixed_cause = NULL;
38116  } else if (PyExceptionClass_Check(cause)) {
38117  fixed_cause = PyObject_CallObject(cause, NULL);
38118  if (fixed_cause == NULL)
38119  goto bad;
38120  } else if (PyExceptionInstance_Check(cause)) {
38121  fixed_cause = cause;
38122  Py_INCREF(fixed_cause);
38123  } else {
38124  PyErr_SetString(PyExc_TypeError,
38125  "exception causes must derive from "
38126  "BaseException");
38127  goto bad;
38128  }
38129  PyException_SetCause(value, fixed_cause);
38130  }
38131  PyErr_SetObject(type, value);
38132  if (tb) {
38133 #if CYTHON_COMPILING_IN_PYPY
38134  PyObject *tmp_type, *tmp_value, *tmp_tb;
38135  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
38136  Py_INCREF(tb);
38137  PyErr_Restore(tmp_type, tmp_value, tb);
38138  Py_XDECREF(tmp_tb);
38139 #else
38140  PyThreadState *tstate = __Pyx_PyThreadState_Current;
38141  PyObject* tmp_tb = tstate->curexc_traceback;
38142  if (tb != tmp_tb) {
38143  Py_INCREF(tb);
38144  tstate->curexc_traceback = tb;
38145  Py_XDECREF(tmp_tb);
38146  }
38147 #endif
38148  }
38149 bad:
38150  Py_XDECREF(owned_instance);
38151  return;
38152 }
38153 #endif
38154 
38155 /* GetTopmostException */
38156 #if CYTHON_USE_EXC_INFO_STACK
38157 static _PyErr_StackItem *
38158 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
38159 {
38160  _PyErr_StackItem *exc_info = tstate->exc_info;
38161  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
38162  exc_info->previous_item != NULL)
38163  {
38164  exc_info = exc_info->previous_item;
38165  }
38166  return exc_info;
38167 }
38168 #endif
38169 
38170 /* SaveResetException */
38171 #if CYTHON_FAST_THREAD_STATE
38172 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
38173  #if CYTHON_USE_EXC_INFO_STACK
38174  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
38175  *type = exc_info->exc_type;
38176  *value = exc_info->exc_value;
38177  *tb = exc_info->exc_traceback;
38178  #else
38179  *type = tstate->exc_type;
38180  *value = tstate->exc_value;
38181  *tb = tstate->exc_traceback;
38182  #endif
38183  Py_XINCREF(*type);
38184  Py_XINCREF(*value);
38185  Py_XINCREF(*tb);
38186 }
38187 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
38188  PyObject *tmp_type, *tmp_value, *tmp_tb;
38189  #if CYTHON_USE_EXC_INFO_STACK
38190  _PyErr_StackItem *exc_info = tstate->exc_info;
38191  tmp_type = exc_info->exc_type;
38192  tmp_value = exc_info->exc_value;
38193  tmp_tb = exc_info->exc_traceback;
38194  exc_info->exc_type = type;
38195  exc_info->exc_value = value;
38196  exc_info->exc_traceback = tb;
38197  #else
38198  tmp_type = tstate->exc_type;
38199  tmp_value = tstate->exc_value;
38200  tmp_tb = tstate->exc_traceback;
38201  tstate->exc_type = type;
38202  tstate->exc_value = value;
38203  tstate->exc_traceback = tb;
38204  #endif
38205  Py_XDECREF(tmp_type);
38206  Py_XDECREF(tmp_value);
38207  Py_XDECREF(tmp_tb);
38208 }
38209 #endif
38210 
38211 /* PyErrExceptionMatches */
38212 #if CYTHON_FAST_THREAD_STATE
38213 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
38214  Py_ssize_t i, n;
38215  n = PyTuple_GET_SIZE(tuple);
38216 #if PY_MAJOR_VERSION >= 3
38217  for (i=0; i<n; i++) {
38218  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
38219  }
38220 #endif
38221  for (i=0; i<n; i++) {
38222  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
38223  }
38224  return 0;
38225 }
38226 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
38227  PyObject *exc_type = tstate->curexc_type;
38228  if (exc_type == err) return 1;
38229  if (unlikely(!exc_type)) return 0;
38230  if (unlikely(PyTuple_Check(err)))
38231  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
38232  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
38233 }
38234 #endif
38235 
38236 /* GetException */
38237 #if CYTHON_FAST_THREAD_STATE
38238 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
38239 #else
38240 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
38241 #endif
38242 {
38243  PyObject *local_type, *local_value, *local_tb;
38244 #if CYTHON_FAST_THREAD_STATE
38245  PyObject *tmp_type, *tmp_value, *tmp_tb;
38246  local_type = tstate->curexc_type;
38247  local_value = tstate->curexc_value;
38248  local_tb = tstate->curexc_traceback;
38249  tstate->curexc_type = 0;
38250  tstate->curexc_value = 0;
38251  tstate->curexc_traceback = 0;
38252 #else
38253  PyErr_Fetch(&local_type, &local_value, &local_tb);
38254 #endif
38255  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
38256 #if CYTHON_FAST_THREAD_STATE
38257  if (unlikely(tstate->curexc_type))
38258 #else
38259  if (unlikely(PyErr_Occurred()))
38260 #endif
38261  goto bad;
38262  #if PY_MAJOR_VERSION >= 3
38263  if (local_tb) {
38264  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
38265  goto bad;
38266  }
38267  #endif
38268  Py_XINCREF(local_tb);
38269  Py_XINCREF(local_type);
38270  Py_XINCREF(local_value);
38271  *type = local_type;
38272  *value = local_value;
38273  *tb = local_tb;
38274 #if CYTHON_FAST_THREAD_STATE
38275  #if CYTHON_USE_EXC_INFO_STACK
38276  {
38277  _PyErr_StackItem *exc_info = tstate->exc_info;
38278  tmp_type = exc_info->exc_type;
38279  tmp_value = exc_info->exc_value;
38280  tmp_tb = exc_info->exc_traceback;
38281  exc_info->exc_type = local_type;
38282  exc_info->exc_value = local_value;
38283  exc_info->exc_traceback = local_tb;
38284  }
38285  #else
38286  tmp_type = tstate->exc_type;
38287  tmp_value = tstate->exc_value;
38288  tmp_tb = tstate->exc_traceback;
38289  tstate->exc_type = local_type;
38290  tstate->exc_value = local_value;
38291  tstate->exc_traceback = local_tb;
38292  #endif
38293  Py_XDECREF(tmp_type);
38294  Py_XDECREF(tmp_value);
38295  Py_XDECREF(tmp_tb);
38296 #else
38297  PyErr_SetExcInfo(local_type, local_value, local_tb);
38298 #endif
38299  return 0;
38300 bad:
38301  *type = 0;
38302  *value = 0;
38303  *tb = 0;
38304  Py_XDECREF(local_type);
38305  Py_XDECREF(local_value);
38306  Py_XDECREF(local_tb);
38307  return -1;
38308 }
38309 
38310 /* PyIntBinop */
38311 #if !CYTHON_COMPILING_IN_PYPY
38312 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
38313  (void)inplace;
38314  (void)zerodivision_check;
38315  #if PY_MAJOR_VERSION < 3
38316  if (likely(PyInt_CheckExact(op1))) {
38317  const long b = intval;
38318  long x;
38319  long a = PyInt_AS_LONG(op1);
38320  x = (long)((unsigned long)a - b);
38321  if (likely((x^a) >= 0 || (x^~b) >= 0))
38322  return PyInt_FromLong(x);
38323  return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
38324  }
38325  #endif
38326  #if CYTHON_USE_PYLONG_INTERNALS
38327  if (likely(PyLong_CheckExact(op1))) {
38328  const long b = intval;
38329  long a, x;
38330 #ifdef HAVE_LONG_LONG
38331  const PY_LONG_LONG llb = intval;
38332  PY_LONG_LONG lla, llx;
38333 #endif
38334  const digit* digits = ((PyLongObject*)op1)->ob_digit;
38335  const Py_ssize_t size = Py_SIZE(op1);
38336  if (likely(__Pyx_sst_abs(size) <= 1)) {
38337  a = likely(size) ? digits[0] : 0;
38338  if (size == -1) a = -a;
38339  } else {
38340  switch (size) {
38341  case -2:
38342  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
38343  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38344  break;
38345 #ifdef HAVE_LONG_LONG
38346  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
38347  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
38348  goto long_long;
38349 #endif
38350  }
38351  CYTHON_FALLTHROUGH;
38352  case 2:
38353  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
38354  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38355  break;
38356 #ifdef HAVE_LONG_LONG
38357  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
38358  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
38359  goto long_long;
38360 #endif
38361  }
38362  CYTHON_FALLTHROUGH;
38363  case -3:
38364  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
38365  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38366  break;
38367 #ifdef HAVE_LONG_LONG
38368  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
38369  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
38370  goto long_long;
38371 #endif
38372  }
38373  CYTHON_FALLTHROUGH;
38374  case 3:
38375  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
38376  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38377  break;
38378 #ifdef HAVE_LONG_LONG
38379  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
38380  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
38381  goto long_long;
38382 #endif
38383  }
38384  CYTHON_FALLTHROUGH;
38385  case -4:
38386  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
38387  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38388  break;
38389 #ifdef HAVE_LONG_LONG
38390  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
38391  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
38392  goto long_long;
38393 #endif
38394  }
38395  CYTHON_FALLTHROUGH;
38396  case 4:
38397  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
38398  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38399  break;
38400 #ifdef HAVE_LONG_LONG
38401  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
38402  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
38403  goto long_long;
38404 #endif
38405  }
38406  CYTHON_FALLTHROUGH;
38407  default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
38408  }
38409  }
38410  x = a - b;
38411  return PyLong_FromLong(x);
38412 #ifdef HAVE_LONG_LONG
38413  long_long:
38414  llx = lla - llb;
38415  return PyLong_FromLongLong(llx);
38416 #endif
38417 
38418 
38419  }
38420  #endif
38421  if (PyFloat_CheckExact(op1)) {
38422  const long b = intval;
38423  double a = PyFloat_AS_DOUBLE(op1);
38424  double result;
38425  PyFPE_START_PROTECT("subtract", return NULL)
38426  result = ((double)a) - (double)b;
38427  PyFPE_END_PROTECT(result)
38428  return PyFloat_FromDouble(result);
38429  }
38430  return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
38431 }
38432 #endif
38433 
38434 /* SliceObject */
38435 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
38436  Py_ssize_t cstart, Py_ssize_t cstop,
38437  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
38438  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
38439 #if CYTHON_USE_TYPE_SLOTS
38440  PyMappingMethods* mp;
38441 #if PY_MAJOR_VERSION < 3
38442  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
38443  if (likely(ms && ms->sq_ass_slice)) {
38444  if (!has_cstart) {
38445  if (_py_start && (*_py_start != Py_None)) {
38446  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
38447  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
38448  } else
38449  cstart = 0;
38450  }
38451  if (!has_cstop) {
38452  if (_py_stop && (*_py_stop != Py_None)) {
38453  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
38454  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
38455  } else
38456  cstop = PY_SSIZE_T_MAX;
38457  }
38458  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
38459  Py_ssize_t l = ms->sq_length(obj);
38460  if (likely(l >= 0)) {
38461  if (cstop < 0) {
38462  cstop += l;
38463  if (cstop < 0) cstop = 0;
38464  }
38465  if (cstart < 0) {
38466  cstart += l;
38467  if (cstart < 0) cstart = 0;
38468  }
38469  } else {
38470  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
38471  goto bad;
38472  PyErr_Clear();
38473  }
38474  }
38475  return ms->sq_ass_slice(obj, cstart, cstop, value);
38476  }
38477 #endif
38478  mp = Py_TYPE(obj)->tp_as_mapping;
38479  if (likely(mp && mp->mp_ass_subscript))
38480 #endif
38481  {
38482  int result;
38483  PyObject *py_slice, *py_start, *py_stop;
38484  if (_py_slice) {
38485  py_slice = *_py_slice;
38486  } else {
38487  PyObject* owned_start = NULL;
38488  PyObject* owned_stop = NULL;
38489  if (_py_start) {
38490  py_start = *_py_start;
38491  } else {
38492  if (has_cstart) {
38493  owned_start = py_start = PyInt_FromSsize_t(cstart);
38494  if (unlikely(!py_start)) goto bad;
38495  } else
38496  py_start = Py_None;
38497  }
38498  if (_py_stop) {
38499  py_stop = *_py_stop;
38500  } else {
38501  if (has_cstop) {
38502  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
38503  if (unlikely(!py_stop)) {
38504  Py_XDECREF(owned_start);
38505  goto bad;
38506  }
38507  } else
38508  py_stop = Py_None;
38509  }
38510  py_slice = PySlice_New(py_start, py_stop, Py_None);
38511  Py_XDECREF(owned_start);
38512  Py_XDECREF(owned_stop);
38513  if (unlikely(!py_slice)) goto bad;
38514  }
38515 #if CYTHON_USE_TYPE_SLOTS
38516  result = mp->mp_ass_subscript(obj, py_slice, value);
38517 #else
38518  result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
38519 #endif
38520  if (!_py_slice) {
38521  Py_DECREF(py_slice);
38522  }
38523  return result;
38524  }
38525  PyErr_Format(PyExc_TypeError,
38526  "'%.200s' object does not support slice %.10s",
38527  Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
38528 bad:
38529  return -1;
38530 }
38531 
38532 /* PyIntCompare */
38533 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
38534  if (op1 == op2) {
38535  Py_RETURN_TRUE;
38536  }
38537  #if PY_MAJOR_VERSION < 3
38538  if (likely(PyInt_CheckExact(op1))) {
38539  const long b = intval;
38540  long a = PyInt_AS_LONG(op1);
38541  if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
38542  }
38543  #endif
38544  #if CYTHON_USE_PYLONG_INTERNALS
38545  if (likely(PyLong_CheckExact(op1))) {
38546  int unequal;
38547  unsigned long uintval;
38548  Py_ssize_t size = Py_SIZE(op1);
38549  const digit* digits = ((PyLongObject*)op1)->ob_digit;
38550  if (intval == 0) {
38551  if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
38552  } else if (intval < 0) {
38553  if (size >= 0)
38554  Py_RETURN_FALSE;
38555  intval = -intval;
38556  size = -size;
38557  } else {
38558  if (size <= 0)
38559  Py_RETURN_FALSE;
38560  }
38561  uintval = (unsigned long) intval;
38562 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
38563  if (uintval >> (PyLong_SHIFT * 4)) {
38564  unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
38565  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
38566  } else
38567 #endif
38568 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
38569  if (uintval >> (PyLong_SHIFT * 3)) {
38570  unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
38571  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
38572  } else
38573 #endif
38574 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
38575  if (uintval >> (PyLong_SHIFT * 2)) {
38576  unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
38577  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
38578  } else
38579 #endif
38580 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
38581  if (uintval >> (PyLong_SHIFT * 1)) {
38582  unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
38583  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
38584  } else
38585 #endif
38586  unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
38587  if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
38588  }
38589  #endif
38590  if (PyFloat_CheckExact(op1)) {
38591  const long b = intval;
38592  double a = PyFloat_AS_DOUBLE(op1);
38593  if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
38594  }
38595  return (
38596  PyObject_RichCompare(op1, op2, Py_EQ));
38597 }
38598 
38599 /* None */
38600 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
38601  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
38602 }
38603 
38604 /* PyIntBinop */
38605 #if !CYTHON_COMPILING_IN_PYPY
38606 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
38607  (void)inplace;
38608  (void)zerodivision_check;
38609  #if PY_MAJOR_VERSION < 3
38610  if (likely(PyInt_CheckExact(op1))) {
38611  const long b = intval;
38612  long x;
38613  long a = PyInt_AS_LONG(op1);
38614  x = (long)((unsigned long)a + b);
38615  if (likely((x^a) >= 0 || (x^b) >= 0))
38616  return PyInt_FromLong(x);
38617  return PyLong_Type.tp_as_number->nb_add(op1, op2);
38618  }
38619  #endif
38620  #if CYTHON_USE_PYLONG_INTERNALS
38621  if (likely(PyLong_CheckExact(op1))) {
38622  const long b = intval;
38623  long a, x;
38624 #ifdef HAVE_LONG_LONG
38625  const PY_LONG_LONG llb = intval;
38626  PY_LONG_LONG lla, llx;
38627 #endif
38628  const digit* digits = ((PyLongObject*)op1)->ob_digit;
38629  const Py_ssize_t size = Py_SIZE(op1);
38630  if (likely(__Pyx_sst_abs(size) <= 1)) {
38631  a = likely(size) ? digits[0] : 0;
38632  if (size == -1) a = -a;
38633  } else {
38634  switch (size) {
38635  case -2:
38636  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
38637  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38638  break;
38639 #ifdef HAVE_LONG_LONG
38640  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
38641  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
38642  goto long_long;
38643 #endif
38644  }
38645  CYTHON_FALLTHROUGH;
38646  case 2:
38647  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
38648  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38649  break;
38650 #ifdef HAVE_LONG_LONG
38651  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
38652  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
38653  goto long_long;
38654 #endif
38655  }
38656  CYTHON_FALLTHROUGH;
38657  case -3:
38658  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
38659  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38660  break;
38661 #ifdef HAVE_LONG_LONG
38662  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
38663  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
38664  goto long_long;
38665 #endif
38666  }
38667  CYTHON_FALLTHROUGH;
38668  case 3:
38669  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
38670  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38671  break;
38672 #ifdef HAVE_LONG_LONG
38673  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
38674  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
38675  goto long_long;
38676 #endif
38677  }
38678  CYTHON_FALLTHROUGH;
38679  case -4:
38680  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
38681  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38682  break;
38683 #ifdef HAVE_LONG_LONG
38684  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
38685  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
38686  goto long_long;
38687 #endif
38688  }
38689  CYTHON_FALLTHROUGH;
38690  case 4:
38691  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
38692  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38693  break;
38694 #ifdef HAVE_LONG_LONG
38695  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
38696  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
38697  goto long_long;
38698 #endif
38699  }
38700  CYTHON_FALLTHROUGH;
38701  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
38702  }
38703  }
38704  x = a + b;
38705  return PyLong_FromLong(x);
38706 #ifdef HAVE_LONG_LONG
38707  long_long:
38708  llx = lla + llb;
38709  return PyLong_FromLongLong(llx);
38710 #endif
38711 
38712 
38713  }
38714  #endif
38715  if (PyFloat_CheckExact(op1)) {
38716  const long b = intval;
38717  double a = PyFloat_AS_DOUBLE(op1);
38718  double result;
38719  PyFPE_START_PROTECT("add", return NULL)
38720  result = ((double)a) + (double)b;
38721  PyFPE_END_PROTECT(result)
38722  return PyFloat_FromDouble(result);
38723  }
38724  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
38725 }
38726 #endif
38727 
38728 /* SetItemInt */
38729 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
38730  int r;
38731  if (!j) return -1;
38732  r = PyObject_SetItem(o, j, v);
38733  Py_DECREF(j);
38734  return r;
38735 }
38736 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
38737  CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
38738 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
38739  if (is_list || PyList_CheckExact(o)) {
38740  Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
38741  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
38742  PyObject* old = PyList_GET_ITEM(o, n);
38743  Py_INCREF(v);
38744  PyList_SET_ITEM(o, n, v);
38745  Py_DECREF(old);
38746  return 1;
38747  }
38748  } else {
38749  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
38750  if (likely(m && m->sq_ass_item)) {
38751  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
38752  Py_ssize_t l = m->sq_length(o);
38753  if (likely(l >= 0)) {
38754  i += l;
38755  } else {
38756  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
38757  return -1;
38758  PyErr_Clear();
38759  }
38760  }
38761  return m->sq_ass_item(o, i, v);
38762  }
38763  }
38764 #else
38765 #if CYTHON_COMPILING_IN_PYPY
38766  if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
38767 #else
38768  if (is_list || PySequence_Check(o))
38769 #endif
38770  {
38771  return PySequence_SetItem(o, i, v);
38772  }
38773 #endif
38774  return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
38775 }
38776 
38777 /* ArgTypeTest */
38778 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
38779 {
38780  if (unlikely(!type)) {
38781  PyErr_SetString(PyExc_SystemError, "Missing type object");
38782  return 0;
38783  }
38784  else if (exact) {
38785  #if PY_MAJOR_VERSION == 2
38786  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
38787  #endif
38788  }
38789  else {
38790  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
38791  }
38792  PyErr_Format(PyExc_TypeError,
38793  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
38794  name, type->tp_name, Py_TYPE(obj)->tp_name);
38795  return 0;
38796 }
38797 
38798 /* BytesEquals */
38799 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
38800 #if CYTHON_COMPILING_IN_PYPY
38801  return PyObject_RichCompareBool(s1, s2, equals);
38802 #else
38803  if (s1 == s2) {
38804  return (equals == Py_EQ);
38805  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
38806  const char *ps1, *ps2;
38807  Py_ssize_t length = PyBytes_GET_SIZE(s1);
38808  if (length != PyBytes_GET_SIZE(s2))
38809  return (equals == Py_NE);
38810  ps1 = PyBytes_AS_STRING(s1);
38811  ps2 = PyBytes_AS_STRING(s2);
38812  if (ps1[0] != ps2[0]) {
38813  return (equals == Py_NE);
38814  } else if (length == 1) {
38815  return (equals == Py_EQ);
38816  } else {
38817  int result;
38818 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
38819  Py_hash_t hash1, hash2;
38820  hash1 = ((PyBytesObject*)s1)->ob_shash;
38821  hash2 = ((PyBytesObject*)s2)->ob_shash;
38822  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
38823  return (equals == Py_NE);
38824  }
38825 #endif
38826  result = memcmp(ps1, ps2, (size_t)length);
38827  return (equals == Py_EQ) ? (result == 0) : (result != 0);
38828  }
38829  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
38830  return (equals == Py_NE);
38831  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
38832  return (equals == Py_NE);
38833  } else {
38834  int result;
38835  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
38836  if (!py_result)
38837  return -1;
38838  result = __Pyx_PyObject_IsTrue(py_result);
38839  Py_DECREF(py_result);
38840  return result;
38841  }
38842 #endif
38843 }
38844 
38845 /* UnicodeEquals */
38846 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
38847 #if CYTHON_COMPILING_IN_PYPY
38848  return PyObject_RichCompareBool(s1, s2, equals);
38849 #else
38850 #if PY_MAJOR_VERSION < 3
38851  PyObject* owned_ref = NULL;
38852 #endif
38853  int s1_is_unicode, s2_is_unicode;
38854  if (s1 == s2) {
38855  goto return_eq;
38856  }
38857  s1_is_unicode = PyUnicode_CheckExact(s1);
38858  s2_is_unicode = PyUnicode_CheckExact(s2);
38859 #if PY_MAJOR_VERSION < 3
38860  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
38861  owned_ref = PyUnicode_FromObject(s2);
38862  if (unlikely(!owned_ref))
38863  return -1;
38864  s2 = owned_ref;
38865  s2_is_unicode = 1;
38866  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
38867  owned_ref = PyUnicode_FromObject(s1);
38868  if (unlikely(!owned_ref))
38869  return -1;
38870  s1 = owned_ref;
38871  s1_is_unicode = 1;
38872  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
38873  return __Pyx_PyBytes_Equals(s1, s2, equals);
38874  }
38875 #endif
38876  if (s1_is_unicode & s2_is_unicode) {
38877  Py_ssize_t length;
38878  int kind;
38879  void *data1, *data2;
38880  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
38881  return -1;
38882  length = __Pyx_PyUnicode_GET_LENGTH(s1);
38883  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
38884  goto return_ne;
38885  }
38886 #if CYTHON_USE_UNICODE_INTERNALS
38887  {
38888  Py_hash_t hash1, hash2;
38889  #if CYTHON_PEP393_ENABLED
38890  hash1 = ((PyASCIIObject*)s1)->hash;
38891  hash2 = ((PyASCIIObject*)s2)->hash;
38892  #else
38893  hash1 = ((PyUnicodeObject*)s1)->hash;
38894  hash2 = ((PyUnicodeObject*)s2)->hash;
38895  #endif
38896  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
38897  goto return_ne;
38898  }
38899  }
38900 #endif
38901  kind = __Pyx_PyUnicode_KIND(s1);
38902  if (kind != __Pyx_PyUnicode_KIND(s2)) {
38903  goto return_ne;
38904  }
38905  data1 = __Pyx_PyUnicode_DATA(s1);
38906  data2 = __Pyx_PyUnicode_DATA(s2);
38907  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
38908  goto return_ne;
38909  } else if (length == 1) {
38910  goto return_eq;
38911  } else {
38912  int result = memcmp(data1, data2, (size_t)(length * kind));
38913  #if PY_MAJOR_VERSION < 3
38914  Py_XDECREF(owned_ref);
38915  #endif
38916  return (equals == Py_EQ) ? (result == 0) : (result != 0);
38917  }
38918  } else if ((s1 == Py_None) & s2_is_unicode) {
38919  goto return_ne;
38920  } else if ((s2 == Py_None) & s1_is_unicode) {
38921  goto return_ne;
38922  } else {
38923  int result;
38924  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
38925  #if PY_MAJOR_VERSION < 3
38926  Py_XDECREF(owned_ref);
38927  #endif
38928  if (!py_result)
38929  return -1;
38930  result = __Pyx_PyObject_IsTrue(py_result);
38931  Py_DECREF(py_result);
38932  return result;
38933  }
38934 return_eq:
38935  #if PY_MAJOR_VERSION < 3
38936  Py_XDECREF(owned_ref);
38937  #endif
38938  return (equals == Py_EQ);
38939 return_ne:
38940  #if PY_MAJOR_VERSION < 3
38941  Py_XDECREF(owned_ref);
38942  #endif
38943  return (equals == Py_NE);
38944 #endif
38945 }
38946 
38947 /* GetAttr */
38948 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
38949 #if CYTHON_USE_TYPE_SLOTS
38950 #if PY_MAJOR_VERSION >= 3
38951  if (likely(PyUnicode_Check(n)))
38952 #else
38953  if (likely(PyString_Check(n)))
38954 #endif
38955  return __Pyx_PyObject_GetAttrStr(o, n);
38956 #endif
38957  return PyObject_GetAttr(o, n);
38958 }
38959 
38960 /* decode_c_string */
38961 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
38962  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
38963  const char* encoding, const char* errors,
38964  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
38965  Py_ssize_t length;
38966  if (unlikely((start < 0) | (stop < 0))) {
38967  size_t slen = strlen(cstring);
38968  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
38969  PyErr_SetString(PyExc_OverflowError,
38970  "c-string too long to convert to Python");
38971  return NULL;
38972  }
38973  length = (Py_ssize_t) slen;
38974  if (start < 0) {
38975  start += length;
38976  if (start < 0)
38977  start = 0;
38978  }
38979  if (stop < 0)
38980  stop += length;
38981  }
38982  if (unlikely(stop <= start))
38983  return __Pyx_NewRef(__pyx_empty_unicode);
38984  length = stop - start;
38985  cstring += start;
38986  if (decode_func) {
38987  return decode_func(cstring, length, errors);
38988  } else {
38989  return PyUnicode_Decode(cstring, length, encoding, errors);
38990  }
38991 }
38992 
38993 /* GetAttr3 */
38994 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
38995  __Pyx_PyThreadState_declare
38996  __Pyx_PyThreadState_assign
38997  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
38998  return NULL;
38999  __Pyx_PyErr_Clear();
39000  Py_INCREF(d);
39001  return d;
39002 }
39003 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
39004  PyObject *r = __Pyx_GetAttr(o, n);
39005  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
39006 }
39007 
39008 /* RaiseTooManyValuesToUnpack */
39009 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
39010  PyErr_Format(PyExc_ValueError,
39011  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
39012 }
39013 
39014 /* RaiseNeedMoreValuesToUnpack */
39015 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
39016  PyErr_Format(PyExc_ValueError,
39017  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
39018  index, (index == 1) ? "" : "s");
39019 }
39020 
39021 /* RaiseNoneIterError */
39022 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
39023  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
39024 }
39025 
39026 /* ExtTypeTest */
39027 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
39028  if (unlikely(!type)) {
39029  PyErr_SetString(PyExc_SystemError, "Missing type object");
39030  return 0;
39031  }
39032  if (likely(__Pyx_TypeCheck(obj, type)))
39033  return 1;
39034  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
39035  Py_TYPE(obj)->tp_name, type->tp_name);
39036  return 0;
39037 }
39038 
39039 /* SwapException */
39040 #if CYTHON_FAST_THREAD_STATE
39041 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
39042  PyObject *tmp_type, *tmp_value, *tmp_tb;
39043  #if CYTHON_USE_EXC_INFO_STACK
39044  _PyErr_StackItem *exc_info = tstate->exc_info;
39045  tmp_type = exc_info->exc_type;
39046  tmp_value = exc_info->exc_value;
39047  tmp_tb = exc_info->exc_traceback;
39048  exc_info->exc_type = *type;
39049  exc_info->exc_value = *value;
39050  exc_info->exc_traceback = *tb;
39051  #else
39052  tmp_type = tstate->exc_type;
39053  tmp_value = tstate->exc_value;
39054  tmp_tb = tstate->exc_traceback;
39055  tstate->exc_type = *type;
39056  tstate->exc_value = *value;
39057  tstate->exc_traceback = *tb;
39058  #endif
39059  *type = tmp_type;
39060  *value = tmp_value;
39061  *tb = tmp_tb;
39062 }
39063 #else
39064 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
39065  PyObject *tmp_type, *tmp_value, *tmp_tb;
39066  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
39067  PyErr_SetExcInfo(*type, *value, *tb);
39068  *type = tmp_type;
39069  *value = tmp_value;
39070  *tb = tmp_tb;
39071 }
39072 #endif
39073 
39074 /* Import */
39075 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
39076  PyObject *empty_list = 0;
39077  PyObject *module = 0;
39078  PyObject *global_dict = 0;
39079  PyObject *empty_dict = 0;
39080  PyObject *list;
39081  #if PY_MAJOR_VERSION < 3
39082  PyObject *py_import;
39083  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
39084  if (!py_import)
39085  goto bad;
39086  #endif
39087  if (from_list)
39088  list = from_list;
39089  else {
39090  empty_list = PyList_New(0);
39091  if (!empty_list)
39092  goto bad;
39093  list = empty_list;
39094  }
39095  global_dict = PyModule_GetDict(__pyx_m);
39096  if (!global_dict)
39097  goto bad;
39098  empty_dict = PyDict_New();
39099  if (!empty_dict)
39100  goto bad;
39101  {
39102  #if PY_MAJOR_VERSION >= 3
39103  if (level == -1) {
39104  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
39105  module = PyImport_ImportModuleLevelObject(
39106  name, global_dict, empty_dict, list, 1);
39107  if (!module) {
39108  if (!PyErr_ExceptionMatches(PyExc_ImportError))
39109  goto bad;
39110  PyErr_Clear();
39111  }
39112  }
39113  level = 0;
39114  }
39115  #endif
39116  if (!module) {
39117  #if PY_MAJOR_VERSION < 3
39118  PyObject *py_level = PyInt_FromLong(level);
39119  if (!py_level)
39120  goto bad;
39121  module = PyObject_CallFunctionObjArgs(py_import,
39122  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
39123  Py_DECREF(py_level);
39124  #else
39125  module = PyImport_ImportModuleLevelObject(
39126  name, global_dict, empty_dict, list, level);
39127  #endif
39128  }
39129  }
39130 bad:
39131  #if PY_MAJOR_VERSION < 3
39132  Py_XDECREF(py_import);
39133  #endif
39134  Py_XDECREF(empty_list);
39135  Py_XDECREF(empty_dict);
39136  return module;
39137 }
39138 
39139 /* FastTypeChecks */
39140 #if CYTHON_COMPILING_IN_CPYTHON
39141 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
39142  while (a) {
39143  a = a->tp_base;
39144  if (a == b)
39145  return 1;
39146  }
39147  return b == &PyBaseObject_Type;
39148 }
39149 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
39150  PyObject *mro;
39151  if (a == b) return 1;
39152  mro = a->tp_mro;
39153  if (likely(mro)) {
39154  Py_ssize_t i, n;
39155  n = PyTuple_GET_SIZE(mro);
39156  for (i = 0; i < n; i++) {
39157  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
39158  return 1;
39159  }
39160  return 0;
39161  }
39162  return __Pyx_InBases(a, b);
39163 }
39164 #if PY_MAJOR_VERSION == 2
39165 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
39166  PyObject *exception, *value, *tb;
39167  int res;
39168  __Pyx_PyThreadState_declare
39169  __Pyx_PyThreadState_assign
39170  __Pyx_ErrFetch(&exception, &value, &tb);
39171  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
39172  if (unlikely(res == -1)) {
39173  PyErr_WriteUnraisable(err);
39174  res = 0;
39175  }
39176  if (!res) {
39177  res = PyObject_IsSubclass(err, exc_type2);
39178  if (unlikely(res == -1)) {
39179  PyErr_WriteUnraisable(err);
39180  res = 0;
39181  }
39182  }
39183  __Pyx_ErrRestore(exception, value, tb);
39184  return res;
39185 }
39186 #else
39187 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
39188  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
39189  if (!res) {
39190  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
39191  }
39192  return res;
39193 }
39194 #endif
39195 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
39196  Py_ssize_t i, n;
39197  assert(PyExceptionClass_Check(exc_type));
39198  n = PyTuple_GET_SIZE(tuple);
39199 #if PY_MAJOR_VERSION >= 3
39200  for (i=0; i<n; i++) {
39201  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
39202  }
39203 #endif
39204  for (i=0; i<n; i++) {
39205  PyObject *t = PyTuple_GET_ITEM(tuple, i);
39206  #if PY_MAJOR_VERSION < 3
39207  if (likely(exc_type == t)) return 1;
39208  #endif
39209  if (likely(PyExceptionClass_Check(t))) {
39210  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
39211  } else {
39212  }
39213  }
39214  return 0;
39215 }
39216 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
39217  if (likely(err == exc_type)) return 1;
39218  if (likely(PyExceptionClass_Check(err))) {
39219  if (likely(PyExceptionClass_Check(exc_type))) {
39220  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
39221  } else if (likely(PyTuple_Check(exc_type))) {
39222  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
39223  } else {
39224  }
39225  }
39226  return PyErr_GivenExceptionMatches(err, exc_type);
39227 }
39228 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
39229  assert(PyExceptionClass_Check(exc_type1));
39230  assert(PyExceptionClass_Check(exc_type2));
39231  if (likely(err == exc_type1 || err == exc_type2)) return 1;
39232  if (likely(PyExceptionClass_Check(err))) {
39233  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
39234  }
39235  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
39236 }
39237 #endif
39238 
39239 /* ImportFrom */
39240 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
39241  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
39242  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
39243  PyErr_Format(PyExc_ImportError,
39244  #if PY_MAJOR_VERSION < 3
39245  "cannot import name %.230s", PyString_AS_STRING(name));
39246  #else
39247  "cannot import name %S", name);
39248  #endif
39249  }
39250  return value;
39251 }
39252 
39253 /* HasAttr */
39254 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
39255  PyObject *r;
39256  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
39257  PyErr_SetString(PyExc_TypeError,
39258  "hasattr(): attribute name must be string");
39259  return -1;
39260  }
39261  r = __Pyx_GetAttr(o, n);
39262  if (unlikely(!r)) {
39263  PyErr_Clear();
39264  return 0;
39265  } else {
39266  Py_DECREF(r);
39267  return 1;
39268  }
39269 }
39270 
39271 /* StringJoin */
39272 #if !CYTHON_COMPILING_IN_CPYTHON
39273 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
39274  return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
39275 }
39276 #endif
39277 
39278 /* PyObject_GenericGetAttrNoDict */
39279 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
39280 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
39281  PyErr_Format(PyExc_AttributeError,
39282 #if PY_MAJOR_VERSION >= 3
39283  "'%.50s' object has no attribute '%U'",
39284  tp->tp_name, attr_name);
39285 #else
39286  "'%.50s' object has no attribute '%.400s'",
39287  tp->tp_name, PyString_AS_STRING(attr_name));
39288 #endif
39289  return NULL;
39290 }
39291 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
39292  PyObject *descr;
39293  PyTypeObject *tp = Py_TYPE(obj);
39294  if (unlikely(!PyString_Check(attr_name))) {
39295  return PyObject_GenericGetAttr(obj, attr_name);
39296  }
39297  assert(!tp->tp_dictoffset);
39298  descr = _PyType_Lookup(tp, attr_name);
39299  if (unlikely(!descr)) {
39300  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
39301  }
39302  Py_INCREF(descr);
39303  #if PY_MAJOR_VERSION < 3
39304  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
39305  #endif
39306  {
39307  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
39308  if (unlikely(f)) {
39309  PyObject *res = f(descr, obj, (PyObject *)tp);
39310  Py_DECREF(descr);
39311  return res;
39312  }
39313  }
39314  return descr;
39315 }
39316 #endif
39317 
39318 /* PyObject_GenericGetAttr */
39319 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
39320 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
39321  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
39322  return PyObject_GenericGetAttr(obj, attr_name);
39323  }
39324  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
39325 }
39326 #endif
39327 
39328 /* SetVTable */
39329 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
39330 #if PY_VERSION_HEX >= 0x02070000
39331  PyObject *ob = PyCapsule_New(vtable, 0, 0);
39332 #else
39333  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
39334 #endif
39335  if (!ob)
39336  goto bad;
39337  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
39338  goto bad;
39339  Py_DECREF(ob);
39340  return 0;
39341 bad:
39342  Py_XDECREF(ob);
39343  return -1;
39344 }
39345 
39346 /* PyObjectGetAttrStrNoError */
39347 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
39348  __Pyx_PyThreadState_declare
39349  __Pyx_PyThreadState_assign
39350  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
39351  __Pyx_PyErr_Clear();
39352 }
39353 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
39354  PyObject *result;
39355 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
39356  PyTypeObject* tp = Py_TYPE(obj);
39357  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
39358  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
39359  }
39360 #endif
39361  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
39362  if (unlikely(!result)) {
39363  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
39364  }
39365  return result;
39366 }
39367 
39368 /* SetupReduce */
39369 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
39370  int ret;
39371  PyObject *name_attr;
39372  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
39373  if (likely(name_attr)) {
39374  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
39375  } else {
39376  ret = -1;
39377  }
39378  if (unlikely(ret < 0)) {
39379  PyErr_Clear();
39380  ret = 0;
39381  }
39382  Py_XDECREF(name_attr);
39383  return ret;
39384 }
39385 static int __Pyx_setup_reduce(PyObject* type_obj) {
39386  int ret = 0;
39387  PyObject *object_reduce = NULL;
39388  PyObject *object_getstate = NULL;
39389  PyObject *object_reduce_ex = NULL;
39390  PyObject *reduce = NULL;
39391  PyObject *reduce_ex = NULL;
39392  PyObject *reduce_cython = NULL;
39393  PyObject *setstate = NULL;
39394  PyObject *setstate_cython = NULL;
39395  PyObject *getstate = NULL;
39396 #if CYTHON_USE_PYTYPE_LOOKUP
39397  getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
39398 #else
39399  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
39400  if (!getstate && PyErr_Occurred()) {
39401  goto __PYX_BAD;
39402  }
39403 #endif
39404  if (getstate) {
39405 #if CYTHON_USE_PYTYPE_LOOKUP
39406  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
39407 #else
39408  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
39409  if (!object_getstate && PyErr_Occurred()) {
39410  goto __PYX_BAD;
39411  }
39412 #endif
39413  if (object_getstate != getstate) {
39414  goto __PYX_GOOD;
39415  }
39416  }
39417 #if CYTHON_USE_PYTYPE_LOOKUP
39418  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
39419 #else
39420  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
39421 #endif
39422  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
39423  if (reduce_ex == object_reduce_ex) {
39424 #if CYTHON_USE_PYTYPE_LOOKUP
39425  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
39426 #else
39427  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
39428 #endif
39429  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
39430  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
39431  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
39432  if (likely(reduce_cython)) {
39433  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
39434  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
39435  } else if (reduce == object_reduce || PyErr_Occurred()) {
39436  goto __PYX_BAD;
39437  }
39438  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
39439  if (!setstate) PyErr_Clear();
39440  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
39441  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
39442  if (likely(setstate_cython)) {
39443  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
39444  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
39445  } else if (!setstate || PyErr_Occurred()) {
39446  goto __PYX_BAD;
39447  }
39448  }
39449  PyType_Modified((PyTypeObject*)type_obj);
39450  }
39451  }
39452  goto __PYX_GOOD;
39453 __PYX_BAD:
39454  if (!PyErr_Occurred())
39455  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
39456  ret = -1;
39457 __PYX_GOOD:
39458 #if !CYTHON_USE_PYTYPE_LOOKUP
39459  Py_XDECREF(object_reduce);
39460  Py_XDECREF(object_reduce_ex);
39461  Py_XDECREF(object_getstate);
39462  Py_XDECREF(getstate);
39463 #endif
39464  Py_XDECREF(reduce);
39465  Py_XDECREF(reduce_ex);
39466  Py_XDECREF(reduce_cython);
39467  Py_XDECREF(setstate);
39468  Py_XDECREF(setstate_cython);
39469  return ret;
39470 }
39471 
39472 /* TypeImport */
39473 #ifndef __PYX_HAVE_RT_ImportType
39474 #define __PYX_HAVE_RT_ImportType
39475 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
39476  size_t size, enum __Pyx_ImportType_CheckSize check_size)
39477 {
39478  PyObject *result = 0;
39479  char warning[200];
39480  Py_ssize_t basicsize;
39481 #ifdef Py_LIMITED_API
39482  PyObject *py_basicsize;
39483 #endif
39484  result = PyObject_GetAttrString(module, class_name);
39485  if (!result)
39486  goto bad;
39487  if (!PyType_Check(result)) {
39488  PyErr_Format(PyExc_TypeError,
39489  "%.200s.%.200s is not a type object",
39490  module_name, class_name);
39491  goto bad;
39492  }
39493 #ifndef Py_LIMITED_API
39494  basicsize = ((PyTypeObject *)result)->tp_basicsize;
39495 #else
39496  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
39497  if (!py_basicsize)
39498  goto bad;
39499  basicsize = PyLong_AsSsize_t(py_basicsize);
39500  Py_DECREF(py_basicsize);
39501  py_basicsize = 0;
39502  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
39503  goto bad;
39504 #endif
39505  if ((size_t)basicsize < size) {
39506  PyErr_Format(PyExc_ValueError,
39507  "%.200s.%.200s size changed, may indicate binary incompatibility. "
39508  "Expected %zd from C header, got %zd from PyObject",
39509  module_name, class_name, size, basicsize);
39510  goto bad;
39511  }
39512  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
39513  PyErr_Format(PyExc_ValueError,
39514  "%.200s.%.200s size changed, may indicate binary incompatibility. "
39515  "Expected %zd from C header, got %zd from PyObject",
39516  module_name, class_name, size, basicsize);
39517  goto bad;
39518  }
39519  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
39520  PyOS_snprintf(warning, sizeof(warning),
39521  "%s.%s size changed, may indicate binary incompatibility. "
39522  "Expected %zd from C header, got %zd from PyObject",
39523  module_name, class_name, size, basicsize);
39524  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
39525  }
39526  return (PyTypeObject *)result;
39527 bad:
39528  Py_XDECREF(result);
39529  return NULL;
39530 }
39531 #endif
39532 
39533 /* CLineInTraceback */
39534 #ifndef CYTHON_CLINE_IN_TRACEBACK
39535 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
39536  PyObject *use_cline;
39537  PyObject *ptype, *pvalue, *ptraceback;
39538 #if CYTHON_COMPILING_IN_CPYTHON
39539  PyObject **cython_runtime_dict;
39540 #endif
39541  if (unlikely(!__pyx_cython_runtime)) {
39542  return c_line;
39543  }
39544  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
39545 #if CYTHON_COMPILING_IN_CPYTHON
39546  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
39547  if (likely(cython_runtime_dict)) {
39548  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
39549  use_cline, *cython_runtime_dict,
39550  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
39551  } else
39552 #endif
39553  {
39554  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
39555  if (use_cline_obj) {
39556  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
39557  Py_DECREF(use_cline_obj);
39558  } else {
39559  PyErr_Clear();
39560  use_cline = NULL;
39561  }
39562  }
39563  if (!use_cline) {
39564  c_line = 0;
39565  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
39566  }
39567  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
39568  c_line = 0;
39569  }
39570  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
39571  return c_line;
39572 }
39573 #endif
39574 
39575 /* CodeObjectCache */
39576 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
39577  int start = 0, mid = 0, end = count - 1;
39578  if (end >= 0 && code_line > entries[end].code_line) {
39579  return count;
39580  }
39581  while (start < end) {
39582  mid = start + (end - start) / 2;
39583  if (code_line < entries[mid].code_line) {
39584  end = mid;
39585  } else if (code_line > entries[mid].code_line) {
39586  start = mid + 1;
39587  } else {
39588  return mid;
39589  }
39590  }
39591  if (code_line <= entries[mid].code_line) {
39592  return mid;
39593  } else {
39594  return mid + 1;
39595  }
39596 }
39597 static PyCodeObject *__pyx_find_code_object(int code_line) {
39598  PyCodeObject* code_object;
39599  int pos;
39600  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
39601  return NULL;
39602  }
39603  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
39604  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
39605  return NULL;
39606  }
39607  code_object = __pyx_code_cache.entries[pos].code_object;
39608  Py_INCREF(code_object);
39609  return code_object;
39610 }
39611 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
39612  int pos, i;
39613  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
39614  if (unlikely(!code_line)) {
39615  return;
39616  }
39617  if (unlikely(!entries)) {
39618  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
39619  if (likely(entries)) {
39620  __pyx_code_cache.entries = entries;
39621  __pyx_code_cache.max_count = 64;
39622  __pyx_code_cache.count = 1;
39623  entries[0].code_line = code_line;
39624  entries[0].code_object = code_object;
39625  Py_INCREF(code_object);
39626  }
39627  return;
39628  }
39629  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
39630  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
39631  PyCodeObject* tmp = entries[pos].code_object;
39632  entries[pos].code_object = code_object;
39633  Py_DECREF(tmp);
39634  return;
39635  }
39636  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
39637  int new_max = __pyx_code_cache.max_count + 64;
39638  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
39639  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
39640  if (unlikely(!entries)) {
39641  return;
39642  }
39643  __pyx_code_cache.entries = entries;
39644  __pyx_code_cache.max_count = new_max;
39645  }
39646  for (i=__pyx_code_cache.count; i>pos; i--) {
39647  entries[i] = entries[i-1];
39648  }
39649  entries[pos].code_line = code_line;
39650  entries[pos].code_object = code_object;
39651  __pyx_code_cache.count++;
39652  Py_INCREF(code_object);
39653 }
39654 
39655 /* AddTraceback */
39656 #include "compile.h"
39657 #include "frameobject.h"
39658 #include "traceback.h"
39659 #if PY_VERSION_HEX >= 0x030b00a6
39660  #ifndef Py_BUILD_CORE
39661  #define Py_BUILD_CORE 1
39662  #endif
39663  #include "internal/pycore_frame.h"
39664 #endif
39665 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
39666  const char *funcname, int c_line,
39667  int py_line, const char *filename) {
39668  PyCodeObject *py_code = NULL;
39669  PyObject *py_funcname = NULL;
39670  #if PY_MAJOR_VERSION < 3
39671  PyObject *py_srcfile = NULL;
39672  py_srcfile = PyString_FromString(filename);
39673  if (!py_srcfile) goto bad;
39674  #endif
39675  if (c_line) {
39676  #if PY_MAJOR_VERSION < 3
39677  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
39678  if (!py_funcname) goto bad;
39679  #else
39680  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
39681  if (!py_funcname) goto bad;
39682  funcname = PyUnicode_AsUTF8(py_funcname);
39683  if (!funcname) goto bad;
39684  #endif
39685  }
39686  else {
39687  #if PY_MAJOR_VERSION < 3
39688  py_funcname = PyString_FromString(funcname);
39689  if (!py_funcname) goto bad;
39690  #endif
39691  }
39692  #if PY_MAJOR_VERSION < 3
39693  py_code = __Pyx_PyCode_New(
39694  0,
39695  0,
39696  0,
39697  0,
39698  0,
39699  __pyx_empty_bytes, /*PyObject *code,*/
39700  __pyx_empty_tuple, /*PyObject *consts,*/
39701  __pyx_empty_tuple, /*PyObject *names,*/
39702  __pyx_empty_tuple, /*PyObject *varnames,*/
39703  __pyx_empty_tuple, /*PyObject *freevars,*/
39704  __pyx_empty_tuple, /*PyObject *cellvars,*/
39705  py_srcfile, /*PyObject *filename,*/
39706  py_funcname, /*PyObject *name,*/
39707  py_line,
39708  __pyx_empty_bytes /*PyObject *lnotab*/
39709  );
39710  Py_DECREF(py_srcfile);
39711  #else
39712  py_code = PyCode_NewEmpty(filename, funcname, py_line);
39713  #endif
39714  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
39715  return py_code;
39716 bad:
39717  Py_XDECREF(py_funcname);
39718  #if PY_MAJOR_VERSION < 3
39719  Py_XDECREF(py_srcfile);
39720  #endif
39721  return NULL;
39722 }
39723 static void __Pyx_AddTraceback(const char *funcname, int c_line,
39724  int py_line, const char *filename) {
39725  PyCodeObject *py_code = 0;
39726  PyFrameObject *py_frame = 0;
39727  PyThreadState *tstate = __Pyx_PyThreadState_Current;
39728  PyObject *ptype, *pvalue, *ptraceback;
39729  if (c_line) {
39730  c_line = __Pyx_CLineForTraceback(tstate, c_line);
39731  }
39732  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
39733  if (!py_code) {
39734  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
39735  py_code = __Pyx_CreateCodeObjectForTraceback(
39736  funcname, c_line, py_line, filename);
39737  if (!py_code) {
39738  /* If the code object creation fails, then we should clear the
39739  fetched exception references and propagate the new exception */
39740  Py_XDECREF(ptype);
39741  Py_XDECREF(pvalue);
39742  Py_XDECREF(ptraceback);
39743  goto bad;
39744  }
39745  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
39746  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
39747  }
39748  py_frame = PyFrame_New(
39749  tstate, /*PyThreadState *tstate,*/
39750  py_code, /*PyCodeObject *code,*/
39751  __pyx_d, /*PyObject *globals,*/
39752  0 /*PyObject *locals*/
39753  );
39754  if (!py_frame) goto bad;
39755  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
39756  PyTraceBack_Here(py_frame);
39757 bad:
39758  Py_XDECREF(py_code);
39759  Py_XDECREF(py_frame);
39760 }
39761 
39762 #if PY_MAJOR_VERSION < 3
39763 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
39764  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
39765  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
39766  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
39767  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
39768  return -1;
39769 }
39770 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
39771  PyObject *obj = view->obj;
39772  if (!obj) return;
39773  if (PyObject_CheckBuffer(obj)) {
39774  PyBuffer_Release(view);
39775  return;
39776  }
39777  if ((0)) {}
39778  view->obj = NULL;
39779  Py_DECREF(obj);
39780 }
39781 #endif
39782 
39783 
39784 /* MemviewSliceIsContig */
39785 static int
39786 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
39787 {
39788  int i, index, step, start;
39789  Py_ssize_t itemsize = mvs.memview->view.itemsize;
39790  if (order == 'F') {
39791  step = 1;
39792  start = 0;
39793  } else {
39794  step = -1;
39795  start = ndim - 1;
39796  }
39797  for (i = 0; i < ndim; i++) {
39798  index = start + step * i;
39799  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
39800  return 0;
39801  itemsize *= mvs.shape[index];
39802  }
39803  return 1;
39804 }
39805 
39806 /* OverlappingSlices */
39807 static void
39808 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
39809  void **out_start, void **out_end,
39810  int ndim, size_t itemsize)
39811 {
39812  char *start, *end;
39813  int i;
39814  start = end = slice->data;
39815  for (i = 0; i < ndim; i++) {
39816  Py_ssize_t stride = slice->strides[i];
39817  Py_ssize_t extent = slice->shape[i];
39818  if (extent == 0) {
39819  *out_start = *out_end = start;
39820  return;
39821  } else {
39822  if (stride > 0)
39823  end += stride * (extent - 1);
39824  else
39825  start += stride * (extent - 1);
39826  }
39827  }
39828  *out_start = start;
39829  *out_end = end + itemsize;
39830 }
39831 static int
39832 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
39833  __Pyx_memviewslice *slice2,
39834  int ndim, size_t itemsize)
39835 {
39836  void *start1, *end1, *start2, *end2;
39837  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
39838  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
39839  return (start1 < end2) && (start2 < end1);
39840 }
39841 
39842 /* Capsule */
39843 static CYTHON_INLINE PyObject *
39844 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
39845 {
39846  PyObject *cobj;
39847 #if PY_VERSION_HEX >= 0x02070000
39848  cobj = PyCapsule_New(p, sig, NULL);
39849 #else
39850  cobj = PyCObject_FromVoidPtr(p, NULL);
39851 #endif
39852  return cobj;
39853 }
39854 
39855 /* IsLittleEndian */
39856 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
39857 {
39858  union {
39859  uint32_t u32;
39860  uint8_t u8[4];
39861  } S;
39862  S.u32 = 0x01020304;
39863  return S.u8[0] == 4;
39864 }
39865 
39866 /* BufferFormatCheck */
39867 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
39868  __Pyx_BufFmt_StackElem* stack,
39869  __Pyx_TypeInfo* type) {
39870  stack[0].field = &ctx->root;
39871  stack[0].parent_offset = 0;
39872  ctx->root.type = type;
39873  ctx->root.name = "buffer dtype";
39874  ctx->root.offset = 0;
39875  ctx->head = stack;
39876  ctx->head->field = &ctx->root;
39877  ctx->fmt_offset = 0;
39878  ctx->head->parent_offset = 0;
39879  ctx->new_packmode = '@';
39880  ctx->enc_packmode = '@';
39881  ctx->new_count = 1;
39882  ctx->enc_count = 0;
39883  ctx->enc_type = 0;
39884  ctx->is_complex = 0;
39885  ctx->is_valid_array = 0;
39886  ctx->struct_alignment = 0;
39887  while (type->typegroup == 'S') {
39888  ++ctx->head;
39889  ctx->head->field = type->fields;
39890  ctx->head->parent_offset = 0;
39891  type = type->fields->type;
39892  }
39893 }
39894 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
39895  int count;
39896  const char* t = *ts;
39897  if (*t < '0' || *t > '9') {
39898  return -1;
39899  } else {
39900  count = *t++ - '0';
39901  while (*t >= '0' && *t <= '9') {
39902  count *= 10;
39903  count += *t++ - '0';
39904  }
39905  }
39906  *ts = t;
39907  return count;
39908 }
39909 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
39910  int number = __Pyx_BufFmt_ParseNumber(ts);
39911  if (number == -1)
39912  PyErr_Format(PyExc_ValueError,\
39913  "Does not understand character buffer dtype format string ('%c')", **ts);
39914  return number;
39915 }
39916 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
39917  PyErr_Format(PyExc_ValueError,
39918  "Unexpected format string character: '%c'", ch);
39919 }
39920 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
39921  switch (ch) {
39922  case '?': return "'bool'";
39923  case 'c': return "'char'";
39924  case 'b': return "'signed char'";
39925  case 'B': return "'unsigned char'";
39926  case 'h': return "'short'";
39927  case 'H': return "'unsigned short'";
39928  case 'i': return "'int'";
39929  case 'I': return "'unsigned int'";
39930  case 'l': return "'long'";
39931  case 'L': return "'unsigned long'";
39932  case 'q': return "'long long'";
39933  case 'Q': return "'unsigned long long'";
39934  case 'f': return (is_complex ? "'complex float'" : "'float'");
39935  case 'd': return (is_complex ? "'complex double'" : "'double'");
39936  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
39937  case 'T': return "a struct";
39938  case 'O': return "Python object";
39939  case 'P': return "a pointer";
39940  case 's': case 'p': return "a string";
39941  case 0: return "end";
39942  default: return "unparseable format string";
39943  }
39944 }
39945 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
39946  switch (ch) {
39947  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
39948  case 'h': case 'H': return 2;
39949  case 'i': case 'I': case 'l': case 'L': return 4;
39950  case 'q': case 'Q': return 8;
39951  case 'f': return (is_complex ? 8 : 4);
39952  case 'd': return (is_complex ? 16 : 8);
39953  case 'g': {
39954  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
39955  return 0;
39956  }
39957  case 'O': case 'P': return sizeof(void*);
39958  default:
39959  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
39960  return 0;
39961  }
39962 }
39963 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
39964  switch (ch) {
39965  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
39966  case 'h': case 'H': return sizeof(short);
39967  case 'i': case 'I': return sizeof(int);
39968  case 'l': case 'L': return sizeof(long);
39969  #ifdef HAVE_LONG_LONG
39970  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
39971  #endif
39972  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
39973  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
39974  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
39975  case 'O': case 'P': return sizeof(void*);
39976  default: {
39977  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
39978  return 0;
39979  }
39980  }
39981 }
39982 typedef struct { char c; short x; } __Pyx_st_short;
39983 typedef struct { char c; int x; } __Pyx_st_int;
39984 typedef struct { char c; long x; } __Pyx_st_long;
39985 typedef struct { char c; float x; } __Pyx_st_float;
39986 typedef struct { char c; double x; } __Pyx_st_double;
39987 typedef struct { char c; long double x; } __Pyx_st_longdouble;
39988 typedef struct { char c; void *x; } __Pyx_st_void_p;
39989 #ifdef HAVE_LONG_LONG
39990 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
39991 #endif
39992 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
39993  switch (ch) {
39994  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
39995  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
39996  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
39997  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
39998 #ifdef HAVE_LONG_LONG
39999  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
40000 #endif
40001  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
40002  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
40003  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
40004  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
40005  default:
40006  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
40007  return 0;
40008  }
40009 }
40010 /* These are for computing the padding at the end of the struct to align
40011  on the first member of the struct. This will probably the same as above,
40012  but we don't have any guarantees.
40013  */
40014 typedef struct { short x; char c; } __Pyx_pad_short;
40015 typedef struct { int x; char c; } __Pyx_pad_int;
40016 typedef struct { long x; char c; } __Pyx_pad_long;
40017 typedef struct { float x; char c; } __Pyx_pad_float;
40018 typedef struct { double x; char c; } __Pyx_pad_double;
40019 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
40020 typedef struct { void *x; char c; } __Pyx_pad_void_p;
40021 #ifdef HAVE_LONG_LONG
40022 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
40023 #endif
40024 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
40025  switch (ch) {
40026  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
40027  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
40028  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
40029  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
40030 #ifdef HAVE_LONG_LONG
40031  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
40032 #endif
40033  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
40034  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
40035  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
40036  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
40037  default:
40038  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
40039  return 0;
40040  }
40041 }
40042 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
40043  switch (ch) {
40044  case 'c':
40045  return 'H';
40046  case 'b': case 'h': case 'i':
40047  case 'l': case 'q': case 's': case 'p':
40048  return 'I';
40049  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
40050  return 'U';
40051  case 'f': case 'd': case 'g':
40052  return (is_complex ? 'C' : 'R');
40053  case 'O':
40054  return 'O';
40055  case 'P':
40056  return 'P';
40057  default: {
40058  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
40059  return 0;
40060  }
40061  }
40062 }
40063 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
40064  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
40065  const char* expected;
40066  const char* quote;
40067  if (ctx->head == NULL) {
40068  expected = "end";
40069  quote = "";
40070  } else {
40071  expected = ctx->head->field->type->name;
40072  quote = "'";
40073  }
40074  PyErr_Format(PyExc_ValueError,
40075  "Buffer dtype mismatch, expected %s%s%s but got %s",
40076  quote, expected, quote,
40077  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
40078  } else {
40079  __Pyx_StructField* field = ctx->head->field;
40080  __Pyx_StructField* parent = (ctx->head - 1)->field;
40081  PyErr_Format(PyExc_ValueError,
40082  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
40083  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
40084  parent->type->name, field->name);
40085  }
40086 }
40087 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
40088  char group;
40089  size_t size, offset, arraysize = 1;
40090  if (ctx->enc_type == 0) return 0;
40091  if (ctx->head->field->type->arraysize[0]) {
40092  int i, ndim = 0;
40093  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
40094  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
40095  ndim = 1;
40096  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
40097  PyErr_Format(PyExc_ValueError,
40098  "Expected a dimension of size %zu, got %zu",
40099  ctx->head->field->type->arraysize[0], ctx->enc_count);
40100  return -1;
40101  }
40102  }
40103  if (!ctx->is_valid_array) {
40104  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
40105  ctx->head->field->type->ndim, ndim);
40106  return -1;
40107  }
40108  for (i = 0; i < ctx->head->field->type->ndim; i++) {
40109  arraysize *= ctx->head->field->type->arraysize[i];
40110  }
40111  ctx->is_valid_array = 0;
40112  ctx->enc_count = 1;
40113  }
40114  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
40115  do {
40116  __Pyx_StructField* field = ctx->head->field;
40117  __Pyx_TypeInfo* type = field->type;
40118  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
40119  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
40120  } else {
40121  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
40122  }
40123  if (ctx->enc_packmode == '@') {
40124  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
40125  size_t align_mod_offset;
40126  if (align_at == 0) return -1;
40127  align_mod_offset = ctx->fmt_offset % align_at;
40128  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
40129  if (ctx->struct_alignment == 0)
40130  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
40131  ctx->is_complex);
40132  }
40133  if (type->size != size || type->typegroup != group) {
40134  if (type->typegroup == 'C' && type->fields != NULL) {
40135  size_t parent_offset = ctx->head->parent_offset + field->offset;
40136  ++ctx->head;
40137  ctx->head->field = type->fields;
40138  ctx->head->parent_offset = parent_offset;
40139  continue;
40140  }
40141  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
40142  } else {
40143  __Pyx_BufFmt_RaiseExpected(ctx);
40144  return -1;
40145  }
40146  }
40147  offset = ctx->head->parent_offset + field->offset;
40148  if (ctx->fmt_offset != offset) {
40149  PyErr_Format(PyExc_ValueError,
40150  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
40151  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
40152  return -1;
40153  }
40154  ctx->fmt_offset += size;
40155  if (arraysize)
40156  ctx->fmt_offset += (arraysize - 1) * size;
40157  --ctx->enc_count;
40158  while (1) {
40159  if (field == &ctx->root) {
40160  ctx->head = NULL;
40161  if (ctx->enc_count != 0) {
40162  __Pyx_BufFmt_RaiseExpected(ctx);
40163  return -1;
40164  }
40165  break;
40166  }
40167  ctx->head->field = ++field;
40168  if (field->type == NULL) {
40169  --ctx->head;
40170  field = ctx->head->field;
40171  continue;
40172  } else if (field->type->typegroup == 'S') {
40173  size_t parent_offset = ctx->head->parent_offset + field->offset;
40174  if (field->type->fields->type == NULL) continue;
40175  field = field->type->fields;
40176  ++ctx->head;
40177  ctx->head->field = field;
40178  ctx->head->parent_offset = parent_offset;
40179  break;
40180  } else {
40181  break;
40182  }
40183  }
40184  } while (ctx->enc_count);
40185  ctx->enc_type = 0;
40186  ctx->is_complex = 0;
40187  return 0;
40188 }
40189 static PyObject *
40190 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
40191 {
40192  const char *ts = *tsp;
40193  int i = 0, number, ndim;
40194  ++ts;
40195  if (ctx->new_count != 1) {
40196  PyErr_SetString(PyExc_ValueError,
40197  "Cannot handle repeated arrays in format string");
40198  return NULL;
40199  }
40200  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
40201  ndim = ctx->head->field->type->ndim;
40202  while (*ts && *ts != ')') {
40203  switch (*ts) {
40204  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
40205  default: break;
40206  }
40207  number = __Pyx_BufFmt_ExpectNumber(&ts);
40208  if (number == -1) return NULL;
40209  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
40210  return PyErr_Format(PyExc_ValueError,
40211  "Expected a dimension of size %zu, got %d",
40212  ctx->head->field->type->arraysize[i], number);
40213  if (*ts != ',' && *ts != ')')
40214  return PyErr_Format(PyExc_ValueError,
40215  "Expected a comma in format string, got '%c'", *ts);
40216  if (*ts == ',') ts++;
40217  i++;
40218  }
40219  if (i != ndim)
40220  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
40221  ctx->head->field->type->ndim, i);
40222  if (!*ts) {
40223  PyErr_SetString(PyExc_ValueError,
40224  "Unexpected end of format string, expected ')'");
40225  return NULL;
40226  }
40227  ctx->is_valid_array = 1;
40228  ctx->new_count = 1;
40229  *tsp = ++ts;
40230  return Py_None;
40231 }
40232 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
40233  int got_Z = 0;
40234  while (1) {
40235  switch(*ts) {
40236  case 0:
40237  if (ctx->enc_type != 0 && ctx->head == NULL) {
40238  __Pyx_BufFmt_RaiseExpected(ctx);
40239  return NULL;
40240  }
40241  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
40242  if (ctx->head != NULL) {
40243  __Pyx_BufFmt_RaiseExpected(ctx);
40244  return NULL;
40245  }
40246  return ts;
40247  case ' ':
40248  case '\r':
40249  case '\n':
40250  ++ts;
40251  break;
40252  case '<':
40253  if (!__Pyx_Is_Little_Endian()) {
40254  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
40255  return NULL;
40256  }
40257  ctx->new_packmode = '=';
40258  ++ts;
40259  break;
40260  case '>':
40261  case '!':
40262  if (__Pyx_Is_Little_Endian()) {
40263  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
40264  return NULL;
40265  }
40266  ctx->new_packmode = '=';
40267  ++ts;
40268  break;
40269  case '=':
40270  case '@':
40271  case '^':
40272  ctx->new_packmode = *ts++;
40273  break;
40274  case 'T':
40275  {
40276  const char* ts_after_sub;
40277  size_t i, struct_count = ctx->new_count;
40278  size_t struct_alignment = ctx->struct_alignment;
40279  ctx->new_count = 1;
40280  ++ts;
40281  if (*ts != '{') {
40282  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
40283  return NULL;
40284  }
40285  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
40286  ctx->enc_type = 0;
40287  ctx->enc_count = 0;
40288  ctx->struct_alignment = 0;
40289  ++ts;
40290  ts_after_sub = ts;
40291  for (i = 0; i != struct_count; ++i) {
40292  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
40293  if (!ts_after_sub) return NULL;
40294  }
40295  ts = ts_after_sub;
40296  if (struct_alignment) ctx->struct_alignment = struct_alignment;
40297  }
40298  break;
40299  case '}':
40300  {
40301  size_t alignment = ctx->struct_alignment;
40302  ++ts;
40303  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
40304  ctx->enc_type = 0;
40305  if (alignment && ctx->fmt_offset % alignment) {
40306  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
40307  }
40308  }
40309  return ts;
40310  case 'x':
40311  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
40312  ctx->fmt_offset += ctx->new_count;
40313  ctx->new_count = 1;
40314  ctx->enc_count = 0;
40315  ctx->enc_type = 0;
40316  ctx->enc_packmode = ctx->new_packmode;
40317  ++ts;
40318  break;
40319  case 'Z':
40320  got_Z = 1;
40321  ++ts;
40322  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
40323  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
40324  return NULL;
40325  }
40326  CYTHON_FALLTHROUGH;
40327  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
40328  case 'l': case 'L': case 'q': case 'Q':
40329  case 'f': case 'd': case 'g':
40330  case 'O': case 'p':
40331  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
40332  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
40333  ctx->enc_count += ctx->new_count;
40334  ctx->new_count = 1;
40335  got_Z = 0;
40336  ++ts;
40337  break;
40338  }
40339  CYTHON_FALLTHROUGH;
40340  case 's':
40341  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
40342  ctx->enc_count = ctx->new_count;
40343  ctx->enc_packmode = ctx->new_packmode;
40344  ctx->enc_type = *ts;
40345  ctx->is_complex = got_Z;
40346  ++ts;
40347  ctx->new_count = 1;
40348  got_Z = 0;
40349  break;
40350  case ':':
40351  ++ts;
40352  while(*ts != ':') ++ts;
40353  ++ts;
40354  break;
40355  case '(':
40356  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
40357  break;
40358  default:
40359  {
40360  int number = __Pyx_BufFmt_ExpectNumber(&ts);
40361  if (number == -1) return NULL;
40362  ctx->new_count = (size_t)number;
40363  }
40364  }
40365  }
40366 }
40367 
40368 /* TypeInfoCompare */
40369  static int
40370 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
40371 {
40372  int i;
40373  if (!a || !b)
40374  return 0;
40375  if (a == b)
40376  return 1;
40377  if (a->size != b->size || a->typegroup != b->typegroup ||
40378  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
40379  if (a->typegroup == 'H' || b->typegroup == 'H') {
40380  return a->size == b->size;
40381  } else {
40382  return 0;
40383  }
40384  }
40385  if (a->ndim) {
40386  for (i = 0; i < a->ndim; i++)
40387  if (a->arraysize[i] != b->arraysize[i])
40388  return 0;
40389  }
40390  if (a->typegroup == 'S') {
40391  if (a->flags != b->flags)
40392  return 0;
40393  if (a->fields || b->fields) {
40394  if (!(a->fields && b->fields))
40395  return 0;
40396  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
40397  __Pyx_StructField *field_a = a->fields + i;
40398  __Pyx_StructField *field_b = b->fields + i;
40399  if (field_a->offset != field_b->offset ||
40400  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
40401  return 0;
40402  }
40403  return !a->fields[i].type && !b->fields[i].type;
40404  }
40405  }
40406  return 1;
40407 }
40408 
40409 /* MemviewSliceValidateAndInit */
40410  static int
40411 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
40412 {
40413  if (buf->shape[dim] <= 1)
40414  return 1;
40415  if (buf->strides) {
40416  if (spec & __Pyx_MEMVIEW_CONTIG) {
40417  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
40418  if (unlikely(buf->strides[dim] != sizeof(void *))) {
40419  PyErr_Format(PyExc_ValueError,
40420  "Buffer is not indirectly contiguous "
40421  "in dimension %d.", dim);
40422  goto fail;
40423  }
40424  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
40425  PyErr_SetString(PyExc_ValueError,
40426  "Buffer and memoryview are not contiguous "
40427  "in the same dimension.");
40428  goto fail;
40429  }
40430  }
40431  if (spec & __Pyx_MEMVIEW_FOLLOW) {
40432  Py_ssize_t stride = buf->strides[dim];
40433  if (stride < 0)
40434  stride = -stride;
40435  if (unlikely(stride < buf->itemsize)) {
40436  PyErr_SetString(PyExc_ValueError,
40437  "Buffer and memoryview are not contiguous "
40438  "in the same dimension.");
40439  goto fail;
40440  }
40441  }
40442  } else {
40443  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
40444  PyErr_Format(PyExc_ValueError,
40445  "C-contiguous buffer is not contiguous in "
40446  "dimension %d", dim);
40447  goto fail;
40448  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
40449  PyErr_Format(PyExc_ValueError,
40450  "C-contiguous buffer is not indirect in "
40451  "dimension %d", dim);
40452  goto fail;
40453  } else if (unlikely(buf->suboffsets)) {
40454  PyErr_SetString(PyExc_ValueError,
40455  "Buffer exposes suboffsets but no strides");
40456  goto fail;
40457  }
40458  }
40459  return 1;
40460 fail:
40461  return 0;
40462 }
40463 static int
40464 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
40465 {
40466  if (spec & __Pyx_MEMVIEW_DIRECT) {
40467  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
40468  PyErr_Format(PyExc_ValueError,
40469  "Buffer not compatible with direct access "
40470  "in dimension %d.", dim);
40471  goto fail;
40472  }
40473  }
40474  if (spec & __Pyx_MEMVIEW_PTR) {
40475  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
40476  PyErr_Format(PyExc_ValueError,
40477  "Buffer is not indirectly accessible "
40478  "in dimension %d.", dim);
40479  goto fail;
40480  }
40481  }
40482  return 1;
40483 fail:
40484  return 0;
40485 }
40486 static int
40487 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
40488 {
40489  int i;
40490  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
40491  Py_ssize_t stride = 1;
40492  for (i = 0; i < ndim; i++) {
40493  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
40494  PyErr_SetString(PyExc_ValueError,
40495  "Buffer not fortran contiguous.");
40496  goto fail;
40497  }
40498  stride = stride * buf->shape[i];
40499  }
40500  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
40501  Py_ssize_t stride = 1;
40502  for (i = ndim - 1; i >- 1; i--) {
40503  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
40504  PyErr_SetString(PyExc_ValueError,
40505  "Buffer not C contiguous.");
40506  goto fail;
40507  }
40508  stride = stride * buf->shape[i];
40509  }
40510  }
40511  return 1;
40512 fail:
40513  return 0;
40514 }
40515 static int __Pyx_ValidateAndInit_memviewslice(
40516  int *axes_specs,
40517  int c_or_f_flag,
40518  int buf_flags,
40519  int ndim,
40520  __Pyx_TypeInfo *dtype,
40521  __Pyx_BufFmt_StackElem stack[],
40522  __Pyx_memviewslice *memviewslice,
40523  PyObject *original_obj)
40524 {
40525  struct __pyx_memoryview_obj *memview, *new_memview;
40526  __Pyx_RefNannyDeclarations
40527  Py_buffer *buf;
40528  int i, spec = 0, retval = -1;
40529  __Pyx_BufFmt_Context ctx;
40530  int from_memoryview = __pyx_memoryview_check(original_obj);
40531  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
40532  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
40533  original_obj)->typeinfo)) {
40534  memview = (struct __pyx_memoryview_obj *) original_obj;
40535  new_memview = NULL;
40536  } else {
40537  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
40538  original_obj, buf_flags, 0, dtype);
40539  new_memview = memview;
40540  if (unlikely(!memview))
40541  goto fail;
40542  }
40543  buf = &memview->view;
40544  if (unlikely(buf->ndim != ndim)) {
40545  PyErr_Format(PyExc_ValueError,
40546  "Buffer has wrong number of dimensions (expected %d, got %d)",
40547  ndim, buf->ndim);
40548  goto fail;
40549  }
40550  if (new_memview) {
40551  __Pyx_BufFmt_Init(&ctx, stack, dtype);
40552  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
40553  }
40554  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
40555  PyErr_Format(PyExc_ValueError,
40556  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
40557  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
40558  buf->itemsize,
40559  (buf->itemsize > 1) ? "s" : "",
40560  dtype->name,
40561  dtype->size,
40562  (dtype->size > 1) ? "s" : "");
40563  goto fail;
40564  }
40565  if (buf->len > 0) {
40566  for (i = 0; i < ndim; i++) {
40567  spec = axes_specs[i];
40568  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
40569  goto fail;
40570  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
40571  goto fail;
40572  }
40573  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
40574  goto fail;
40575  }
40576  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
40577  new_memview != NULL) == -1)) {
40578  goto fail;
40579  }
40580  retval = 0;
40581  goto no_fail;
40582 fail:
40583  Py_XDECREF(new_memview);
40584  retval = -1;
40585 no_fail:
40586  __Pyx_RefNannyFinishContext();
40587  return retval;
40588 }
40589 
40590 /* ObjectToMemviewSlice */
40591  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
40592  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
40593  __Pyx_BufFmt_StackElem stack[1];
40594  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
40595  int retcode;
40596  if (obj == Py_None) {
40597  result.memview = (struct __pyx_memoryview_obj *) Py_None;
40598  return result;
40599  }
40600  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
40601  PyBUF_RECORDS_RO | writable_flag, 1,
40602  &__Pyx_TypeInfo_double, stack,
40603  &result, obj);
40604  if (unlikely(retcode == -1))
40605  goto __pyx_fail;
40606  return result;
40607 __pyx_fail:
40608  result.memview = NULL;
40609  result.data = NULL;
40610  return result;
40611 }
40612 
40613 /* ObjectToMemviewSlice */
40614  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
40615  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
40616  __Pyx_BufFmt_StackElem stack[1];
40617  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
40618  int retcode;
40619  if (obj == Py_None) {
40620  result.memview = (struct __pyx_memoryview_obj *) Py_None;
40621  return result;
40622  }
40623  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
40624  PyBUF_RECORDS_RO | writable_flag, 1,
40625  &__Pyx_TypeInfo_int, stack,
40626  &result, obj);
40627  if (unlikely(retcode == -1))
40628  goto __pyx_fail;
40629  return result;
40630 __pyx_fail:
40631  result.memview = NULL;
40632  result.data = NULL;
40633  return result;
40634 }
40635 
40636 /* CIntFromPyVerify */
40637  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
40638  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
40639 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
40640  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
40641 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
40642  {\
40643  func_type value = func_value;\
40644  if (sizeof(target_type) < sizeof(func_type)) {\
40645  if (unlikely(value != (func_type) (target_type) value)) {\
40646  func_type zero = 0;\
40647  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
40648  return (target_type) -1;\
40649  if (is_unsigned && unlikely(value < zero))\
40650  goto raise_neg_overflow;\
40651  else\
40652  goto raise_overflow;\
40653  }\
40654  }\
40655  return (target_type) value;\
40656  }
40657 
40658 /* ObjectToMemviewSlice */
40659  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsds_double(PyObject *obj, int writable_flag) {
40660  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
40661  __Pyx_BufFmt_StackElem stack[1];
40662  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
40663  int retcode;
40664  if (obj == Py_None) {
40665  result.memview = (struct __pyx_memoryview_obj *) Py_None;
40666  return result;
40667  }
40668  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
40669  PyBUF_RECORDS_RO | writable_flag, 3,
40670  &__Pyx_TypeInfo_double, stack,
40671  &result, obj);
40672  if (unlikely(retcode == -1))
40673  goto __pyx_fail;
40674  return result;
40675 __pyx_fail:
40676  result.memview = NULL;
40677  result.data = NULL;
40678  return result;
40679 }
40680 
40681 /* ObjectToMemviewSlice */
40682  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *obj, int writable_flag) {
40683  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
40684  __Pyx_BufFmt_StackElem stack[1];
40685  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
40686  int retcode;
40687  if (obj == Py_None) {
40688  result.memview = (struct __pyx_memoryview_obj *) Py_None;
40689  return result;
40690  }
40691  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
40692  PyBUF_RECORDS_RO | writable_flag, 2,
40693  &__Pyx_TypeInfo_double, stack,
40694  &result, obj);
40695  if (unlikely(retcode == -1))
40696  goto __pyx_fail;
40697  return result;
40698 __pyx_fail:
40699  result.memview = NULL;
40700  result.data = NULL;
40701  return result;
40702 }
40703 
40704 /* MemviewDtypeToObject */
40705  static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
40706  return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
40707 }
40708 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
40709  double value = __pyx_PyFloat_AsDouble(obj);
40710  if ((value == (double)-1) && PyErr_Occurred())
40711  return 0;
40712  *(double *) itemp = value;
40713  return 1;
40714 }
40715 
40716 /* ObjectToMemviewSlice */
40717  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *obj, int writable_flag) {
40718  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
40719  __Pyx_BufFmt_StackElem stack[1];
40720  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
40721  int retcode;
40722  if (obj == Py_None) {
40723  result.memview = (struct __pyx_memoryview_obj *) Py_None;
40724  return result;
40725  }
40726  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
40727  PyBUF_RECORDS_RO | writable_flag, 2,
40728  &__Pyx_TypeInfo_int, stack,
40729  &result, obj);
40730  if (unlikely(retcode == -1))
40731  goto __pyx_fail;
40732  return result;
40733 __pyx_fail:
40734  result.memview = NULL;
40735  result.data = NULL;
40736  return result;
40737 }
40738 
40739 /* Print */
40740  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
40741 static PyObject *__Pyx_GetStdout(void) {
40742  PyObject *f = PySys_GetObject((char *)"stdout");
40743  if (!f) {
40744  PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
40745  }
40746  return f;
40747 }
40748 static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
40749  int i;
40750  if (!f) {
40751  if (!(f = __Pyx_GetStdout()))
40752  return -1;
40753  }
40754  Py_INCREF(f);
40755  for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
40756  PyObject* v;
40757  if (PyFile_SoftSpace(f, 1)) {
40758  if (PyFile_WriteString(" ", f) < 0)
40759  goto error;
40760  }
40761  v = PyTuple_GET_ITEM(arg_tuple, i);
40762  if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
40763  goto error;
40764  if (PyString_Check(v)) {
40765  char *s = PyString_AsString(v);
40766  Py_ssize_t len = PyString_Size(v);
40767  if (len > 0) {
40768  switch (s[len-1]) {
40769  case ' ': break;
40770  case '\f': case '\r': case '\n': case '\t': case '\v':
40771  PyFile_SoftSpace(f, 0);
40772  break;
40773  default: break;
40774  }
40775  }
40776  }
40777  }
40778  if (newline) {
40779  if (PyFile_WriteString("\n", f) < 0)
40780  goto error;
40781  PyFile_SoftSpace(f, 0);
40782  }
40783  Py_DECREF(f);
40784  return 0;
40785 error:
40786  Py_DECREF(f);
40787  return -1;
40788 }
40789 #else
40790 static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
40791  PyObject* kwargs = 0;
40792  PyObject* result = 0;
40793  PyObject* end_string;
40794  if (unlikely(!__pyx_print)) {
40795  __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
40796  if (!__pyx_print)
40797  return -1;
40798  }
40799  if (stream) {
40800  kwargs = PyDict_New();
40801  if (unlikely(!kwargs))
40802  return -1;
40803  if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
40804  goto bad;
40805  if (!newline) {
40806  end_string = PyUnicode_FromStringAndSize(" ", 1);
40807  if (unlikely(!end_string))
40808  goto bad;
40809  if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
40810  Py_DECREF(end_string);
40811  goto bad;
40812  }
40813  Py_DECREF(end_string);
40814  }
40815  } else if (!newline) {
40816  if (unlikely(!__pyx_print_kwargs)) {
40817  __pyx_print_kwargs = PyDict_New();
40818  if (unlikely(!__pyx_print_kwargs))
40819  return -1;
40820  end_string = PyUnicode_FromStringAndSize(" ", 1);
40821  if (unlikely(!end_string))
40822  return -1;
40823  if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
40824  Py_DECREF(end_string);
40825  return -1;
40826  }
40827  Py_DECREF(end_string);
40828  }
40829  kwargs = __pyx_print_kwargs;
40830  }
40831  result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
40832  if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
40833  Py_DECREF(kwargs);
40834  if (!result)
40835  return -1;
40836  Py_DECREF(result);
40837  return 0;
40838 bad:
40839  if (kwargs != __pyx_print_kwargs)
40840  Py_XDECREF(kwargs);
40841  return -1;
40842 }
40843 #endif
40844 
40845 /* MemviewDtypeToObject */
40846  static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
40847  return (PyObject *) __Pyx_PyInt_From_int(*(int *) itemp);
40848 }
40849 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
40850  int value = __Pyx_PyInt_As_int(obj);
40851  if ((value == (int)-1) && PyErr_Occurred())
40852  return 0;
40853  *(int *) itemp = value;
40854  return 1;
40855 }
40856 
40857 /* Declarations */
40858  #if CYTHON_CCOMPLEX
40859  #ifdef __cplusplus
40860  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
40861  return ::std::complex< float >(x, y);
40862  }
40863  #else
40864  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
40865  return x + y*(__pyx_t_float_complex)_Complex_I;
40866  }
40867  #endif
40868 #else
40869  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
40870  __pyx_t_float_complex z;
40871  z.real = x;
40872  z.imag = y;
40873  return z;
40874  }
40875 #endif
40876 
40877 /* Arithmetic */
40878  #if CYTHON_CCOMPLEX
40879 #else
40880  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40881  return (a.real == b.real) && (a.imag == b.imag);
40882  }
40883  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40884  __pyx_t_float_complex z;
40885  z.real = a.real + b.real;
40886  z.imag = a.imag + b.imag;
40887  return z;
40888  }
40889  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40890  __pyx_t_float_complex z;
40891  z.real = a.real - b.real;
40892  z.imag = a.imag - b.imag;
40893  return z;
40894  }
40895  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40896  __pyx_t_float_complex z;
40897  z.real = a.real * b.real - a.imag * b.imag;
40898  z.imag = a.real * b.imag + a.imag * b.real;
40899  return z;
40900  }
40901  #if 1
40902  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40903  if (b.imag == 0) {
40904  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
40905  } else if (fabsf(b.real) >= fabsf(b.imag)) {
40906  if (b.real == 0 && b.imag == 0) {
40907  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
40908  } else {
40909  float r = b.imag / b.real;
40910  float s = (float)(1.0) / (b.real + b.imag * r);
40911  return __pyx_t_float_complex_from_parts(
40912  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
40913  }
40914  } else {
40915  float r = b.real / b.imag;
40916  float s = (float)(1.0) / (b.imag + b.real * r);
40917  return __pyx_t_float_complex_from_parts(
40918  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
40919  }
40920  }
40921  #else
40922  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40923  if (b.imag == 0) {
40924  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
40925  } else {
40926  float denom = b.real * b.real + b.imag * b.imag;
40927  return __pyx_t_float_complex_from_parts(
40928  (a.real * b.real + a.imag * b.imag) / denom,
40929  (a.imag * b.real - a.real * b.imag) / denom);
40930  }
40931  }
40932  #endif
40933  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
40934  __pyx_t_float_complex z;
40935  z.real = -a.real;
40936  z.imag = -a.imag;
40937  return z;
40938  }
40939  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
40940  return (a.real == 0) && (a.imag == 0);
40941  }
40942  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
40943  __pyx_t_float_complex z;
40944  z.real = a.real;
40945  z.imag = -a.imag;
40946  return z;
40947  }
40948  #if 1
40949  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
40950  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
40951  return sqrtf(z.real*z.real + z.imag*z.imag);
40952  #else
40953  return hypotf(z.real, z.imag);
40954  #endif
40955  }
40956  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
40957  __pyx_t_float_complex z;
40958  float r, lnr, theta, z_r, z_theta;
40959  if (b.imag == 0 && b.real == (int)b.real) {
40960  if (b.real < 0) {
40961  float denom = a.real * a.real + a.imag * a.imag;
40962  a.real = a.real / denom;
40963  a.imag = -a.imag / denom;
40964  b.real = -b.real;
40965  }
40966  switch ((int)b.real) {
40967  case 0:
40968  z.real = 1;
40969  z.imag = 0;
40970  return z;
40971  case 1:
40972  return a;
40973  case 2:
40974  return __Pyx_c_prod_float(a, a);
40975  case 3:
40976  z = __Pyx_c_prod_float(a, a);
40977  return __Pyx_c_prod_float(z, a);
40978  case 4:
40979  z = __Pyx_c_prod_float(a, a);
40980  return __Pyx_c_prod_float(z, z);
40981  }
40982  }
40983  if (a.imag == 0) {
40984  if (a.real == 0) {
40985  return a;
40986  } else if (b.imag == 0) {
40987  z.real = powf(a.real, b.real);
40988  z.imag = 0;
40989  return z;
40990  } else if (a.real > 0) {
40991  r = a.real;
40992  theta = 0;
40993  } else {
40994  r = -a.real;
40995  theta = atan2f(0.0, -1.0);
40996  }
40997  } else {
40998  r = __Pyx_c_abs_float(a);
40999  theta = atan2f(a.imag, a.real);
41000  }
41001  lnr = logf(r);
41002  z_r = expf(lnr * b.real - theta * b.imag);
41003  z_theta = theta * b.real + lnr * b.imag;
41004  z.real = z_r * cosf(z_theta);
41005  z.imag = z_r * sinf(z_theta);
41006  return z;
41007  }
41008  #endif
41009 #endif
41010 
41011 /* Declarations */
41012  #if CYTHON_CCOMPLEX
41013  #ifdef __cplusplus
41014  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
41015  return ::std::complex< double >(x, y);
41016  }
41017  #else
41018  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
41019  return x + y*(__pyx_t_double_complex)_Complex_I;
41020  }
41021  #endif
41022 #else
41023  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
41024  __pyx_t_double_complex z;
41025  z.real = x;
41026  z.imag = y;
41027  return z;
41028  }
41029 #endif
41030 
41031 /* Arithmetic */
41032  #if CYTHON_CCOMPLEX
41033 #else
41034  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41035  return (a.real == b.real) && (a.imag == b.imag);
41036  }
41037  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41038  __pyx_t_double_complex z;
41039  z.real = a.real + b.real;
41040  z.imag = a.imag + b.imag;
41041  return z;
41042  }
41043  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41044  __pyx_t_double_complex z;
41045  z.real = a.real - b.real;
41046  z.imag = a.imag - b.imag;
41047  return z;
41048  }
41049  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41050  __pyx_t_double_complex z;
41051  z.real = a.real * b.real - a.imag * b.imag;
41052  z.imag = a.real * b.imag + a.imag * b.real;
41053  return z;
41054  }
41055  #if 1
41056  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41057  if (b.imag == 0) {
41058  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
41059  } else if (fabs(b.real) >= fabs(b.imag)) {
41060  if (b.real == 0 && b.imag == 0) {
41061  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
41062  } else {
41063  double r = b.imag / b.real;
41064  double s = (double)(1.0) / (b.real + b.imag * r);
41065  return __pyx_t_double_complex_from_parts(
41066  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
41067  }
41068  } else {
41069  double r = b.real / b.imag;
41070  double s = (double)(1.0) / (b.imag + b.real * r);
41071  return __pyx_t_double_complex_from_parts(
41072  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
41073  }
41074  }
41075  #else
41076  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41077  if (b.imag == 0) {
41078  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
41079  } else {
41080  double denom = b.real * b.real + b.imag * b.imag;
41081  return __pyx_t_double_complex_from_parts(
41082  (a.real * b.real + a.imag * b.imag) / denom,
41083  (a.imag * b.real - a.real * b.imag) / denom);
41084  }
41085  }
41086  #endif
41087  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
41088  __pyx_t_double_complex z;
41089  z.real = -a.real;
41090  z.imag = -a.imag;
41091  return z;
41092  }
41093  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
41094  return (a.real == 0) && (a.imag == 0);
41095  }
41096  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
41097  __pyx_t_double_complex z;
41098  z.real = a.real;
41099  z.imag = -a.imag;
41100  return z;
41101  }
41102  #if 1
41103  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
41104  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
41105  return sqrt(z.real*z.real + z.imag*z.imag);
41106  #else
41107  return hypot(z.real, z.imag);
41108  #endif
41109  }
41110  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
41111  __pyx_t_double_complex z;
41112  double r, lnr, theta, z_r, z_theta;
41113  if (b.imag == 0 && b.real == (int)b.real) {
41114  if (b.real < 0) {
41115  double denom = a.real * a.real + a.imag * a.imag;
41116  a.real = a.real / denom;
41117  a.imag = -a.imag / denom;
41118  b.real = -b.real;
41119  }
41120  switch ((int)b.real) {
41121  case 0:
41122  z.real = 1;
41123  z.imag = 0;
41124  return z;
41125  case 1:
41126  return a;
41127  case 2:
41128  return __Pyx_c_prod_double(a, a);
41129  case 3:
41130  z = __Pyx_c_prod_double(a, a);
41131  return __Pyx_c_prod_double(z, a);
41132  case 4:
41133  z = __Pyx_c_prod_double(a, a);
41134  return __Pyx_c_prod_double(z, z);
41135  }
41136  }
41137  if (a.imag == 0) {
41138  if (a.real == 0) {
41139  return a;
41140  } else if (b.imag == 0) {
41141  z.real = pow(a.real, b.real);
41142  z.imag = 0;
41143  return z;
41144  } else if (a.real > 0) {
41145  r = a.real;
41146  theta = 0;
41147  } else {
41148  r = -a.real;
41149  theta = atan2(0.0, -1.0);
41150  }
41151  } else {
41152  r = __Pyx_c_abs_double(a);
41153  theta = atan2(a.imag, a.real);
41154  }
41155  lnr = log(r);
41156  z_r = exp(lnr * b.real - theta * b.imag);
41157  z_theta = theta * b.real + lnr * b.imag;
41158  z.real = z_r * cos(z_theta);
41159  z.imag = z_r * sin(z_theta);
41160  return z;
41161  }
41162  #endif
41163 #endif
41164 
41165 /* MemviewSliceCopyTemplate */
41166  static __Pyx_memviewslice
41167 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
41168  const char *mode, int ndim,
41169  size_t sizeof_dtype, int contig_flag,
41170  int dtype_is_object)
41171 {
41172  __Pyx_RefNannyDeclarations
41173  int i;
41174  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
41175  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
41176  Py_buffer *buf = &from_memview->view;
41177  PyObject *shape_tuple = NULL;
41178  PyObject *temp_int = NULL;
41179  struct __pyx_array_obj *array_obj = NULL;
41180  struct __pyx_memoryview_obj *memview_obj = NULL;
41181  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
41182  for (i = 0; i < ndim; i++) {
41183  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
41184  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
41185  "indirect dimensions (axis %d)", i);
41186  goto fail;
41187  }
41188  }
41189  shape_tuple = PyTuple_New(ndim);
41190  if (unlikely(!shape_tuple)) {
41191  goto fail;
41192  }
41193  __Pyx_GOTREF(shape_tuple);
41194  for(i = 0; i < ndim; i++) {
41195  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
41196  if(unlikely(!temp_int)) {
41197  goto fail;
41198  } else {
41199  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
41200  temp_int = NULL;
41201  }
41202  }
41203  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
41204  if (unlikely(!array_obj)) {
41205  goto fail;
41206  }
41207  __Pyx_GOTREF(array_obj);
41208  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
41209  (PyObject *) array_obj, contig_flag,
41210  dtype_is_object,
41211  from_mvs->memview->typeinfo);
41212  if (unlikely(!memview_obj))
41213  goto fail;
41214  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
41215  goto fail;
41216  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
41217  dtype_is_object) < 0))
41218  goto fail;
41219  goto no_fail;
41220 fail:
41221  __Pyx_XDECREF(new_mvs.memview);
41222  new_mvs.memview = NULL;
41223  new_mvs.data = NULL;
41224 no_fail:
41225  __Pyx_XDECREF(shape_tuple);
41226  __Pyx_XDECREF(temp_int);
41227  __Pyx_XDECREF(array_obj);
41228  __Pyx_RefNannyFinishContext();
41229  return new_mvs;
41230 }
41231 
41232 /* CIntFromPy */
41233  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
41234 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41235 #pragma GCC diagnostic push
41236 #pragma GCC diagnostic ignored "-Wconversion"
41237 #endif
41238  const int neg_one = (int) -1, const_zero = (int) 0;
41239 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41240 #pragma GCC diagnostic pop
41241 #endif
41242  const int is_unsigned = neg_one > const_zero;
41243 #if PY_MAJOR_VERSION < 3
41244  if (likely(PyInt_Check(x))) {
41245  if (sizeof(int) < sizeof(long)) {
41246  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
41247  } else {
41248  long val = PyInt_AS_LONG(x);
41249  if (is_unsigned && unlikely(val < 0)) {
41250  goto raise_neg_overflow;
41251  }
41252  return (int) val;
41253  }
41254  } else
41255 #endif
41256  if (likely(PyLong_Check(x))) {
41257  if (is_unsigned) {
41258 #if CYTHON_USE_PYLONG_INTERNALS
41259  const digit* digits = ((PyLongObject*)x)->ob_digit;
41260  switch (Py_SIZE(x)) {
41261  case 0: return (int) 0;
41262  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
41263  case 2:
41264  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
41265  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41266  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41267  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
41268  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
41269  }
41270  }
41271  break;
41272  case 3:
41273  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
41274  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41275  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41276  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
41277  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
41278  }
41279  }
41280  break;
41281  case 4:
41282  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
41283  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41284  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41285  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
41286  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
41287  }
41288  }
41289  break;
41290  }
41291 #endif
41292 #if CYTHON_COMPILING_IN_CPYTHON
41293  if (unlikely(Py_SIZE(x) < 0)) {
41294  goto raise_neg_overflow;
41295  }
41296 #else
41297  {
41298  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
41299  if (unlikely(result < 0))
41300  return (int) -1;
41301  if (unlikely(result == 1))
41302  goto raise_neg_overflow;
41303  }
41304 #endif
41305  if (sizeof(int) <= sizeof(unsigned long)) {
41306  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
41307 #ifdef HAVE_LONG_LONG
41308  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
41309  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
41310 #endif
41311  }
41312  } else {
41313 #if CYTHON_USE_PYLONG_INTERNALS
41314  const digit* digits = ((PyLongObject*)x)->ob_digit;
41315  switch (Py_SIZE(x)) {
41316  case 0: return (int) 0;
41317  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
41318  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
41319  case -2:
41320  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
41321  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41322  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41323  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
41324  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41325  }
41326  }
41327  break;
41328  case 2:
41329  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
41330  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41331  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41332  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
41333  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41334  }
41335  }
41336  break;
41337  case -3:
41338  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
41339  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41340  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41341  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
41342  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41343  }
41344  }
41345  break;
41346  case 3:
41347  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
41348  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41349  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41350  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
41351  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41352  }
41353  }
41354  break;
41355  case -4:
41356  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
41357  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41358  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41359  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
41360  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41361  }
41362  }
41363  break;
41364  case 4:
41365  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
41366  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41367  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41368  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
41369  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41370  }
41371  }
41372  break;
41373  }
41374 #endif
41375  if (sizeof(int) <= sizeof(long)) {
41376  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
41377 #ifdef HAVE_LONG_LONG
41378  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
41379  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
41380 #endif
41381  }
41382  }
41383  {
41384 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
41385  PyErr_SetString(PyExc_RuntimeError,
41386  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
41387 #else
41388  int val;
41389  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
41390  #if PY_MAJOR_VERSION < 3
41391  if (likely(v) && !PyLong_Check(v)) {
41392  PyObject *tmp = v;
41393  v = PyNumber_Long(tmp);
41394  Py_DECREF(tmp);
41395  }
41396  #endif
41397  if (likely(v)) {
41398  int one = 1; int is_little = (int)*(unsigned char *)&one;
41399  unsigned char *bytes = (unsigned char *)&val;
41400  int ret = _PyLong_AsByteArray((PyLongObject *)v,
41401  bytes, sizeof(val),
41402  is_little, !is_unsigned);
41403  Py_DECREF(v);
41404  if (likely(!ret))
41405  return val;
41406  }
41407 #endif
41408  return (int) -1;
41409  }
41410  } else {
41411  int val;
41412  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
41413  if (!tmp) return (int) -1;
41414  val = __Pyx_PyInt_As_int(tmp);
41415  Py_DECREF(tmp);
41416  return val;
41417  }
41418 raise_overflow:
41419  PyErr_SetString(PyExc_OverflowError,
41420  "value too large to convert to int");
41421  return (int) -1;
41422 raise_neg_overflow:
41423  PyErr_SetString(PyExc_OverflowError,
41424  "can't convert negative value to int");
41425  return (int) -1;
41426 }
41427 
41428 /* CIntToPy */
41429  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
41430 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41431 #pragma GCC diagnostic push
41432 #pragma GCC diagnostic ignored "-Wconversion"
41433 #endif
41434  const int neg_one = (int) -1, const_zero = (int) 0;
41435 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41436 #pragma GCC diagnostic pop
41437 #endif
41438  const int is_unsigned = neg_one > const_zero;
41439  if (is_unsigned) {
41440  if (sizeof(int) < sizeof(long)) {
41441  return PyInt_FromLong((long) value);
41442  } else if (sizeof(int) <= sizeof(unsigned long)) {
41443  return PyLong_FromUnsignedLong((unsigned long) value);
41444 #ifdef HAVE_LONG_LONG
41445  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
41446  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
41447 #endif
41448  }
41449  } else {
41450  if (sizeof(int) <= sizeof(long)) {
41451  return PyInt_FromLong((long) value);
41452 #ifdef HAVE_LONG_LONG
41453  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
41454  return PyLong_FromLongLong((PY_LONG_LONG) value);
41455 #endif
41456  }
41457  }
41458  {
41459  int one = 1; int little = (int)*(unsigned char *)&one;
41460  unsigned char *bytes = (unsigned char *)&value;
41461  return _PyLong_FromByteArray(bytes, sizeof(int),
41462  little, !is_unsigned);
41463  }
41464 }
41465 
41466 /* CIntToPy */
41467  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
41468 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41469 #pragma GCC diagnostic push
41470 #pragma GCC diagnostic ignored "-Wconversion"
41471 #endif
41472  const long neg_one = (long) -1, const_zero = (long) 0;
41473 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41474 #pragma GCC diagnostic pop
41475 #endif
41476  const int is_unsigned = neg_one > const_zero;
41477  if (is_unsigned) {
41478  if (sizeof(long) < sizeof(long)) {
41479  return PyInt_FromLong((long) value);
41480  } else if (sizeof(long) <= sizeof(unsigned long)) {
41481  return PyLong_FromUnsignedLong((unsigned long) value);
41482 #ifdef HAVE_LONG_LONG
41483  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
41484  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
41485 #endif
41486  }
41487  } else {
41488  if (sizeof(long) <= sizeof(long)) {
41489  return PyInt_FromLong((long) value);
41490 #ifdef HAVE_LONG_LONG
41491  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
41492  return PyLong_FromLongLong((PY_LONG_LONG) value);
41493 #endif
41494  }
41495  }
41496  {
41497  int one = 1; int little = (int)*(unsigned char *)&one;
41498  unsigned char *bytes = (unsigned char *)&value;
41499  return _PyLong_FromByteArray(bytes, sizeof(long),
41500  little, !is_unsigned);
41501  }
41502 }
41503 
41504 /* TypeInfoToFormat */
41505  static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
41506  struct __pyx_typeinfo_string result = { {0} };
41507  char *buf = (char *) result.string;
41508  size_t size = type->size;
41509  switch (type->typegroup) {
41510  case 'H':
41511  *buf = 'c';
41512  break;
41513  case 'I':
41514  case 'U':
41515  if (size == 1)
41516  *buf = (type->is_unsigned) ? 'B' : 'b';
41517  else if (size == 2)
41518  *buf = (type->is_unsigned) ? 'H' : 'h';
41519  else if (size == 4)
41520  *buf = (type->is_unsigned) ? 'I' : 'i';
41521  else if (size == 8)
41522  *buf = (type->is_unsigned) ? 'Q' : 'q';
41523  break;
41524  case 'P':
41525  *buf = 'P';
41526  break;
41527  case 'C':
41528  {
41529  __Pyx_TypeInfo complex_type = *type;
41530  complex_type.typegroup = 'R';
41531  complex_type.size /= 2;
41532  *buf++ = 'Z';
41533  *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
41534  break;
41535  }
41536  case 'R':
41537  if (size == 4)
41538  *buf = 'f';
41539  else if (size == 8)
41540  *buf = 'd';
41541  else
41542  *buf = 'g';
41543  break;
41544  }
41545  return result;
41546 }
41547 
41548 /* PrintOne */
41549  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
41550 static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
41551  if (!f) {
41552  if (!(f = __Pyx_GetStdout()))
41553  return -1;
41554  }
41555  Py_INCREF(f);
41556  if (PyFile_SoftSpace(f, 0)) {
41557  if (PyFile_WriteString(" ", f) < 0)
41558  goto error;
41559  }
41560  if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
41561  goto error;
41562  if (PyFile_WriteString("\n", f) < 0)
41563  goto error;
41564  Py_DECREF(f);
41565  return 0;
41566 error:
41567  Py_DECREF(f);
41568  return -1;
41569  /* the line below is just to avoid C compiler
41570  * warnings about unused functions */
41571  return __Pyx_Print(f, NULL, 0);
41572 }
41573 #else
41574 static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
41575  int res;
41576  PyObject* arg_tuple = PyTuple_Pack(1, o);
41577  if (unlikely(!arg_tuple))
41578  return -1;
41579  res = __Pyx_Print(stream, arg_tuple, 1);
41580  Py_DECREF(arg_tuple);
41581  return res;
41582 }
41583 #endif
41584 
41585 /* CIntFromPy */
41586  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
41587 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41588 #pragma GCC diagnostic push
41589 #pragma GCC diagnostic ignored "-Wconversion"
41590 #endif
41591  const long neg_one = (long) -1, const_zero = (long) 0;
41592 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41593 #pragma GCC diagnostic pop
41594 #endif
41595  const int is_unsigned = neg_one > const_zero;
41596 #if PY_MAJOR_VERSION < 3
41597  if (likely(PyInt_Check(x))) {
41598  if (sizeof(long) < sizeof(long)) {
41599  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
41600  } else {
41601  long val = PyInt_AS_LONG(x);
41602  if (is_unsigned && unlikely(val < 0)) {
41603  goto raise_neg_overflow;
41604  }
41605  return (long) val;
41606  }
41607  } else
41608 #endif
41609  if (likely(PyLong_Check(x))) {
41610  if (is_unsigned) {
41611 #if CYTHON_USE_PYLONG_INTERNALS
41612  const digit* digits = ((PyLongObject*)x)->ob_digit;
41613  switch (Py_SIZE(x)) {
41614  case 0: return (long) 0;
41615  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
41616  case 2:
41617  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
41618  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41619  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41620  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
41621  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
41622  }
41623  }
41624  break;
41625  case 3:
41626  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
41627  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41628  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41629  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
41630  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
41631  }
41632  }
41633  break;
41634  case 4:
41635  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
41636  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41637  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41638  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
41639  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
41640  }
41641  }
41642  break;
41643  }
41644 #endif
41645 #if CYTHON_COMPILING_IN_CPYTHON
41646  if (unlikely(Py_SIZE(x) < 0)) {
41647  goto raise_neg_overflow;
41648  }
41649 #else
41650  {
41651  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
41652  if (unlikely(result < 0))
41653  return (long) -1;
41654  if (unlikely(result == 1))
41655  goto raise_neg_overflow;
41656  }
41657 #endif
41658  if (sizeof(long) <= sizeof(unsigned long)) {
41659  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
41660 #ifdef HAVE_LONG_LONG
41661  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
41662  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
41663 #endif
41664  }
41665  } else {
41666 #if CYTHON_USE_PYLONG_INTERNALS
41667  const digit* digits = ((PyLongObject*)x)->ob_digit;
41668  switch (Py_SIZE(x)) {
41669  case 0: return (long) 0;
41670  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
41671  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
41672  case -2:
41673  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
41674  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41675  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41676  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
41677  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
41678  }
41679  }
41680  break;
41681  case 2:
41682  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
41683  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41684  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41685  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
41686  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
41687  }
41688  }
41689  break;
41690  case -3:
41691  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
41692  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41693  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41694  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
41695  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
41696  }
41697  }
41698  break;
41699  case 3:
41700  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
41701  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41702  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41703  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
41704  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
41705  }
41706  }
41707  break;
41708  case -4:
41709  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
41710  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41711  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41712  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
41713  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
41714  }
41715  }
41716  break;
41717  case 4:
41718  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
41719  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41720  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41721  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
41722  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
41723  }
41724  }
41725  break;
41726  }
41727 #endif
41728  if (sizeof(long) <= sizeof(long)) {
41729  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
41730 #ifdef HAVE_LONG_LONG
41731  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
41732  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
41733 #endif
41734  }
41735  }
41736  {
41737 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
41738  PyErr_SetString(PyExc_RuntimeError,
41739  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
41740 #else
41741  long val;
41742  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
41743  #if PY_MAJOR_VERSION < 3
41744  if (likely(v) && !PyLong_Check(v)) {
41745  PyObject *tmp = v;
41746  v = PyNumber_Long(tmp);
41747  Py_DECREF(tmp);
41748  }
41749  #endif
41750  if (likely(v)) {
41751  int one = 1; int is_little = (int)*(unsigned char *)&one;
41752  unsigned char *bytes = (unsigned char *)&val;
41753  int ret = _PyLong_AsByteArray((PyLongObject *)v,
41754  bytes, sizeof(val),
41755  is_little, !is_unsigned);
41756  Py_DECREF(v);
41757  if (likely(!ret))
41758  return val;
41759  }
41760 #endif
41761  return (long) -1;
41762  }
41763  } else {
41764  long val;
41765  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
41766  if (!tmp) return (long) -1;
41767  val = __Pyx_PyInt_As_long(tmp);
41768  Py_DECREF(tmp);
41769  return val;
41770  }
41771 raise_overflow:
41772  PyErr_SetString(PyExc_OverflowError,
41773  "value too large to convert to long");
41774  return (long) -1;
41775 raise_neg_overflow:
41776  PyErr_SetString(PyExc_OverflowError,
41777  "can't convert negative value to long");
41778  return (long) -1;
41779 }
41780 
41781 /* CIntFromPy */
41782  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
41783 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41784 #pragma GCC diagnostic push
41785 #pragma GCC diagnostic ignored "-Wconversion"
41786 #endif
41787  const char neg_one = (char) -1, const_zero = (char) 0;
41788 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41789 #pragma GCC diagnostic pop
41790 #endif
41791  const int is_unsigned = neg_one > const_zero;
41792 #if PY_MAJOR_VERSION < 3
41793  if (likely(PyInt_Check(x))) {
41794  if (sizeof(char) < sizeof(long)) {
41795  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
41796  } else {
41797  long val = PyInt_AS_LONG(x);
41798  if (is_unsigned && unlikely(val < 0)) {
41799  goto raise_neg_overflow;
41800  }
41801  return (char) val;
41802  }
41803  } else
41804 #endif
41805  if (likely(PyLong_Check(x))) {
41806  if (is_unsigned) {
41807 #if CYTHON_USE_PYLONG_INTERNALS
41808  const digit* digits = ((PyLongObject*)x)->ob_digit;
41809  switch (Py_SIZE(x)) {
41810  case 0: return (char) 0;
41811  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
41812  case 2:
41813  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
41814  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41815  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41816  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
41817  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
41818  }
41819  }
41820  break;
41821  case 3:
41822  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
41823  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41824  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41825  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
41826  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
41827  }
41828  }
41829  break;
41830  case 4:
41831  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
41832  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41833  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41834  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
41835  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
41836  }
41837  }
41838  break;
41839  }
41840 #endif
41841 #if CYTHON_COMPILING_IN_CPYTHON
41842  if (unlikely(Py_SIZE(x) < 0)) {
41843  goto raise_neg_overflow;
41844  }
41845 #else
41846  {
41847  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
41848  if (unlikely(result < 0))
41849  return (char) -1;
41850  if (unlikely(result == 1))
41851  goto raise_neg_overflow;
41852  }
41853 #endif
41854  if (sizeof(char) <= sizeof(unsigned long)) {
41855  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
41856 #ifdef HAVE_LONG_LONG
41857  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
41858  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
41859 #endif
41860  }
41861  } else {
41862 #if CYTHON_USE_PYLONG_INTERNALS
41863  const digit* digits = ((PyLongObject*)x)->ob_digit;
41864  switch (Py_SIZE(x)) {
41865  case 0: return (char) 0;
41866  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
41867  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
41868  case -2:
41869  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
41870  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41871  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41872  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
41873  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
41874  }
41875  }
41876  break;
41877  case 2:
41878  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
41879  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41880  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41881  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
41882  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
41883  }
41884  }
41885  break;
41886  case -3:
41887  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
41888  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41889  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41890  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
41891  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
41892  }
41893  }
41894  break;
41895  case 3:
41896  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
41897  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41898  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41899  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
41900  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
41901  }
41902  }
41903  break;
41904  case -4:
41905  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
41906  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41907  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41908  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
41909  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
41910  }
41911  }
41912  break;
41913  case 4:
41914  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
41915  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41916  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41917  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
41918  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
41919  }
41920  }
41921  break;
41922  }
41923 #endif
41924  if (sizeof(char) <= sizeof(long)) {
41925  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
41926 #ifdef HAVE_LONG_LONG
41927  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
41928  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
41929 #endif
41930  }
41931  }
41932  {
41933 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
41934  PyErr_SetString(PyExc_RuntimeError,
41935  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
41936 #else
41937  char val;
41938  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
41939  #if PY_MAJOR_VERSION < 3
41940  if (likely(v) && !PyLong_Check(v)) {
41941  PyObject *tmp = v;
41942  v = PyNumber_Long(tmp);
41943  Py_DECREF(tmp);
41944  }
41945  #endif
41946  if (likely(v)) {
41947  int one = 1; int is_little = (int)*(unsigned char *)&one;
41948  unsigned char *bytes = (unsigned char *)&val;
41949  int ret = _PyLong_AsByteArray((PyLongObject *)v,
41950  bytes, sizeof(val),
41951  is_little, !is_unsigned);
41952  Py_DECREF(v);
41953  if (likely(!ret))
41954  return val;
41955  }
41956 #endif
41957  return (char) -1;
41958  }
41959  } else {
41960  char val;
41961  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
41962  if (!tmp) return (char) -1;
41963  val = __Pyx_PyInt_As_char(tmp);
41964  Py_DECREF(tmp);
41965  return val;
41966  }
41967 raise_overflow:
41968  PyErr_SetString(PyExc_OverflowError,
41969  "value too large to convert to char");
41970  return (char) -1;
41971 raise_neg_overflow:
41972  PyErr_SetString(PyExc_OverflowError,
41973  "can't convert negative value to char");
41974  return (char) -1;
41975 }
41976 
41977 /* FetchCommonType */
41978  static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
41979  PyObject* fake_module;
41980  PyTypeObject* cached_type = NULL;
41981  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
41982  if (!fake_module) return NULL;
41983  Py_INCREF(fake_module);
41984  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
41985  if (cached_type) {
41986  if (!PyType_Check((PyObject*)cached_type)) {
41987  PyErr_Format(PyExc_TypeError,
41988  "Shared Cython type %.200s is not a type object",
41989  type->tp_name);
41990  goto bad;
41991  }
41992  if (cached_type->tp_basicsize != type->tp_basicsize) {
41993  PyErr_Format(PyExc_TypeError,
41994  "Shared Cython type %.200s has the wrong size, try recompiling",
41995  type->tp_name);
41996  goto bad;
41997  }
41998  } else {
41999  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
42000  PyErr_Clear();
42001  if (PyType_Ready(type) < 0) goto bad;
42002  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
42003  goto bad;
42004  Py_INCREF(type);
42005  cached_type = type;
42006  }
42007 done:
42008  Py_DECREF(fake_module);
42009  return cached_type;
42010 bad:
42011  Py_XDECREF(cached_type);
42012  cached_type = NULL;
42013  goto done;
42014 }
42015 
42016 /* PyObjectGetMethod */
42017  static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
42018  PyObject *attr;
42019 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
42020  PyTypeObject *tp = Py_TYPE(obj);
42021  PyObject *descr;
42022  descrgetfunc f = NULL;
42023  PyObject **dictptr, *dict;
42024  int meth_found = 0;
42025  assert (*method == NULL);
42026  if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
42027  attr = __Pyx_PyObject_GetAttrStr(obj, name);
42028  goto try_unpack;
42029  }
42030  if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
42031  return 0;
42032  }
42033  descr = _PyType_Lookup(tp, name);
42034  if (likely(descr != NULL)) {
42035  Py_INCREF(descr);
42036 #if PY_MAJOR_VERSION >= 3
42037  #ifdef __Pyx_CyFunction_USED
42038  if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
42039  #else
42040  if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
42041  #endif
42042 #else
42043  #ifdef __Pyx_CyFunction_USED
42044  if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
42045  #else
42046  if (likely(PyFunction_Check(descr)))
42047  #endif
42048 #endif
42049  {
42050  meth_found = 1;
42051  } else {
42052  f = Py_TYPE(descr)->tp_descr_get;
42053  if (f != NULL && PyDescr_IsData(descr)) {
42054  attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
42055  Py_DECREF(descr);
42056  goto try_unpack;
42057  }
42058  }
42059  }
42060  dictptr = _PyObject_GetDictPtr(obj);
42061  if (dictptr != NULL && (dict = *dictptr) != NULL) {
42062  Py_INCREF(dict);
42063  attr = __Pyx_PyDict_GetItemStr(dict, name);
42064  if (attr != NULL) {
42065  Py_INCREF(attr);
42066  Py_DECREF(dict);
42067  Py_XDECREF(descr);
42068  goto try_unpack;
42069  }
42070  Py_DECREF(dict);
42071  }
42072  if (meth_found) {
42073  *method = descr;
42074  return 1;
42075  }
42076  if (f != NULL) {
42077  attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
42078  Py_DECREF(descr);
42079  goto try_unpack;
42080  }
42081  if (descr != NULL) {
42082  *method = descr;
42083  return 0;
42084  }
42085  PyErr_Format(PyExc_AttributeError,
42086 #if PY_MAJOR_VERSION >= 3
42087  "'%.50s' object has no attribute '%U'",
42088  tp->tp_name, name);
42089 #else
42090  "'%.50s' object has no attribute '%.400s'",
42091  tp->tp_name, PyString_AS_STRING(name));
42092 #endif
42093  return 0;
42094 #else
42095  attr = __Pyx_PyObject_GetAttrStr(obj, name);
42096  goto try_unpack;
42097 #endif
42098 try_unpack:
42099 #if CYTHON_UNPACK_METHODS
42100  if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
42101  PyObject *function = PyMethod_GET_FUNCTION(attr);
42102  Py_INCREF(function);
42103  Py_DECREF(attr);
42104  *method = function;
42105  return 1;
42106  }
42107 #endif
42108  *method = attr;
42109  return 0;
42110 }
42111 
42112 /* PyObjectCallMethod1 */
42113  static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
42114  PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
42115  Py_DECREF(method);
42116  return result;
42117 }
42118 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
42119  PyObject *method = NULL, *result;
42120  int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
42121  if (likely(is_method)) {
42122  result = __Pyx_PyObject_Call2Args(method, obj, arg);
42123  Py_DECREF(method);
42124  return result;
42125  }
42126  if (unlikely(!method)) return NULL;
42127  return __Pyx__PyObject_CallMethod1(method, arg);
42128 }
42129 
42130 /* CoroutineBase */
42131  #include <structmember.h>
42132 #include <frameobject.h>
42133 #if PY_VERSION_HEX >= 0x030b00a6
42134  #ifndef Py_BUILD_CORE
42135  #define Py_BUILD_CORE 1
42136  #endif
42137  #include "internal/pycore_frame.h"
42138 #endif
42139 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
42140 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
42141  PyObject *et, *ev, *tb;
42142  PyObject *value = NULL;
42143  __Pyx_ErrFetch(&et, &ev, &tb);
42144  if (!et) {
42145  Py_XDECREF(tb);
42146  Py_XDECREF(ev);
42147  Py_INCREF(Py_None);
42148  *pvalue = Py_None;
42149  return 0;
42150  }
42151  if (likely(et == PyExc_StopIteration)) {
42152  if (!ev) {
42153  Py_INCREF(Py_None);
42154  value = Py_None;
42155  }
42156 #if PY_VERSION_HEX >= 0x030300A0
42157  else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
42158  value = ((PyStopIterationObject *)ev)->value;
42159  Py_INCREF(value);
42160  Py_DECREF(ev);
42161  }
42162 #endif
42163  else if (unlikely(PyTuple_Check(ev))) {
42164  if (PyTuple_GET_SIZE(ev) >= 1) {
42165 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
42166  value = PyTuple_GET_ITEM(ev, 0);
42167  Py_INCREF(value);
42168 #else
42169  value = PySequence_ITEM(ev, 0);
42170 #endif
42171  } else {
42172  Py_INCREF(Py_None);
42173  value = Py_None;
42174  }
42175  Py_DECREF(ev);
42176  }
42177  else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
42178  value = ev;
42179  }
42180  if (likely(value)) {
42181  Py_XDECREF(tb);
42182  Py_DECREF(et);
42183  *pvalue = value;
42184  return 0;
42185  }
42186  } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
42187  __Pyx_ErrRestore(et, ev, tb);
42188  return -1;
42189  }
42190  PyErr_NormalizeException(&et, &ev, &tb);
42191  if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
42192  __Pyx_ErrRestore(et, ev, tb);
42193  return -1;
42194  }
42195  Py_XDECREF(tb);
42196  Py_DECREF(et);
42197 #if PY_VERSION_HEX >= 0x030300A0
42198  value = ((PyStopIterationObject *)ev)->value;
42199  Py_INCREF(value);
42200  Py_DECREF(ev);
42201 #else
42202  {
42203  PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
42204  Py_DECREF(ev);
42205  if (likely(args)) {
42206  value = PySequence_GetItem(args, 0);
42207  Py_DECREF(args);
42208  }
42209  if (unlikely(!value)) {
42210  __Pyx_ErrRestore(NULL, NULL, NULL);
42211  Py_INCREF(Py_None);
42212  value = Py_None;
42213  }
42214  }
42215 #endif
42216  *pvalue = value;
42217  return 0;
42218 }
42219 static CYTHON_INLINE
42220 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
42221  PyObject *t, *v, *tb;
42222  t = exc_state->exc_type;
42223  v = exc_state->exc_value;
42224  tb = exc_state->exc_traceback;
42225  exc_state->exc_type = NULL;
42226  exc_state->exc_value = NULL;
42227  exc_state->exc_traceback = NULL;
42228  Py_XDECREF(t);
42229  Py_XDECREF(v);
42230  Py_XDECREF(tb);
42231 }
42232 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
42233 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
42234  const char *msg;
42235  if ((0)) {
42236  #ifdef __Pyx_Coroutine_USED
42237  } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
42238  msg = "coroutine already executing";
42239  #endif
42240  #ifdef __Pyx_AsyncGen_USED
42241  } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
42242  msg = "async generator already executing";
42243  #endif
42244  } else {
42245  msg = "generator already executing";
42246  }
42247  PyErr_SetString(PyExc_ValueError, msg);
42248 }
42249 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
42250 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
42251  const char *msg;
42252  if ((0)) {
42253  #ifdef __Pyx_Coroutine_USED
42254  } else if (__Pyx_Coroutine_Check(gen)) {
42255  msg = "can't send non-None value to a just-started coroutine";
42256  #endif
42257  #ifdef __Pyx_AsyncGen_USED
42258  } else if (__Pyx_AsyncGen_CheckExact(gen)) {
42259  msg = "can't send non-None value to a just-started async generator";
42260  #endif
42261  } else {
42262  msg = "can't send non-None value to a just-started generator";
42263  }
42264  PyErr_SetString(PyExc_TypeError, msg);
42265 }
42266 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
42267 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
42268  #ifdef __Pyx_Coroutine_USED
42269  if (!closing && __Pyx_Coroutine_Check(gen)) {
42270  PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
42271  } else
42272  #endif
42273  if (value) {
42274  #ifdef __Pyx_AsyncGen_USED
42275  if (__Pyx_AsyncGen_CheckExact(gen))
42276  PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
42277  else
42278  #endif
42279  PyErr_SetNone(PyExc_StopIteration);
42280  }
42281 }
42282 static
42283 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
42284  __Pyx_PyThreadState_declare
42285  PyThreadState *tstate;
42286  __Pyx_ExcInfoStruct *exc_state;
42287  PyObject *retval;
42288  assert(!self->is_running);
42289  if (unlikely(self->resume_label == 0)) {
42290  if (unlikely(value && value != Py_None)) {
42291  return __Pyx_Coroutine_NotStartedError((PyObject*)self);
42292  }
42293  }
42294  if (unlikely(self->resume_label == -1)) {
42295  return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
42296  }
42297 #if CYTHON_FAST_THREAD_STATE
42298  __Pyx_PyThreadState_assign
42299  tstate = __pyx_tstate;
42300 #else
42301  tstate = __Pyx_PyThreadState_Current;
42302 #endif
42303  exc_state = &self->gi_exc_state;
42304  if (exc_state->exc_type) {
42305  #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
42306  #else
42307  if (exc_state->exc_traceback) {
42308  PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
42309  PyFrameObject *f = tb->tb_frame;
42310  assert(f->f_back == NULL);
42311  #if PY_VERSION_HEX >= 0x030B00A1
42312  f->f_back = PyThreadState_GetFrame(tstate);
42313  #else
42314  Py_XINCREF(tstate->frame);
42315  f->f_back = tstate->frame;
42316  #endif
42317  }
42318  #endif
42319  }
42320 #if CYTHON_USE_EXC_INFO_STACK
42321  exc_state->previous_item = tstate->exc_info;
42322  tstate->exc_info = exc_state;
42323 #else
42324  if (exc_state->exc_type) {
42325  __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
42326  } else {
42327  __Pyx_Coroutine_ExceptionClear(exc_state);
42328  __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
42329  }
42330 #endif
42331  self->is_running = 1;
42332  retval = self->body((PyObject *) self, tstate, value);
42333  self->is_running = 0;
42334 #if CYTHON_USE_EXC_INFO_STACK
42335  exc_state = &self->gi_exc_state;
42336  tstate->exc_info = exc_state->previous_item;
42337  exc_state->previous_item = NULL;
42338  __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
42339 #endif
42340  return retval;
42341 }
42342 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
42343  PyObject *exc_tb = exc_state->exc_traceback;
42344  if (likely(exc_tb)) {
42345 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
42346 #else
42347  PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
42348  PyFrameObject *f = tb->tb_frame;
42349  Py_CLEAR(f->f_back);
42350 #endif
42351  }
42352 }
42353 static CYTHON_INLINE
42354 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
42355  if (unlikely(!retval)) {
42356  __Pyx_PyThreadState_declare
42357  __Pyx_PyThreadState_assign
42358  if (!__Pyx_PyErr_Occurred()) {
42359  PyObject *exc = PyExc_StopIteration;
42360  #ifdef __Pyx_AsyncGen_USED
42361  if (__Pyx_AsyncGen_CheckExact(gen))
42362  exc = __Pyx_PyExc_StopAsyncIteration;
42363  #endif
42364  __Pyx_PyErr_SetNone(exc);
42365  }
42366  }
42367  return retval;
42368 }
42369 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
42370 static CYTHON_INLINE
42371 PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
42372 #if PY_VERSION_HEX <= 0x030A00A1
42373  return _PyGen_Send(gen, arg);
42374 #else
42375  PyObject *result;
42376  if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
42377  if (PyAsyncGen_CheckExact(gen)) {
42378  assert(result == Py_None);
42379  PyErr_SetNone(PyExc_StopAsyncIteration);
42380  }
42381  else if (result == Py_None) {
42382  PyErr_SetNone(PyExc_StopIteration);
42383  }
42384  else {
42385  _PyGen_SetStopIterationValue(result);
42386  }
42387  Py_CLEAR(result);
42388  }
42389  return result;
42390 #endif
42391 }
42392 #endif
42393 static CYTHON_INLINE
42394 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
42395  PyObject *ret;
42396  PyObject *val = NULL;
42397  __Pyx_Coroutine_Undelegate(gen);
42398  __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
42399  ret = __Pyx_Coroutine_SendEx(gen, val, 0);
42400  Py_XDECREF(val);
42401  return ret;
42402 }
42403 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
42404  PyObject *retval;
42405  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
42406  PyObject *yf = gen->yieldfrom;
42407  if (unlikely(gen->is_running))
42408  return __Pyx_Coroutine_AlreadyRunningError(gen);
42409  if (yf) {
42410  PyObject *ret;
42411  gen->is_running = 1;
42412  #ifdef __Pyx_Generator_USED
42413  if (__Pyx_Generator_CheckExact(yf)) {
42414  ret = __Pyx_Coroutine_Send(yf, value);
42415  } else
42416  #endif
42417  #ifdef __Pyx_Coroutine_USED
42418  if (__Pyx_Coroutine_Check(yf)) {
42419  ret = __Pyx_Coroutine_Send(yf, value);
42420  } else
42421  #endif
42422  #ifdef __Pyx_AsyncGen_USED
42423  if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
42424  ret = __Pyx_async_gen_asend_send(yf, value);
42425  } else
42426  #endif
42427  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
42428  if (PyGen_CheckExact(yf)) {
42429  ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
42430  } else
42431  #endif
42432  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
42433  if (PyCoro_CheckExact(yf)) {
42434  ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
42435  } else
42436  #endif
42437  {
42438  if (value == Py_None)
42439  ret = Py_TYPE(yf)->tp_iternext(yf);
42440  else
42441  ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
42442  }
42443  gen->is_running = 0;
42444  if (likely(ret)) {
42445  return ret;
42446  }
42447  retval = __Pyx_Coroutine_FinishDelegation(gen);
42448  } else {
42449  retval = __Pyx_Coroutine_SendEx(gen, value, 0);
42450  }
42451  return __Pyx_Coroutine_MethodReturn(self, retval);
42452 }
42453 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
42454  PyObject *retval = NULL;
42455  int err = 0;
42456  #ifdef __Pyx_Generator_USED
42457  if (__Pyx_Generator_CheckExact(yf)) {
42458  retval = __Pyx_Coroutine_Close(yf);
42459  if (!retval)
42460  return -1;
42461  } else
42462  #endif
42463  #ifdef __Pyx_Coroutine_USED
42464  if (__Pyx_Coroutine_Check(yf)) {
42465  retval = __Pyx_Coroutine_Close(yf);
42466  if (!retval)
42467  return -1;
42468  } else
42469  if (__Pyx_CoroutineAwait_CheckExact(yf)) {
42470  retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
42471  if (!retval)
42472  return -1;
42473  } else
42474  #endif
42475  #ifdef __Pyx_AsyncGen_USED
42476  if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
42477  retval = __Pyx_async_gen_asend_close(yf, NULL);
42478  } else
42479  if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
42480  retval = __Pyx_async_gen_athrow_close(yf, NULL);
42481  } else
42482  #endif
42483  {
42484  PyObject *meth;
42485  gen->is_running = 1;
42486  meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
42487  if (unlikely(!meth)) {
42488  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
42489  PyErr_WriteUnraisable(yf);
42490  }
42491  PyErr_Clear();
42492  } else {
42493  retval = PyObject_CallFunction(meth, NULL);
42494  Py_DECREF(meth);
42495  if (!retval)
42496  err = -1;
42497  }
42498  gen->is_running = 0;
42499  }
42500  Py_XDECREF(retval);
42501  return err;
42502 }
42503 static PyObject *__Pyx_Generator_Next(PyObject *self) {
42504  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
42505  PyObject *yf = gen->yieldfrom;
42506  if (unlikely(gen->is_running))
42507  return __Pyx_Coroutine_AlreadyRunningError(gen);
42508  if (yf) {
42509  PyObject *ret;
42510  gen->is_running = 1;
42511  #ifdef __Pyx_Generator_USED
42512  if (__Pyx_Generator_CheckExact(yf)) {
42513  ret = __Pyx_Generator_Next(yf);
42514  } else
42515  #endif
42516  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
42517  if (PyGen_CheckExact(yf)) {
42518  ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
42519  } else
42520  #endif
42521  #ifdef __Pyx_Coroutine_USED
42522  if (__Pyx_Coroutine_Check(yf)) {
42523  ret = __Pyx_Coroutine_Send(yf, Py_None);
42524  } else
42525  #endif
42526  ret = Py_TYPE(yf)->tp_iternext(yf);
42527  gen->is_running = 0;
42528  if (likely(ret)) {
42529  return ret;
42530  }
42531  return __Pyx_Coroutine_FinishDelegation(gen);
42532  }
42533  return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
42534 }
42535 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
42536  return __Pyx_Coroutine_Close(self);
42537 }
42538 static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
42539  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
42540  PyObject *retval, *raised_exception;
42541  PyObject *yf = gen->yieldfrom;
42542  int err = 0;
42543  if (unlikely(gen->is_running))
42544  return __Pyx_Coroutine_AlreadyRunningError(gen);
42545  if (yf) {
42546  Py_INCREF(yf);
42547  err = __Pyx_Coroutine_CloseIter(gen, yf);
42548  __Pyx_Coroutine_Undelegate(gen);
42549  Py_DECREF(yf);
42550  }
42551  if (err == 0)
42552  PyErr_SetNone(PyExc_GeneratorExit);
42553  retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
42554  if (unlikely(retval)) {
42555  const char *msg;
42556  Py_DECREF(retval);
42557  if ((0)) {
42558  #ifdef __Pyx_Coroutine_USED
42559  } else if (__Pyx_Coroutine_Check(self)) {
42560  msg = "coroutine ignored GeneratorExit";
42561  #endif
42562  #ifdef __Pyx_AsyncGen_USED
42563  } else if (__Pyx_AsyncGen_CheckExact(self)) {
42564 #if PY_VERSION_HEX < 0x03060000
42565  msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
42566 #else
42567  msg = "async generator ignored GeneratorExit";
42568 #endif
42569  #endif
42570  } else {
42571  msg = "generator ignored GeneratorExit";
42572  }
42573  PyErr_SetString(PyExc_RuntimeError, msg);
42574  return NULL;
42575  }
42576  raised_exception = PyErr_Occurred();
42577  if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
42578  if (raised_exception) PyErr_Clear();
42579  Py_INCREF(Py_None);
42580  return Py_None;
42581  }
42582  return NULL;
42583 }
42584 static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
42585  PyObject *args, int close_on_genexit) {
42586  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
42587  PyObject *yf = gen->yieldfrom;
42588  if (unlikely(gen->is_running))
42589  return __Pyx_Coroutine_AlreadyRunningError(gen);
42590  if (yf) {
42591  PyObject *ret;
42592  Py_INCREF(yf);
42593  if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
42594  int err = __Pyx_Coroutine_CloseIter(gen, yf);
42595  Py_DECREF(yf);
42596  __Pyx_Coroutine_Undelegate(gen);
42597  if (err < 0)
42598  return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
42599  goto throw_here;
42600  }
42601  gen->is_running = 1;
42602  if (0
42603  #ifdef __Pyx_Generator_USED
42604  || __Pyx_Generator_CheckExact(yf)
42605  #endif
42606  #ifdef __Pyx_Coroutine_USED
42607  || __Pyx_Coroutine_Check(yf)
42608  #endif
42609  ) {
42610  ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
42611  #ifdef __Pyx_Coroutine_USED
42612  } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
42613  ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
42614  #endif
42615  } else {
42616  PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
42617  if (unlikely(!meth)) {
42618  Py_DECREF(yf);
42619  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
42620  gen->is_running = 0;
42621  return NULL;
42622  }
42623  PyErr_Clear();
42624  __Pyx_Coroutine_Undelegate(gen);
42625  gen->is_running = 0;
42626  goto throw_here;
42627  }
42628  if (likely(args)) {
42629  ret = PyObject_CallObject(meth, args);
42630  } else {
42631  ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
42632  }
42633  Py_DECREF(meth);
42634  }
42635  gen->is_running = 0;
42636  Py_DECREF(yf);
42637  if (!ret) {
42638  ret = __Pyx_Coroutine_FinishDelegation(gen);
42639  }
42640  return __Pyx_Coroutine_MethodReturn(self, ret);
42641  }
42642 throw_here:
42643  __Pyx_Raise(typ, val, tb, NULL);
42644  return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
42645 }
42646 static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
42647  PyObject *typ;
42648  PyObject *val = NULL;
42649  PyObject *tb = NULL;
42650  if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
42651  return NULL;
42652  return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
42653 }
42654 static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
42655  Py_VISIT(exc_state->exc_type);
42656  Py_VISIT(exc_state->exc_value);
42657  Py_VISIT(exc_state->exc_traceback);
42658  return 0;
42659 }
42660 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
42661  Py_VISIT(gen->closure);
42662  Py_VISIT(gen->classobj);
42663  Py_VISIT(gen->yieldfrom);
42664  return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
42665 }
42666 static int __Pyx_Coroutine_clear(PyObject *self) {
42667  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
42668  Py_CLEAR(gen->closure);
42669  Py_CLEAR(gen->classobj);
42670  Py_CLEAR(gen->yieldfrom);
42671  __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
42672 #ifdef __Pyx_AsyncGen_USED
42673  if (__Pyx_AsyncGen_CheckExact(self)) {
42674  Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
42675  }
42676 #endif
42677  Py_CLEAR(gen->gi_code);
42678  Py_CLEAR(gen->gi_frame);
42679  Py_CLEAR(gen->gi_name);
42680  Py_CLEAR(gen->gi_qualname);
42681  Py_CLEAR(gen->gi_modulename);
42682  return 0;
42683 }
42684 static void __Pyx_Coroutine_dealloc(PyObject *self) {
42685  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
42686  PyObject_GC_UnTrack(gen);
42687  if (gen->gi_weakreflist != NULL)
42688  PyObject_ClearWeakRefs(self);
42689  if (gen->resume_label >= 0) {
42690  PyObject_GC_Track(self);
42691 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
42692  if (PyObject_CallFinalizerFromDealloc(self))
42693 #else
42694  Py_TYPE(gen)->tp_del(self);
42695  if (Py_REFCNT(self) > 0)
42696 #endif
42697  {
42698  return;
42699  }
42700  PyObject_GC_UnTrack(self);
42701  }
42702 #ifdef __Pyx_AsyncGen_USED
42703  if (__Pyx_AsyncGen_CheckExact(self)) {
42704  /* We have to handle this case for asynchronous generators
42705  right here, because this code has to be between UNTRACK
42706  and GC_Del. */
42707  Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
42708  }
42709 #endif
42710  __Pyx_Coroutine_clear(self);
42711  PyObject_GC_Del(gen);
42712 }
42713 static void __Pyx_Coroutine_del(PyObject *self) {
42714  PyObject *error_type, *error_value, *error_traceback;
42715  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
42716  __Pyx_PyThreadState_declare
42717  if (gen->resume_label < 0) {
42718  return;
42719  }
42720 #if !CYTHON_USE_TP_FINALIZE
42721  assert(self->ob_refcnt == 0);
42722  __Pyx_SET_REFCNT(self, 1);
42723 #endif
42724  __Pyx_PyThreadState_assign
42725  __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
42726 #ifdef __Pyx_AsyncGen_USED
42727  if (__Pyx_AsyncGen_CheckExact(self)) {
42728  __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
42729  PyObject *finalizer = agen->ag_finalizer;
42730  if (finalizer && !agen->ag_closed) {
42731  PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
42732  if (unlikely(!res)) {
42733  PyErr_WriteUnraisable(self);
42734  } else {
42735  Py_DECREF(res);
42736  }
42737  __Pyx_ErrRestore(error_type, error_value, error_traceback);
42738  return;
42739  }
42740  }
42741 #endif
42742  if (unlikely(gen->resume_label == 0 && !error_value)) {
42743 #ifdef __Pyx_Coroutine_USED
42744 #ifdef __Pyx_Generator_USED
42745  if (!__Pyx_Generator_CheckExact(self))
42746 #endif
42747  {
42748  PyObject_GC_UnTrack(self);
42749 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat)
42750  if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
42751  PyErr_WriteUnraisable(self);
42752 #else
42753  {PyObject *msg;
42754  char *cmsg;
42755  #if CYTHON_COMPILING_IN_PYPY
42756  msg = NULL;
42757  cmsg = (char*) "coroutine was never awaited";
42758  #else
42759  char *cname;
42760  PyObject *qualname;
42761  qualname = gen->gi_qualname;
42762  cname = PyString_AS_STRING(qualname);
42763  msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
42764  if (unlikely(!msg)) {
42765  PyErr_Clear();
42766  cmsg = (char*) "coroutine was never awaited";
42767  } else {
42768  cmsg = PyString_AS_STRING(msg);
42769  }
42770  #endif
42771  if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
42772  PyErr_WriteUnraisable(self);
42773  Py_XDECREF(msg);}
42774 #endif
42775  PyObject_GC_Track(self);
42776  }
42777 #endif
42778  } else {
42779  PyObject *res = __Pyx_Coroutine_Close(self);
42780  if (unlikely(!res)) {
42781  if (PyErr_Occurred())
42782  PyErr_WriteUnraisable(self);
42783  } else {
42784  Py_DECREF(res);
42785  }
42786  }
42787  __Pyx_ErrRestore(error_type, error_value, error_traceback);
42788 #if !CYTHON_USE_TP_FINALIZE
42789  assert(Py_REFCNT(self) > 0);
42790  if (--self->ob_refcnt == 0) {
42791  return;
42792  }
42793  {
42794  Py_ssize_t refcnt = Py_REFCNT(self);
42795  _Py_NewReference(self);
42796  __Pyx_SET_REFCNT(self, refcnt);
42797  }
42798 #if CYTHON_COMPILING_IN_CPYTHON
42799  assert(PyType_IS_GC(Py_TYPE(self)) &&
42800  _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
42801  _Py_DEC_REFTOTAL;
42802 #endif
42803 #ifdef COUNT_ALLOCS
42804  --Py_TYPE(self)->tp_frees;
42805  --Py_TYPE(self)->tp_allocs;
42806 #endif
42807 #endif
42808 }
42809 static PyObject *
42810 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
42811 {
42812  PyObject *name = self->gi_name;
42813  if (unlikely(!name)) name = Py_None;
42814  Py_INCREF(name);
42815  return name;
42816 }
42817 static int
42818 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
42819 {
42820  PyObject *tmp;
42821 #if PY_MAJOR_VERSION >= 3
42822  if (unlikely(value == NULL || !PyUnicode_Check(value)))
42823 #else
42824  if (unlikely(value == NULL || !PyString_Check(value)))
42825 #endif
42826  {
42827  PyErr_SetString(PyExc_TypeError,
42828  "__name__ must be set to a string object");
42829  return -1;
42830  }
42831  tmp = self->gi_name;
42832  Py_INCREF(value);
42833  self->gi_name = value;
42834  Py_XDECREF(tmp);
42835  return 0;
42836 }
42837 static PyObject *
42838 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
42839 {
42840  PyObject *name = self->gi_qualname;
42841  if (unlikely(!name)) name = Py_None;
42842  Py_INCREF(name);
42843  return name;
42844 }
42845 static int
42846 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
42847 {
42848  PyObject *tmp;
42849 #if PY_MAJOR_VERSION >= 3
42850  if (unlikely(value == NULL || !PyUnicode_Check(value)))
42851 #else
42852  if (unlikely(value == NULL || !PyString_Check(value)))
42853 #endif
42854  {
42855  PyErr_SetString(PyExc_TypeError,
42856  "__qualname__ must be set to a string object");
42857  return -1;
42858  }
42859  tmp = self->gi_qualname;
42860  Py_INCREF(value);
42861  self->gi_qualname = value;
42862  Py_XDECREF(tmp);
42863  return 0;
42864 }
42865 static PyObject *
42866 __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
42867 {
42868  PyObject *frame = self->gi_frame;
42869  if (!frame) {
42870  if (unlikely(!self->gi_code)) {
42871  Py_RETURN_NONE;
42872  }
42873  frame = (PyObject *) PyFrame_New(
42874  PyThreadState_Get(), /*PyThreadState *tstate,*/
42875  (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/
42876  __pyx_d, /*PyObject *globals,*/
42877  0 /*PyObject *locals*/
42878  );
42879  if (unlikely(!frame))
42880  return NULL;
42881  self->gi_frame = frame;
42882  }
42883  Py_INCREF(frame);
42884  return frame;
42885 }
42886 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
42887  PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
42888  PyObject *name, PyObject *qualname, PyObject *module_name) {
42889  __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
42890  if (unlikely(!gen))
42891  return NULL;
42892  return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
42893 }
42894 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
42895  __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
42896  PyObject *name, PyObject *qualname, PyObject *module_name) {
42897  gen->body = body;
42898  gen->closure = closure;
42899  Py_XINCREF(closure);
42900  gen->is_running = 0;
42901  gen->resume_label = 0;
42902  gen->classobj = NULL;
42903  gen->yieldfrom = NULL;
42904  gen->gi_exc_state.exc_type = NULL;
42905  gen->gi_exc_state.exc_value = NULL;
42906  gen->gi_exc_state.exc_traceback = NULL;
42907 #if CYTHON_USE_EXC_INFO_STACK
42908  gen->gi_exc_state.previous_item = NULL;
42909 #endif
42910  gen->gi_weakreflist = NULL;
42911  Py_XINCREF(qualname);
42912  gen->gi_qualname = qualname;
42913  Py_XINCREF(name);
42914  gen->gi_name = name;
42915  Py_XINCREF(module_name);
42916  gen->gi_modulename = module_name;
42917  Py_XINCREF(code);
42918  gen->gi_code = code;
42919  gen->gi_frame = NULL;
42920  PyObject_GC_Track(gen);
42921  return gen;
42922 }
42923 
42924 /* PatchModuleWithCoroutine */
42925  static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
42926 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
42927  int result;
42928  PyObject *globals, *result_obj;
42929  globals = PyDict_New(); if (unlikely(!globals)) goto ignore;
42930  result = PyDict_SetItemString(globals, "_cython_coroutine_type",
42931  #ifdef __Pyx_Coroutine_USED
42932  (PyObject*)__pyx_CoroutineType);
42933  #else
42934  Py_None);
42935  #endif
42936  if (unlikely(result < 0)) goto ignore;
42937  result = PyDict_SetItemString(globals, "_cython_generator_type",
42938  #ifdef __Pyx_Generator_USED
42939  (PyObject*)__pyx_GeneratorType);
42940  #else
42941  Py_None);
42942  #endif
42943  if (unlikely(result < 0)) goto ignore;
42944  if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
42945  if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
42946  result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
42947  if (unlikely(!result_obj)) goto ignore;
42948  Py_DECREF(result_obj);
42949  Py_DECREF(globals);
42950  return module;
42951 ignore:
42952  Py_XDECREF(globals);
42953  PyErr_WriteUnraisable(module);
42954  if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
42955  Py_DECREF(module);
42956  module = NULL;
42957  }
42958 #else
42959  py_code++;
42960 #endif
42961  return module;
42962 }
42963 
42964 /* PatchGeneratorABC */
42965  #ifndef CYTHON_REGISTER_ABCS
42966 #define CYTHON_REGISTER_ABCS 1
42967 #endif
42968 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
42969 static PyObject* __Pyx_patch_abc_module(PyObject *module);
42970 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
42971  module = __Pyx_Coroutine_patch_module(
42972  module, ""
42973 "if _cython_generator_type is not None:\n"
42974 " try: Generator = _module.Generator\n"
42975 " except AttributeError: pass\n"
42976 " else: Generator.register(_cython_generator_type)\n"
42977 "if _cython_coroutine_type is not None:\n"
42978 " try: Coroutine = _module.Coroutine\n"
42979 " except AttributeError: pass\n"
42980 " else: Coroutine.register(_cython_coroutine_type)\n"
42981  );
42982  return module;
42983 }
42984 #endif
42985 static int __Pyx_patch_abc(void) {
42986 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
42987  static int abc_patched = 0;
42988  if (CYTHON_REGISTER_ABCS && !abc_patched) {
42989  PyObject *module;
42990  module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
42991  if (!module) {
42992  PyErr_WriteUnraisable(NULL);
42993  if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
42994  ((PY_MAJOR_VERSION >= 3) ?
42995  "Cython module failed to register with collections.abc module" :
42996  "Cython module failed to register with collections module"), 1) < 0)) {
42997  return -1;
42998  }
42999  } else {
43000  module = __Pyx_patch_abc_module(module);
43001  abc_patched = 1;
43002  if (unlikely(!module))
43003  return -1;
43004  Py_DECREF(module);
43005  }
43006  module = PyImport_ImportModule("backports_abc");
43007  if (module) {
43008  module = __Pyx_patch_abc_module(module);
43009  Py_XDECREF(module);
43010  }
43011  if (!module) {
43012  PyErr_Clear();
43013  }
43014  }
43015 #else
43016  if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
43017 #endif
43018  return 0;
43019 }
43020 
43021 /* Generator */
43022  static PyMethodDef __pyx_Generator_methods[] = {
43023  {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
43024  (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
43025  {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
43026  (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
43027  {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
43028  (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
43029  {0, 0, 0, 0}
43030 };
43031 static PyMemberDef __pyx_Generator_memberlist[] = {
43032  {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
43033  {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
43034  (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
43035  {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
43036  {0, 0, 0, 0, 0}
43037 };
43038 static PyGetSetDef __pyx_Generator_getsets[] = {
43039  {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
43040  (char*) PyDoc_STR("name of the generator"), 0},
43041  {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
43042  (char*) PyDoc_STR("qualified name of the generator"), 0},
43043  {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
43044  (char*) PyDoc_STR("Frame of the generator"), 0},
43045  {0, 0, 0, 0, 0}
43046 };
43047 static PyTypeObject __pyx_GeneratorType_type = {
43048  PyVarObject_HEAD_INIT(0, 0)
43049  "generator",
43050  sizeof(__pyx_CoroutineObject),
43051  0,
43052  (destructor) __Pyx_Coroutine_dealloc,
43053  0,
43054  0,
43055  0,
43056  0,
43057  0,
43058  0,
43059  0,
43060  0,
43061  0,
43062  0,
43063  0,
43064  0,
43065  0,
43066  0,
43067  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
43068  0,
43069  (traverseproc) __Pyx_Coroutine_traverse,
43070  0,
43071  0,
43072  offsetof(__pyx_CoroutineObject, gi_weakreflist),
43073  0,
43074  (iternextfunc) __Pyx_Generator_Next,
43075  __pyx_Generator_methods,
43076  __pyx_Generator_memberlist,
43077  __pyx_Generator_getsets,
43078  0,
43079  0,
43080  0,
43081  0,
43082  0,
43083  0,
43084  0,
43085  0,
43086  0,
43087  0,
43088  0,
43089  0,
43090  0,
43091  0,
43092  0,
43093 #if CYTHON_USE_TP_FINALIZE
43094  0,
43095 #else
43096  __Pyx_Coroutine_del,
43097 #endif
43098  0,
43099 #if CYTHON_USE_TP_FINALIZE
43100  __Pyx_Coroutine_del,
43101 #elif PY_VERSION_HEX >= 0x030400a1
43102  0,
43103 #endif
43104 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
43105  0,
43106 #endif
43107 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
43108  0,
43109 #endif
43110 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
43111  0,
43112 #endif
43113 };
43114 static int __pyx_Generator_init(void) {
43115  __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
43116  __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
43117  __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
43118  if (unlikely(!__pyx_GeneratorType)) {
43119  return -1;
43120  }
43121  return 0;
43122 }
43123 
43124 /* CheckBinaryVersion */
43125  static int __Pyx_check_binary_version(void) {
43126  char ctversion[5];
43127  int same=1, i, found_dot;
43128  const char* rt_from_call = Py_GetVersion();
43129  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
43130  found_dot = 0;
43131  for (i = 0; i < 4; i++) {
43132  if (!ctversion[i]) {
43133  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
43134  break;
43135  }
43136  if (rt_from_call[i] != ctversion[i]) {
43137  same = 0;
43138  break;
43139  }
43140  }
43141  if (!same) {
43142  char rtversion[5] = {'\0'};
43143  char message[200];
43144  for (i=0; i<4; ++i) {
43145  if (rt_from_call[i] == '.') {
43146  if (found_dot) break;
43147  found_dot = 1;
43148  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
43149  break;
43150  }
43151  rtversion[i] = rt_from_call[i];
43152  }
43153  PyOS_snprintf(message, sizeof(message),
43154  "compiletime version %s of module '%.100s' "
43155  "does not match runtime version %s",
43156  ctversion, __Pyx_MODULE_NAME, rtversion);
43157  return PyErr_WarnEx(NULL, message, 1);
43158  }
43159  return 0;
43160 }
43161 
43162 /* FunctionImport */
43163  #ifndef __PYX_HAVE_RT_ImportFunction
43164 #define __PYX_HAVE_RT_ImportFunction
43165 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
43166  PyObject *d = 0;
43167  PyObject *cobj = 0;
43168  union {
43169  void (*fp)(void);
43170  void *p;
43171  } tmp;
43172  d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
43173  if (!d)
43174  goto bad;
43175  cobj = PyDict_GetItemString(d, funcname);
43176  if (!cobj) {
43177  PyErr_Format(PyExc_ImportError,
43178  "%.200s does not export expected C function %.200s",
43179  PyModule_GetName(module), funcname);
43180  goto bad;
43181  }
43182 #if PY_VERSION_HEX >= 0x02070000
43183  if (!PyCapsule_IsValid(cobj, sig)) {
43184  PyErr_Format(PyExc_TypeError,
43185  "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
43186  PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
43187  goto bad;
43188  }
43189  tmp.p = PyCapsule_GetPointer(cobj, sig);
43190 #else
43191  {const char *desc, *s1, *s2;
43192  desc = (const char *)PyCObject_GetDesc(cobj);
43193  if (!desc)
43194  goto bad;
43195  s1 = desc; s2 = sig;
43196  while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
43197  if (*s1 != *s2) {
43198  PyErr_Format(PyExc_TypeError,
43199  "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
43200  PyModule_GetName(module), funcname, sig, desc);
43201  goto bad;
43202  }
43203  tmp.p = PyCObject_AsVoidPtr(cobj);}
43204 #endif
43205  *f = tmp.fp;
43206  if (!(*f))
43207  goto bad;
43208  Py_DECREF(d);
43209  return 0;
43210 bad:
43211  Py_XDECREF(d);
43212  return -1;
43213 }
43214 #endif
43215 
43216 /* InitStrings */
43217  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
43218  while (t->p) {
43219  #if PY_MAJOR_VERSION < 3
43220  if (t->is_unicode) {
43221  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
43222  } else if (t->intern) {
43223  *t->p = PyString_InternFromString(t->s);
43224  } else {
43225  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
43226  }
43227  #else
43228  if (t->is_unicode | t->is_str) {
43229  if (t->intern) {
43230  *t->p = PyUnicode_InternFromString(t->s);
43231  } else if (t->encoding) {
43232  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
43233  } else {
43234  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
43235  }
43236  } else {
43237  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
43238  }
43239  #endif
43240  if (!*t->p)
43241  return -1;
43242  if (PyObject_Hash(*t->p) == -1)
43243  return -1;
43244  ++t;
43245  }
43246  return 0;
43247 }
43248 
43249 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
43250  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
43251 }
43252 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
43253  Py_ssize_t ignore;
43254  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
43255 }
43256 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
43257 #if !CYTHON_PEP393_ENABLED
43258 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
43259  char* defenc_c;
43260  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
43261  if (!defenc) return NULL;
43262  defenc_c = PyBytes_AS_STRING(defenc);
43263 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
43264  {
43265  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
43266  char* c;
43267  for (c = defenc_c; c < end; c++) {
43268  if ((unsigned char) (*c) >= 128) {
43269  PyUnicode_AsASCIIString(o);
43270  return NULL;
43271  }
43272  }
43273  }
43274 #endif
43275  *length = PyBytes_GET_SIZE(defenc);
43276  return defenc_c;
43277 }
43278 #else
43279 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
43280  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
43281 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
43282  if (likely(PyUnicode_IS_ASCII(o))) {
43283  *length = PyUnicode_GET_LENGTH(o);
43284  return PyUnicode_AsUTF8(o);
43285  } else {
43286  PyUnicode_AsASCIIString(o);
43287  return NULL;
43288  }
43289 #else
43290  return PyUnicode_AsUTF8AndSize(o, length);
43291 #endif
43292 }
43293 #endif
43294 #endif
43295 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
43296 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
43297  if (
43298 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
43299  __Pyx_sys_getdefaultencoding_not_ascii &&
43300 #endif
43301  PyUnicode_Check(o)) {
43302  return __Pyx_PyUnicode_AsStringAndSize(o, length);
43303  } else
43304 #endif
43305 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
43306  if (PyByteArray_Check(o)) {
43307  *length = PyByteArray_GET_SIZE(o);
43308  return PyByteArray_AS_STRING(o);
43309  } else
43310 #endif
43311  {
43312  char* result;
43313  int r = PyBytes_AsStringAndSize(o, &result, length);
43314  if (unlikely(r < 0)) {
43315  return NULL;
43316  } else {
43317  return result;
43318  }
43319  }
43320 }
43321 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
43322  int is_true = x == Py_True;
43323  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
43324  else return PyObject_IsTrue(x);
43325 }
43326 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
43327  int retval;
43328  if (unlikely(!x)) return -1;
43329  retval = __Pyx_PyObject_IsTrue(x);
43330  Py_DECREF(x);
43331  return retval;
43332 }
43333 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
43334 #if PY_MAJOR_VERSION >= 3
43335  if (PyLong_Check(result)) {
43336  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
43337  "__int__ returned non-int (type %.200s). "
43338  "The ability to return an instance of a strict subclass of int "
43339  "is deprecated, and may be removed in a future version of Python.",
43340  Py_TYPE(result)->tp_name)) {
43341  Py_DECREF(result);
43342  return NULL;
43343  }
43344  return result;
43345  }
43346 #endif
43347  PyErr_Format(PyExc_TypeError,
43348  "__%.4s__ returned non-%.4s (type %.200s)",
43349  type_name, type_name, Py_TYPE(result)->tp_name);
43350  Py_DECREF(result);
43351  return NULL;
43352 }
43353 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
43354 #if CYTHON_USE_TYPE_SLOTS
43355  PyNumberMethods *m;
43356 #endif
43357  const char *name = NULL;
43358  PyObject *res = NULL;
43359 #if PY_MAJOR_VERSION < 3
43360  if (likely(PyInt_Check(x) || PyLong_Check(x)))
43361 #else
43362  if (likely(PyLong_Check(x)))
43363 #endif
43364  return __Pyx_NewRef(x);
43365 #if CYTHON_USE_TYPE_SLOTS
43366  m = Py_TYPE(x)->tp_as_number;
43367  #if PY_MAJOR_VERSION < 3
43368  if (m && m->nb_int) {
43369  name = "int";
43370  res = m->nb_int(x);
43371  }
43372  else if (m && m->nb_long) {
43373  name = "long";
43374  res = m->nb_long(x);
43375  }
43376  #else
43377  if (likely(m && m->nb_int)) {
43378  name = "int";
43379  res = m->nb_int(x);
43380  }
43381  #endif
43382 #else
43383  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
43384  res = PyNumber_Int(x);
43385  }
43386 #endif
43387  if (likely(res)) {
43388 #if PY_MAJOR_VERSION < 3
43389  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
43390 #else
43391  if (unlikely(!PyLong_CheckExact(res))) {
43392 #endif
43393  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
43394  }
43395  }
43396  else if (!PyErr_Occurred()) {
43397  PyErr_SetString(PyExc_TypeError,
43398  "an integer is required");
43399  }
43400  return res;
43401 }
43402 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
43403  Py_ssize_t ival;
43404  PyObject *x;
43405 #if PY_MAJOR_VERSION < 3
43406  if (likely(PyInt_CheckExact(b))) {
43407  if (sizeof(Py_ssize_t) >= sizeof(long))
43408  return PyInt_AS_LONG(b);
43409  else
43410  return PyInt_AsSsize_t(b);
43411  }
43412 #endif
43413  if (likely(PyLong_CheckExact(b))) {
43414  #if CYTHON_USE_PYLONG_INTERNALS
43415  const digit* digits = ((PyLongObject*)b)->ob_digit;
43416  const Py_ssize_t size = Py_SIZE(b);
43417  if (likely(__Pyx_sst_abs(size) <= 1)) {
43418  ival = likely(size) ? digits[0] : 0;
43419  if (size == -1) ival = -ival;
43420  return ival;
43421  } else {
43422  switch (size) {
43423  case 2:
43424  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
43425  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
43426  }
43427  break;
43428  case -2:
43429  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
43430  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
43431  }
43432  break;
43433  case 3:
43434  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
43435  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
43436  }
43437  break;
43438  case -3:
43439  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
43440  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
43441  }
43442  break;
43443  case 4:
43444  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
43445  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
43446  }
43447  break;
43448  case -4:
43449  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
43450  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
43451  }
43452  break;
43453  }
43454  }
43455  #endif
43456  return PyLong_AsSsize_t(b);
43457  }
43458  x = PyNumber_Index(b);
43459  if (!x) return -1;
43460  ival = PyInt_AsSsize_t(x);
43461  Py_DECREF(x);
43462  return ival;
43463 }
43464 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
43465  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
43466  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
43467 #if PY_MAJOR_VERSION < 3
43468  } else if (likely(PyInt_CheckExact(o))) {
43469  return PyInt_AS_LONG(o);
43470 #endif
43471  } else {
43472  Py_ssize_t ival;
43473  PyObject *x;
43474  x = PyNumber_Index(o);
43475  if (!x) return -1;
43476  ival = PyInt_AsLong(x);
43477  Py_DECREF(x);
43478  return ival;
43479  }
43480 }
43481 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
43482  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
43483 }
43484 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
43485  return PyInt_FromSize_t(ival);
43486 }
43487 
43488 
43489 #endif /* Py_PYTHON_H */
proteus::fp
double fp(const double &g, const double &h, const double &hZ)
Definition: SW2DCV.h:66
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
s
Double s
Definition: Headers.h:84
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
c
Double c
Definition: Headers.h:54
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8