3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
8 #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10 #error Cython requires Python 2.6+ or Python 3.3+.
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
49 #define CYTHON_COMPILING_IN_PYPY 1
50 #define CYTHON_COMPILING_IN_PYSTON 0
51 #define CYTHON_COMPILING_IN_CPYTHON 0
52 #undef CYTHON_USE_TYPE_SLOTS
53 #define CYTHON_USE_TYPE_SLOTS 0
54 #undef CYTHON_USE_PYTYPE_LOOKUP
55 #define CYTHON_USE_PYTYPE_LOOKUP 0
56 #if PY_VERSION_HEX < 0x03050000
57 #undef CYTHON_USE_ASYNC_SLOTS
58 #define CYTHON_USE_ASYNC_SLOTS 0
59 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60 #define CYTHON_USE_ASYNC_SLOTS 1
62 #undef CYTHON_USE_PYLIST_INTERNALS
63 #define CYTHON_USE_PYLIST_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_INTERNALS
65 #define CYTHON_USE_UNICODE_INTERNALS 0
66 #undef CYTHON_USE_UNICODE_WRITER
67 #define CYTHON_USE_UNICODE_WRITER 0
68 #undef CYTHON_USE_PYLONG_INTERNALS
69 #define CYTHON_USE_PYLONG_INTERNALS 0
70 #undef CYTHON_AVOID_BORROWED_REFS
71 #define CYTHON_AVOID_BORROWED_REFS 1
72 #undef CYTHON_ASSUME_SAFE_MACROS
73 #define CYTHON_ASSUME_SAFE_MACROS 0
74 #undef CYTHON_UNPACK_METHODS
75 #define CYTHON_UNPACK_METHODS 0
76 #undef CYTHON_FAST_THREAD_STATE
77 #define CYTHON_FAST_THREAD_STATE 0
78 #undef CYTHON_FAST_PYCALL
79 #define CYTHON_FAST_PYCALL 0
80 #undef CYTHON_PEP489_MULTI_PHASE_INIT
81 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82 #undef CYTHON_USE_TP_FINALIZE
83 #define CYTHON_USE_TP_FINALIZE 0
84 #undef CYTHON_USE_DICT_VERSIONS
85 #define CYTHON_USE_DICT_VERSIONS 0
86 #undef CYTHON_USE_EXC_INFO_STACK
87 #define CYTHON_USE_EXC_INFO_STACK 0
88 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
91 #elif defined(PYSTON_VERSION)
92 #define CYTHON_COMPILING_IN_PYPY 0
93 #define CYTHON_COMPILING_IN_PYSTON 1
94 #define CYTHON_COMPILING_IN_CPYTHON 0
95 #ifndef CYTHON_USE_TYPE_SLOTS
96 #define CYTHON_USE_TYPE_SLOTS 1
98 #undef CYTHON_USE_PYTYPE_LOOKUP
99 #define CYTHON_USE_PYTYPE_LOOKUP 0
100 #undef CYTHON_USE_ASYNC_SLOTS
101 #define CYTHON_USE_ASYNC_SLOTS 0
102 #undef CYTHON_USE_PYLIST_INTERNALS
103 #define CYTHON_USE_PYLIST_INTERNALS 0
104 #ifndef CYTHON_USE_UNICODE_INTERNALS
105 #define CYTHON_USE_UNICODE_INTERNALS 1
107 #undef CYTHON_USE_UNICODE_WRITER
108 #define CYTHON_USE_UNICODE_WRITER 0
109 #undef CYTHON_USE_PYLONG_INTERNALS
110 #define CYTHON_USE_PYLONG_INTERNALS 0
111 #ifndef CYTHON_AVOID_BORROWED_REFS
112 #define CYTHON_AVOID_BORROWED_REFS 0
114 #ifndef CYTHON_ASSUME_SAFE_MACROS
115 #define CYTHON_ASSUME_SAFE_MACROS 1
117 #ifndef CYTHON_UNPACK_METHODS
118 #define CYTHON_UNPACK_METHODS 1
120 #undef CYTHON_FAST_THREAD_STATE
121 #define CYTHON_FAST_THREAD_STATE 0
122 #undef CYTHON_FAST_PYCALL
123 #define CYTHON_FAST_PYCALL 0
124 #undef CYTHON_PEP489_MULTI_PHASE_INIT
125 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126 #undef CYTHON_USE_TP_FINALIZE
127 #define CYTHON_USE_TP_FINALIZE 0
128 #undef CYTHON_USE_DICT_VERSIONS
129 #define CYTHON_USE_DICT_VERSIONS 0
130 #undef CYTHON_USE_EXC_INFO_STACK
131 #define CYTHON_USE_EXC_INFO_STACK 0
132 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
136 #define CYTHON_COMPILING_IN_PYPY 0
137 #define CYTHON_COMPILING_IN_PYSTON 0
138 #define CYTHON_COMPILING_IN_CPYTHON 1
139 #ifndef CYTHON_USE_TYPE_SLOTS
140 #define CYTHON_USE_TYPE_SLOTS 1
142 #if PY_VERSION_HEX < 0x02070000
143 #undef CYTHON_USE_PYTYPE_LOOKUP
144 #define CYTHON_USE_PYTYPE_LOOKUP 0
145 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146 #define CYTHON_USE_PYTYPE_LOOKUP 1
148 #if PY_MAJOR_VERSION < 3
149 #undef CYTHON_USE_ASYNC_SLOTS
150 #define CYTHON_USE_ASYNC_SLOTS 0
151 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152 #define CYTHON_USE_ASYNC_SLOTS 1
154 #if PY_VERSION_HEX < 0x02070000
155 #undef CYTHON_USE_PYLONG_INTERNALS
156 #define CYTHON_USE_PYLONG_INTERNALS 0
157 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158 #define CYTHON_USE_PYLONG_INTERNALS 1
160 #ifndef CYTHON_USE_PYLIST_INTERNALS
161 #define CYTHON_USE_PYLIST_INTERNALS 1
163 #ifndef CYTHON_USE_UNICODE_INTERNALS
164 #define CYTHON_USE_UNICODE_INTERNALS 1
166 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167 #undef CYTHON_USE_UNICODE_WRITER
168 #define CYTHON_USE_UNICODE_WRITER 0
169 #elif !defined(CYTHON_USE_UNICODE_WRITER)
170 #define CYTHON_USE_UNICODE_WRITER 1
172 #ifndef CYTHON_AVOID_BORROWED_REFS
173 #define CYTHON_AVOID_BORROWED_REFS 0
175 #ifndef CYTHON_ASSUME_SAFE_MACROS
176 #define CYTHON_ASSUME_SAFE_MACROS 1
178 #ifndef CYTHON_UNPACK_METHODS
179 #define CYTHON_UNPACK_METHODS 1
181 #if PY_VERSION_HEX >= 0x030B00A4
182 #undef CYTHON_FAST_THREAD_STATE
183 #define CYTHON_FAST_THREAD_STATE 0
184 #elif !defined(CYTHON_FAST_THREAD_STATE)
185 #define CYTHON_FAST_THREAD_STATE 1
187 #ifndef CYTHON_FAST_PYCALL
188 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
190 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
193 #ifndef CYTHON_USE_TP_FINALIZE
194 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
196 #ifndef CYTHON_USE_DICT_VERSIONS
197 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
199 #if PY_VERSION_HEX >= 0x030B00A4
200 #undef CYTHON_USE_EXC_INFO_STACK
201 #define CYTHON_USE_EXC_INFO_STACK 0
202 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
212 #if CYTHON_USE_PYLONG_INTERNALS
213 #if PY_MAJOR_VERSION < 3
214 #include "longintrepr.h"
220 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
223 #ifndef __has_attribute
224 #define __has_attribute(x) 0
226 #ifndef __has_cpp_attribute
227 #define __has_cpp_attribute(x) 0
229 #ifndef CYTHON_RESTRICT
230 #if defined(__GNUC__)
231 #define CYTHON_RESTRICT __restrict__
232 #elif defined(_MSC_VER) && _MSC_VER >= 1400
233 #define CYTHON_RESTRICT __restrict
234 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235 #define CYTHON_RESTRICT restrict
237 #define CYTHON_RESTRICT
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
245 # define CYTHON_UNUSED
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
250 # define CYTHON_UNUSED
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
269 #ifndef _MSC_STDINT_H_
271 typedef unsigned char uint8_t;
272 typedef unsigned int uint32_t;
274 typedef unsigned __int8 uint8_t;
275 typedef unsigned __int32 uint32_t;
281 #ifndef CYTHON_FALLTHROUGH
282 #if defined(__cplusplus) && __cplusplus >= 201103L
283 #if __has_cpp_attribute(fallthrough)
284 #define CYTHON_FALLTHROUGH [[fallthrough]]
285 #elif __has_cpp_attribute(clang::fallthrough)
286 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287 #elif __has_cpp_attribute(gnu::fallthrough)
288 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
291 #ifndef CYTHON_FALLTHROUGH
292 #if __has_attribute(fallthrough)
293 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
295 #define CYTHON_FALLTHROUGH
298 #if defined(__clang__ ) && defined(__apple_build_version__)
299 #if __apple_build_version__ < 7000000
300 #undef CYTHON_FALLTHROUGH
301 #define CYTHON_FALLTHROUGH
306 #ifndef CYTHON_INLINE
307 #if defined(__clang__)
308 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
309 #elif defined(__GNUC__)
310 #define CYTHON_INLINE __inline__
311 #elif defined(_MSC_VER)
312 #define CYTHON_INLINE __inline
313 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
314 #define CYTHON_INLINE inline
316 #define CYTHON_INLINE
320 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
321 #define Py_OptimizeFlag 0
323 #define __PYX_BUILD_PY_SSIZE_T "n"
324 #define CYTHON_FORMAT_SSIZE_T "z"
325 #if PY_MAJOR_VERSION < 3
326 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
327 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329 #define __Pyx_DefaultClassType PyClass_Type
331 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
332 #define __Pyx_DefaultClassType PyType_Type
333 #if PY_VERSION_HEX >= 0x030B00A1
334 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
335 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
336 PyObject *fv, PyObject *cell, PyObject* fn,
337 PyObject *name,
int fline, PyObject *lnos) {
338 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
339 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
340 const char *fn_cstr=NULL;
341 const char *name_cstr=NULL;
342 PyCodeObject* co=NULL;
343 PyObject *type, *value, *traceback;
344 PyErr_Fetch(&type, &value, &traceback);
345 if (!(kwds=PyDict_New()))
goto end;
346 if (!(argcount=PyLong_FromLong(a)))
goto end;
347 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
348 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
349 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
350 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
351 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
352 if (!(nlocals=PyLong_FromLong(l)))
goto end;
353 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
354 if (!(stacksize=PyLong_FromLong(
s)))
goto end;
355 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
356 if (!(flags=PyLong_FromLong(
f)))
goto end;
357 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
358 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
359 if (PyDict_SetItemString(kwds,
"co_consts",
c) != 0)
goto end;
360 if (PyDict_SetItemString(kwds,
"co_names",
n) != 0)
goto end;
361 if (PyDict_SetItemString(kwds,
"co_varnames",
v) != 0)
goto end;
362 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
363 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
364 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
365 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
366 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
367 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
368 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
369 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
370 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
371 Py_XDECREF((PyObject*)co);
372 co = (PyCodeObject*)call_result;
376 Py_XDECREF((PyObject*)co);
381 Py_XDECREF(argcount);
382 Py_XDECREF(posonlyargcount);
383 Py_XDECREF(kwonlyargcount);
385 Py_XDECREF(stacksize);
387 Py_XDECREF(call_result);
390 PyErr_Restore(type, value, traceback);
395 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
396 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
398 #define __Pyx_DefaultClassType PyType_Type
400 #ifndef Py_TPFLAGS_CHECKTYPES
401 #define Py_TPFLAGS_CHECKTYPES 0
403 #ifndef Py_TPFLAGS_HAVE_INDEX
404 #define Py_TPFLAGS_HAVE_INDEX 0
406 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
407 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
409 #ifndef Py_TPFLAGS_HAVE_FINALIZE
410 #define Py_TPFLAGS_HAVE_FINALIZE 0
412 #ifndef METH_STACKLESS
413 #define METH_STACKLESS 0
415 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
416 #ifndef METH_FASTCALL
417 #define METH_FASTCALL 0x80
419 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
420 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
421 Py_ssize_t nargs, PyObject *kwnames);
423 #define __Pyx_PyCFunctionFast _PyCFunctionFast
424 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
426 #if CYTHON_FAST_PYCCALL
427 #define __Pyx_PyFastCFunction_Check(func)\
428 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
430 #define __Pyx_PyFastCFunction_Check(func) 0
432 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
433 #define PyObject_Malloc(s) PyMem_Malloc(s)
434 #define PyObject_Free(p) PyMem_Free(p)
435 #define PyObject_Realloc(p) PyMem_Realloc(p)
437 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
438 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
439 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
440 #define PyMem_RawFree(p) PyMem_Free(p)
442 #if CYTHON_COMPILING_IN_PYSTON
443 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
444 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
446 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
447 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
449 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
450 #define __Pyx_PyThreadState_Current PyThreadState_GET()
451 #elif PY_VERSION_HEX >= 0x03060000
452 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
453 #elif PY_VERSION_HEX >= 0x03000000
454 #define __Pyx_PyThreadState_Current PyThreadState_GET()
456 #define __Pyx_PyThreadState_Current _PyThreadState_Current
458 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
459 #include "pythread.h"
460 #define Py_tss_NEEDS_INIT 0
461 typedef int Py_tss_t;
462 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
463 *key = PyThread_create_key();
466 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
467 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
468 *key = Py_tss_NEEDS_INIT;
471 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
474 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
475 return *key != Py_tss_NEEDS_INIT;
477 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
478 PyThread_delete_key(*key);
479 *key = Py_tss_NEEDS_INIT;
481 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
482 return PyThread_set_key_value(*key, value);
484 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
485 return PyThread_get_key_value(*key);
488 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
489 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
491 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
493 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
494 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
495 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
497 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
498 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
500 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
501 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
503 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
505 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
506 #define CYTHON_PEP393_ENABLED 1
507 #if defined(PyUnicode_IS_READY)
508 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
509 0 : _PyUnicode_Ready((PyObject *)(op)))
511 #define __Pyx_PyUnicode_READY(op) (0)
513 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
514 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
515 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
516 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
517 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
518 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
519 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
520 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
521 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
522 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
524 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
527 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
530 #define CYTHON_PEP393_ENABLED 0
531 #define PyUnicode_1BYTE_KIND 1
532 #define PyUnicode_2BYTE_KIND 2
533 #define PyUnicode_4BYTE_KIND 4
534 #define __Pyx_PyUnicode_READY(op) (0)
535 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
536 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
537 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
538 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
539 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
540 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
541 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
542 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
544 #if CYTHON_COMPILING_IN_PYPY
545 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
546 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
548 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
549 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
550 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
552 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
553 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
555 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
556 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
558 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
559 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
561 #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))
562 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
563 #if PY_MAJOR_VERSION >= 3
564 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
566 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
568 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
569 #define PyObject_ASCII(o) PyObject_Repr(o)
571 #if PY_MAJOR_VERSION >= 3
572 #define PyBaseString_Type PyUnicode_Type
573 #define PyStringObject PyUnicodeObject
574 #define PyString_Type PyUnicode_Type
575 #define PyString_Check PyUnicode_Check
576 #define PyString_CheckExact PyUnicode_CheckExact
577 #ifndef PyObject_Unicode
578 #define PyObject_Unicode PyObject_Str
581 #if PY_MAJOR_VERSION >= 3
582 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
583 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
585 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
586 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
588 #ifndef PySet_CheckExact
589 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
591 #if PY_VERSION_HEX >= 0x030900A4
592 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
593 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
595 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
596 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
598 #if CYTHON_ASSUME_SAFE_MACROS
599 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
601 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
603 #if PY_MAJOR_VERSION >= 3
604 #define PyIntObject PyLongObject
605 #define PyInt_Type PyLong_Type
606 #define PyInt_Check(op) PyLong_Check(op)
607 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
608 #define PyInt_FromString PyLong_FromString
609 #define PyInt_FromUnicode PyLong_FromUnicode
610 #define PyInt_FromLong PyLong_FromLong
611 #define PyInt_FromSize_t PyLong_FromSize_t
612 #define PyInt_FromSsize_t PyLong_FromSsize_t
613 #define PyInt_AsLong PyLong_AsLong
614 #define PyInt_AS_LONG PyLong_AS_LONG
615 #define PyInt_AsSsize_t PyLong_AsSsize_t
616 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
617 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
618 #define PyNumber_Int PyNumber_Long
620 #if PY_MAJOR_VERSION >= 3
621 #define PyBoolObject PyLongObject
623 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
624 #ifndef PyUnicode_InternFromString
625 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
628 #if PY_VERSION_HEX < 0x030200A4
629 typedef long Py_hash_t;
630 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
631 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
633 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
634 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
636 #if PY_MAJOR_VERSION >= 3
637 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
639 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
641 #if CYTHON_USE_ASYNC_SLOTS
642 #if PY_VERSION_HEX >= 0x030500B1
643 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
644 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
646 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
649 #define __Pyx_PyType_AsAsync(obj) NULL
651 #ifndef __Pyx_PyAsyncMethodsStruct
656 } __Pyx_PyAsyncMethodsStruct;
659 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
660 #if !defined(_USE_MATH_DEFINES)
661 #define _USE_MATH_DEFINES
666 #define __PYX_NAN() ((float) NAN)
668 static CYTHON_INLINE
float __PYX_NAN() {
670 memset(&value, 0xFF,
sizeof(value));
674 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
675 #define __Pyx_truncl trunc
677 #define __Pyx_truncl truncl
680 #define __PYX_MARK_ERR_POS(f_index, lineno) \
681 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
682 #define __PYX_ERR(f_index, lineno, Ln_error) \
683 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
685 #ifndef __PYX_EXTERN_C
687 #define __PYX_EXTERN_C extern "C"
689 #define __PYX_EXTERN_C extern
693 #define __PYX_HAVE__Isosurface
694 #define __PYX_HAVE_API__Isosurface
698 #include "numpy/arrayobject.h"
699 #include "numpy/ndarrayobject.h"
700 #include "numpy/ndarraytypes.h"
701 #include "numpy/arrayscalars.h"
702 #include "numpy/ufuncobject.h"
711 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
712 #define CYTHON_WITHOUT_ASSERTIONS
715 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
716 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
718 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
719 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
720 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
721 #define __PYX_DEFAULT_STRING_ENCODING ""
722 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
723 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
724 #define __Pyx_uchar_cast(c) ((unsigned char)c)
725 #define __Pyx_long_cast(x) ((long)x)
726 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
727 (sizeof(type) < sizeof(Py_ssize_t)) ||\
728 (sizeof(type) > sizeof(Py_ssize_t) &&\
729 likely(v < (type)PY_SSIZE_T_MAX ||\
730 v == (type)PY_SSIZE_T_MAX) &&\
731 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
732 v == (type)PY_SSIZE_T_MIN))) ||\
733 (sizeof(type) == sizeof(Py_ssize_t) &&\
734 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
735 v == (type)PY_SSIZE_T_MAX))) )
736 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
737 return (
size_t) i < (size_t) limit;
739 #if defined (__cplusplus) && __cplusplus >= 201103L
741 #define __Pyx_sst_abs(value) std::abs(value)
742 #elif SIZEOF_INT >= SIZEOF_SIZE_T
743 #define __Pyx_sst_abs(value) abs(value)
744 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
745 #define __Pyx_sst_abs(value) labs(value)
746 #elif defined (_MSC_VER)
747 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
748 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
749 #define __Pyx_sst_abs(value) llabs(value)
750 #elif defined (__GNUC__)
751 #define __Pyx_sst_abs(value) __builtin_llabs(value)
753 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
755 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
756 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
757 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
758 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
759 #define __Pyx_PyBytes_FromString PyBytes_FromString
760 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
761 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
762 #if PY_MAJOR_VERSION < 3
763 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
764 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
766 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
767 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
769 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
770 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
771 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
772 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
773 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
774 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
775 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
776 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
777 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
778 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
779 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
780 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
781 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
782 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
783 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
784 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
785 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
786 const Py_UNICODE *u_end =
u;
788 return (
size_t)(u_end -
u - 1);
790 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
791 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
792 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
793 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
794 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
795 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
796 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
797 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
798 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
799 #define __Pyx_PySequence_Tuple(obj)\
800 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
801 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
802 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
803 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
804 #if CYTHON_ASSUME_SAFE_MACROS
805 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
807 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
809 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
810 #if PY_MAJOR_VERSION >= 3
811 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
813 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
815 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
816 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
817 static int __Pyx_sys_getdefaultencoding_not_ascii;
818 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
820 PyObject* default_encoding = NULL;
821 PyObject* ascii_chars_u = NULL;
822 PyObject* ascii_chars_b = NULL;
823 const char* default_encoding_c;
824 sys = PyImport_ImportModule(
"sys");
826 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
828 if (!default_encoding)
goto bad;
829 default_encoding_c = PyBytes_AsString(default_encoding);
830 if (!default_encoding_c)
goto bad;
831 if (strcmp(default_encoding_c,
"ascii") == 0) {
832 __Pyx_sys_getdefaultencoding_not_ascii = 0;
834 char ascii_chars[128];
836 for (
c = 0;
c < 128;
c++) {
839 __Pyx_sys_getdefaultencoding_not_ascii = 1;
840 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
841 if (!ascii_chars_u)
goto bad;
842 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
843 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
846 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
850 Py_DECREF(ascii_chars_u);
851 Py_DECREF(ascii_chars_b);
853 Py_DECREF(default_encoding);
856 Py_XDECREF(default_encoding);
857 Py_XDECREF(ascii_chars_u);
858 Py_XDECREF(ascii_chars_b);
862 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
863 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
865 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
866 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
867 static char* __PYX_DEFAULT_STRING_ENCODING;
868 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
870 PyObject* default_encoding = NULL;
871 char* default_encoding_c;
872 sys = PyImport_ImportModule(
"sys");
874 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
876 if (!default_encoding)
goto bad;
877 default_encoding_c = PyBytes_AsString(default_encoding);
878 if (!default_encoding_c)
goto bad;
879 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
880 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
881 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
882 Py_DECREF(default_encoding);
885 Py_XDECREF(default_encoding);
893 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
894 #define likely(x) __builtin_expect(!!(x), 1)
895 #define unlikely(x) __builtin_expect(!!(x), 0)
897 #define likely(x) (x)
898 #define unlikely(x) (x)
900 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
902 static PyObject *__pyx_m = NULL;
903 static PyObject *__pyx_d;
904 static PyObject *__pyx_b;
905 static PyObject *__pyx_cython_runtime = NULL;
906 static PyObject *__pyx_empty_tuple;
907 static PyObject *__pyx_empty_bytes;
908 static PyObject *__pyx_empty_unicode;
909 static int __pyx_lineno;
910 static int __pyx_clineno = 0;
911 static const char * __pyx_cfilenm= __FILE__;
912 static const char *__pyx_filename;
915 #if !defined(CYTHON_CCOMPLEX)
916 #if defined(__cplusplus)
917 #define CYTHON_CCOMPLEX 1
918 #elif defined(_Complex_I)
919 #define CYTHON_CCOMPLEX 1
921 #define CYTHON_CCOMPLEX 0
931 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
933 #define _Complex_I 1.0fj
937 static const char *__pyx_f[] = {
938 "proteus/Isosurface.pyx",
943 #define IS_UNSIGNED(type) (((type) -1) > 0)
944 struct __Pyx_StructField_;
945 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
948 struct __Pyx_StructField_* fields;
956 typedef struct __Pyx_StructField_ {
957 __Pyx_TypeInfo* type;
962 __Pyx_StructField* field;
963 size_t parent_offset;
964 } __Pyx_BufFmt_StackElem;
966 __Pyx_StructField root;
967 __Pyx_BufFmt_StackElem* head;
969 size_t new_count, enc_count;
970 size_t struct_alignment;
976 } __Pyx_BufFmt_Context;
986 typedef npy_int8 __pyx_t_5numpy_int8_t;
995 typedef npy_int16 __pyx_t_5numpy_int16_t;
1004 typedef npy_int32 __pyx_t_5numpy_int32_t;
1013 typedef npy_int64 __pyx_t_5numpy_int64_t;
1022 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1031 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1040 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1049 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1058 typedef npy_float32 __pyx_t_5numpy_float32_t;
1067 typedef npy_float64 __pyx_t_5numpy_float64_t;
1076 typedef npy_long __pyx_t_5numpy_int_t;
1085 typedef npy_longlong __pyx_t_5numpy_long_t;
1094 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1103 typedef npy_ulong __pyx_t_5numpy_uint_t;
1112 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1121 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1130 typedef npy_intp __pyx_t_5numpy_intp_t;
1139 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1148 typedef npy_double __pyx_t_5numpy_float_t;
1157 typedef npy_double __pyx_t_5numpy_double_t;
1166 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1170 typedef ::std::complex< float > __pyx_t_float_complex;
1172 typedef float _Complex __pyx_t_float_complex;
1175 typedef struct {
float real, imag; } __pyx_t_float_complex;
1177 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1182 typedef ::std::complex< double > __pyx_t_double_complex;
1184 typedef double _Complex __pyx_t_double_complex;
1187 typedef struct {
double real, imag; } __pyx_t_double_complex;
1189 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1193 struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel;
1194 struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr;
1203 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1212 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1221 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1230 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1231 struct __pyx_opt_args_10Isosurface_EVec;
1240 struct __pyx_opt_args_10Isosurface_EVec {
1254 struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel {
1256 PyObject *__pyx_v_self;
1267 struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr {
1269 struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *__pyx_outer_scope;
1270 PyObject *__pyx_v_bn;
1271 PyObject *__pyx_v_gn;
1277 #ifndef CYTHON_REFNANNY
1278 #define CYTHON_REFNANNY 0
1282 void (*INCREF)(
void*, PyObject*, int);
1283 void (*DECREF)(
void*, PyObject*, int);
1284 void (*GOTREF)(
void*, PyObject*, int);
1285 void (*GIVEREF)(
void*, PyObject*, int);
1286 void* (*SetupContext)(
const char*, int,
const char*);
1287 void (*FinishContext)(
void**);
1288 } __Pyx_RefNannyAPIStruct;
1289 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1290 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1291 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1293 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1295 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1296 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1297 PyGILState_Release(__pyx_gilstate_save);\
1299 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1302 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1303 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1305 #define __Pyx_RefNannyFinishContext()\
1306 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1307 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1308 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1309 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1310 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1311 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1312 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1313 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1314 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1316 #define __Pyx_RefNannyDeclarations
1317 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1318 #define __Pyx_RefNannyFinishContext()
1319 #define __Pyx_INCREF(r) Py_INCREF(r)
1320 #define __Pyx_DECREF(r) Py_DECREF(r)
1321 #define __Pyx_GOTREF(r)
1322 #define __Pyx_GIVEREF(r)
1323 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1324 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1325 #define __Pyx_XGOTREF(r)
1326 #define __Pyx_XGIVEREF(r)
1328 #define __Pyx_XDECREF_SET(r, v) do {\
1329 PyObject *tmp = (PyObject *) r;\
1330 r = v; __Pyx_XDECREF(tmp);\
1332 #define __Pyx_DECREF_SET(r, v) do {\
1333 PyObject *tmp = (PyObject *) r;\
1334 r = v; __Pyx_DECREF(tmp);\
1336 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1337 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1340 #if CYTHON_USE_TYPE_SLOTS
1341 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1343 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1347 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1350 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1351 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1352 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1353 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1354 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1355 (cache_var) = (value);
1356 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1357 static PY_UINT64_T __pyx_dict_version = 0;\
1358 static PyObject *__pyx_dict_cached_value = NULL;\
1359 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1360 (VAR) = __pyx_dict_cached_value;\
1362 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1363 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1366 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1367 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1368 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1370 #define __PYX_GET_DICT_VERSION(dict) (0)
1371 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1372 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1376 #if CYTHON_USE_DICT_VERSIONS
1377 #define __Pyx_GetModuleGlobalName(var, name) {\
1378 static PY_UINT64_T __pyx_dict_version = 0;\
1379 static PyObject *__pyx_dict_cached_value = NULL;\
1380 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1381 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1382 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1384 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1385 PY_UINT64_T __pyx_dict_version;\
1386 PyObject *__pyx_dict_cached_value;\
1387 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1389 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1391 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1392 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1393 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1397 #if CYTHON_COMPILING_IN_CPYTHON
1398 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1400 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1404 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1407 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
1410 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
1411 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1412 __Pyx_BufFmt_StackElem* stack,
1413 __Pyx_TypeInfo* type);
1416 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
1417 ((obj == Py_None || obj == NULL) ?\
1418 (__Pyx_ZeroBuffer(buf), 0) :\
1419 __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
1420 static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1421 __Pyx_TypeInfo* dtype,
int flags,
int nd,
int cast, __Pyx_BufFmt_StackElem* stack);
1422 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1423 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1424 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1425 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1428 static void __Pyx_RaiseBufferIndexError(
int axis);
1430 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
1432 #if CYTHON_FAST_THREAD_STATE
1433 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1434 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1435 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1437 #define __Pyx_PyThreadState_declare
1438 #define __Pyx_PyThreadState_assign
1439 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1443 #if CYTHON_FAST_THREAD_STATE
1444 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1445 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1446 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1447 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1448 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1449 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1450 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1451 #if CYTHON_COMPILING_IN_CPYTHON
1452 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1454 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1457 #define __Pyx_PyErr_Clear() PyErr_Clear()
1458 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1459 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1460 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1461 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1462 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1463 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1464 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1468 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1469 int lineno,
const char *filename,
1470 int full_traceback,
int nogil);
1473 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1474 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1477 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1480 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1481 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1482 const char* function_name);
1485 #if CYTHON_USE_TYPE_SLOTS
1486 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1487 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1489 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1490 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1494 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1497 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1500 static CYTHON_INLINE
int __Pyx_IterFinish(
void);
1503 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1506 #if !CYTHON_COMPILING_IN_PYPY
1507 static PyObject* __Pyx_PyFloat_EqObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check);
1509 #define __Pyx_PyFloat_EqObjC(op1, op2, floatval, inplace, zerodivision_check)\
1510 (PyObject_RichCompare(op1, op2, Py_EQ))
1514 #if CYTHON_FAST_PYCALL
1515 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1516 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1517 #if 1 || PY_VERSION_HEX < 0x030600B1
1518 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1520 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1522 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1523 (sizeof(char [1 - 2*!(cond)]) - 1)
1524 #ifndef Py_MEMBER_SIZE
1525 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1527 #if CYTHON_FAST_PYCALL
1528 static size_t __pyx_pyframe_localsplus_offset = 0;
1529 #include "frameobject.h"
1530 #if PY_VERSION_HEX >= 0x030b00a6
1531 #ifndef Py_BUILD_CORE
1532 #define Py_BUILD_CORE 1
1534 #include "internal/pycore_frame.h"
1536 #define __Pxy_PyFrame_Initialize_Offsets()\
1537 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1538 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1539 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1540 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1541 #endif // CYTHON_FAST_PYCALL
1545 #if CYTHON_COMPILING_IN_CPYTHON
1546 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1550 #if CYTHON_COMPILING_IN_CPYTHON
1551 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1553 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1557 #if CYTHON_FAST_PYCCALL
1558 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1560 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1564 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1567 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname);
1570 #if !CYTHON_COMPILING_IN_PYPY
1571 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1573 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1574 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1578 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1579 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1580 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1581 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1582 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1583 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1584 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1585 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1586 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1587 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1588 int wraparound,
int boundscheck);
1589 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1590 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1591 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1592 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1593 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1594 int wraparound,
int boundscheck);
1595 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1596 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1597 int is_list,
int wraparound,
int boundscheck);
1600 #if CYTHON_USE_TYPE_SLOTS
1601 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1603 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1607 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1610 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1613 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1614 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1615 PyListObject*
L = (PyListObject*) list;
1616 Py_ssize_t len = Py_SIZE(list);
1617 if (likely(
L->allocated > len)) {
1619 PyList_SET_ITEM(list, len, x);
1620 __Pyx_SET_SIZE(list, len + 1);
1623 return PyList_Append(list, x);
1626 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1630 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1633 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1634 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1635 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1636 int has_cstart,
int has_cstop,
int wraparound);
1639 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2,
long intval,
long inplace);
1642 #if !CYTHON_COMPILING_IN_PYPY
1643 static PyObject* __Pyx_PyFloat_NeObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check);
1645 #define __Pyx_PyFloat_NeObjC(op1, op2, floatval, inplace, zerodivision_check)\
1646 (PyObject_RichCompare(op1, op2, Py_NE))
1650 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1653 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1654 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1655 PyListObject*
L = (PyListObject*) list;
1656 Py_ssize_t len = Py_SIZE(list);
1657 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
1659 PyList_SET_ITEM(list, len, x);
1660 __Pyx_SET_SIZE(list, len + 1);
1663 return PyList_Append(list, x);
1666 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1670 static void __Pyx_RaiseBufferFallbackError(
void);
1673 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1674 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1675 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
1676 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
1677 __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
1678 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *
v);
1679 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *
v,
1680 int is_list,
int wraparound,
int boundscheck);
1686 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1689 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1692 #if PY_MAJOR_VERSION >= 3
1693 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1695 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1699 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2,
long intval,
long inplace);
1702 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
1705 #if CYTHON_USE_EXC_INFO_STACK
1706 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1710 #if CYTHON_FAST_THREAD_STATE
1711 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1712 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1713 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1714 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1716 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1717 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1721 #if CYTHON_FAST_THREAD_STATE
1722 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1723 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1725 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1729 #if CYTHON_FAST_THREAD_STATE
1730 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1731 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1733 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1737 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1738 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1740 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1744 #ifndef __PYX_HAVE_RT_ImportType_proto
1745 #define __PYX_HAVE_RT_ImportType_proto
1746 enum __Pyx_ImportType_CheckSize {
1747 __Pyx_ImportType_CheckSize_Error = 0,
1748 __Pyx_ImportType_CheckSize_Warn = 1,
1749 __Pyx_ImportType_CheckSize_Ignore = 2
1751 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
1755 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1758 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1761 #define __Pyx_CyFunction_USED 1
1762 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1763 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1764 #define __Pyx_CYFUNCTION_CCLASS 0x04
1765 #define __Pyx_CyFunction_GetClosure(f)\
1766 (((__pyx_CyFunctionObject *) (f))->func_closure)
1767 #define __Pyx_CyFunction_GetClassObj(f)\
1768 (((__pyx_CyFunctionObject *) (f))->func_classobj)
1769 #define __Pyx_CyFunction_Defaults(type, f)\
1770 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1771 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1772 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1774 PyCFunctionObject func;
1775 #if PY_VERSION_HEX < 0x030500A0
1776 PyObject *func_weakreflist;
1778 PyObject *func_dict;
1779 PyObject *func_name;
1780 PyObject *func_qualname;
1782 PyObject *func_globals;
1783 PyObject *func_code;
1784 PyObject *func_closure;
1785 PyObject *func_classobj;
1787 int defaults_pyobjects;
1788 size_t defaults_size;
1790 PyObject *defaults_tuple;
1791 PyObject *defaults_kwdict;
1792 PyObject *(*defaults_getter)(PyObject *);
1793 PyObject *func_annotations;
1794 } __pyx_CyFunctionObject;
1795 static PyTypeObject *__pyx_CyFunctionType = 0;
1796 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
1797 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
1798 int flags, PyObject* qualname,
1800 PyObject *module, PyObject *globals,
1802 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1805 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1807 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1809 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1811 static int __pyx_CyFunction_init(
void);
1814 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
1815 int flags, PyObject* qualname,
1817 PyObject *module, PyObject *globals,
1821 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1822 #define __Pyx_SetNameInClass(ns, name, value)\
1823 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1824 #elif CYTHON_COMPILING_IN_CPYTHON
1825 #define __Pyx_SetNameInClass(ns, name, value)\
1826 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1828 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1832 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
1833 PyObject *mkw, PyObject *modname, PyObject *doc);
1834 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
1835 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
1838 #ifdef CYTHON_CLINE_IN_TRACEBACK
1839 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1841 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1846 PyCodeObject* code_object;
1848 } __Pyx_CodeObjectCacheEntry;
1849 struct __Pyx_CodeObjectCache {
1852 __Pyx_CodeObjectCacheEntry* entries;
1854 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1855 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1856 static PyCodeObject *__pyx_find_code_object(
int code_line);
1857 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1860 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1861 int py_line,
const char *filename);
1865 Py_ssize_t shape, strides, suboffsets;
1866 } __Pyx_Buf_DimInfo;
1872 __Pyx_Buffer *rcbuffer;
1874 __Pyx_Buf_DimInfo diminfo[8];
1875 } __Pyx_LocalBuf_ND;
1877 #if PY_MAJOR_VERSION < 3
1878 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
1879 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1881 #define __Pyx_GetBuffer PyObject_GetBuffer
1882 #define __Pyx_ReleaseBuffer PyBuffer_Release
1887 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1888 #define __Pyx_HAS_GCC_DIAGNOSTIC
1892 static int __Pyx_Print(PyObject*, PyObject *,
int);
1893 #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
1894 static PyObject* __pyx_print = 0;
1895 static PyObject* __pyx_print_kwargs = 0;
1901 #define __Pyx_CREAL(z) ((z).real())
1902 #define __Pyx_CIMAG(z) ((z).imag())
1904 #define __Pyx_CREAL(z) (__real__(z))
1905 #define __Pyx_CIMAG(z) (__imag__(z))
1908 #define __Pyx_CREAL(z) ((z).real)
1909 #define __Pyx_CIMAG(z) ((z).imag)
1911 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1912 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1913 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1914 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1916 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1917 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1922 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1923 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1924 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1925 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1926 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1927 #define __Pyx_c_neg_float(a) (-(a))
1929 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1930 #define __Pyx_c_conj_float(z) (::std::conj(z))
1932 #define __Pyx_c_abs_float(z) (::std::abs(z))
1933 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1936 #define __Pyx_c_is_zero_float(z) ((z)==0)
1937 #define __Pyx_c_conj_float(z) (conjf(z))
1939 #define __Pyx_c_abs_float(z) (cabsf(z))
1940 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1944 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1945 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1946 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1947 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1948 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1949 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1950 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1951 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1953 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
1954 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1960 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1961 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1962 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1963 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1964 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1965 #define __Pyx_c_neg_double(a) (-(a))
1967 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1968 #define __Pyx_c_conj_double(z) (::std::conj(z))
1970 #define __Pyx_c_abs_double(z) (::std::abs(z))
1971 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1974 #define __Pyx_c_is_zero_double(z) ((z)==0)
1975 #define __Pyx_c_conj_double(z) (conj(z))
1977 #define __Pyx_c_abs_double(z) (cabs(z))
1978 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1982 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1983 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1984 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1985 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1986 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1987 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1988 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1989 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1991 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
1992 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1997 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2000 static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
2003 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2006 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2009 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2012 #if CYTHON_COMPILING_IN_CPYTHON
2013 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2014 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2015 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2016 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2018 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2019 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2020 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2022 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2025 #if CYTHON_FAST_THREAD_STATE
2026 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2027 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2029 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2033 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2036 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
2039 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
2040 #if CYTHON_USE_EXC_INFO_STACK
2041 #define __Pyx_ExcInfoStruct _PyErr_StackItem
2045 PyObject *exc_value;
2046 PyObject *exc_traceback;
2047 } __Pyx_ExcInfoStruct;
2051 __pyx_coroutine_body_t body;
2053 __Pyx_ExcInfoStruct gi_exc_state;
2054 PyObject *gi_weakreflist;
2056 PyObject *yieldfrom;
2058 PyObject *gi_qualname;
2059 PyObject *gi_modulename;
2064 } __pyx_CoroutineObject;
2065 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
2066 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2067 PyObject *name, PyObject *qualname, PyObject *module_name);
2068 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
2069 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2070 PyObject *name, PyObject *qualname, PyObject *module_name);
2071 static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *
self);
2072 static int __Pyx_Coroutine_clear(PyObject *
self);
2073 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
2074 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
2075 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
2076 #if CYTHON_USE_EXC_INFO_STACK
2077 #define __Pyx_Coroutine_SwapException(self)
2078 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
2080 #define __Pyx_Coroutine_SwapException(self) {\
2081 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
2082 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
2084 #define __Pyx_Coroutine_ResetAndClearException(self) {\
2085 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
2086 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
2089 #if CYTHON_FAST_THREAD_STATE
2090 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2091 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
2093 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2094 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
2096 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
2097 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
2100 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
2103 static int __Pyx_patch_abc(
void);
2106 #define __Pyx_Generator_USED
2107 static PyTypeObject *__pyx_GeneratorType = 0;
2108 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
2109 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
2110 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
2111 static PyObject *__Pyx_Generator_Next(PyObject *
self);
2112 static int __pyx_Generator_init(
void);
2115 static int __Pyx_check_binary_version(
void);
2118 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2130 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2143 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2144 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2145 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2146 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2147 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2148 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2149 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2150 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2151 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2152 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2153 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2154 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2155 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2156 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2157 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2162 static PyTypeObject *__pyx_ptype_10Isosurface___pyx_scope_struct__attachModel = 0;
2163 static PyTypeObject *__pyx_ptype_10Isosurface___pyx_scope_struct_1_genexpr = 0;
2164 static PyArrayObject *__pyx_f_10Isosurface_EVec(
struct __pyx_opt_args_10Isosurface_EVec *__pyx_optional_args);
2165 static double __pyx_f_10Isosurface_enorm(PyArrayObject *);
2166 static double __pyx_f_10Isosurface_edot(PyArrayObject *, PyArrayObject *);
2167 static PyArrayObject *__pyx_f_10Isosurface_ecross(PyArrayObject *, PyArrayObject *);
2168 static double __pyx_f_10Isosurface_etriple(PyArrayObject *, PyArrayObject *, PyArrayObject *);
2169 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = {
"float64_t", NULL,
sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0,
'R', 0, 0 };
2170 #define __Pyx_MODULE_NAME "Isosurface"
2171 extern int __pyx_module_is_main_Isosurface;
2172 int __pyx_module_is_main_Isosurface = 0;
2175 static PyObject *__pyx_builtin_enumerate;
2176 static PyObject *__pyx_builtin_NotImplementedError;
2177 static PyObject *__pyx_builtin_range;
2178 static PyObject *__pyx_builtin_open;
2179 static PyObject *__pyx_builtin_zip;
2180 static PyObject *__pyx_builtin_ImportError;
2181 static const char __pyx_k_I[] =
"I";
2182 static const char __pyx_k_J[] =
"J";
2183 static const char __pyx_k_L[] =
"L";
2184 static const char __pyx_k_a[] =
"a";
2185 static const char __pyx_k_d[] =
"d";
2186 static const char __pyx_k_e[] =
"e";
2187 static const char __pyx_k_f[] =
"f";
2188 static const char __pyx_k_i[] =
"i";
2189 static const char __pyx_k_j[] =
"j";
2190 static const char __pyx_k_n[] =
"n";
2191 static const char __pyx_k_s[] =
"s";
2192 static const char __pyx_k_u[] =
"u";
2193 static const char __pyx_k_v[] =
"v";
2194 static const char __pyx_k_w[] =
"w";
2195 static const char __pyx_k_x[] =
"x";
2196 static const char __pyx_k__4[] =
"/";
2197 static const char __pyx_k__6[] =
"}\n";
2198 static const char __pyx_k_ar[] =
"ar";
2199 static const char __pyx_k_dx[] =
"dx";
2200 static const char __pyx_k_eN[] =
"eN";
2201 static const char __pyx_k_h5[] =
"h5";
2202 static const char __pyx_k_ni[] =
"ni";
2203 static const char __pyx_k_np[] =
"np";
2204 static const char __pyx_k_os[] =
"os";
2205 static const char __pyx_k_0_d[] =
"{0:d},\n";
2206 static const char __pyx_k_MPI[] =
"MPI";
2207 static const char __pyx_k__10[] =
"";
2208 static const char __pyx_k_bnt[] =
"bnt";
2209 static const char __pyx_k_cam[] =
"cam";
2210 static const char __pyx_k_doc[] =
"__doc__";
2211 static const char __pyx_k_dof[] =
"dof";
2212 static const char __pyx_k_ebN[] =
"ebN";
2213 static const char __pyx_k_end[] =
"end";
2214 static const char __pyx_k_eps[] =
"eps";
2215 static const char __pyx_k_fur[] =
"fur";
2216 static const char __pyx_k_g2b[] =
"g2b";
2217 static const char __pyx_k_get[] =
"get";
2218 static const char __pyx_k_log[] =
"log";
2219 static const char __pyx_k_nll[] =
"nll";
2220 static const char __pyx_k_phi[] =
"phi";
2221 static const char __pyx_k_pov[] =
"pov";
2222 static const char __pyx_k_zip[] =
"zip";
2223 static const char __pyx_k_Comm[] =
"Comm";
2224 static const char __pyx_k_File[] =
"File";
2225 static const char __pyx_k_args[] =
"args";
2226 static const char __pyx_k_comm[] =
"comm";
2227 static const char __pyx_k_data[] =
"data";
2228 static const char __pyx_k_dset[] =
"dset";
2229 static const char __pyx_k_file[] =
"file";
2230 static const char __pyx_k_h5_2[] =
".h5";
2231 static const char __pyx_k_h5py[] =
"h5py";
2232 static const char __pyx_k_init[] =
"__init__";
2233 static const char __pyx_k_join[] =
"join";
2234 static const char __pyx_k_main[] =
"__main__";
2235 static const char __pyx_k_mesh[] =
"mesh";
2236 static const char __pyx_k_name[] =
"__name__";
2237 static const char __pyx_k_norm[] =
"norm";
2238 static const char __pyx_k_open[] =
"open";
2239 static const char __pyx_k_path[] =
"path";
2240 static const char __pyx_k_plus[] =
"plus";
2241 static const char __pyx_k_rank[] =
"rank";
2242 static const char __pyx_k_self[] =
"self";
2243 static const char __pyx_k_send[] =
"send";
2244 static const char __pyx_k_step[] =
"step";
2245 static const char __pyx_k_test[] =
"__test__";
2246 static const char __pyx_k_time[] =
"time";
2247 static const char __pyx_k_PETSc[] =
"PETSc";
2248 static const char __pyx_k_array[] =
"array";
2249 static const char __pyx_k_cam_x[] =
"cam_x";
2250 static const char __pyx_k_cam_y[] =
"cam_y";
2251 static const char __pyx_k_cam_z[] =
"cam_z";
2252 static const char __pyx_k_close[] =
"close";
2253 static const char __pyx_k_elems[] =
"elems";
2254 static const char __pyx_k_field[] =
"field";
2255 static const char __pyx_k_flush[] =
"flush";
2256 static const char __pyx_k_frame[] =
"frame";
2257 static const char __pyx_k_fur_x[] =
"fur_x";
2258 static const char __pyx_k_fur_y[] =
"fur_y";
2259 static const char __pyx_k_fur_z[] =
"fur_z";
2260 static const char __pyx_k_index[] =
"index";
2261 static const char __pyx_k_light[] =
"light";
2262 static const char __pyx_k_minus[] =
"minus";
2263 static const char __pyx_k_model[] =
"model";
2264 static const char __pyx_k_nPlus[] =
"nPlus";
2265 static const char __pyx_k_nll_x[] =
"nll_x";
2266 static const char __pyx_k_nll_y[] =
"nll_y";
2267 static const char __pyx_k_nll_z[] =
"nll_z";
2268 static const char __pyx_k_nodes[] =
"nodes";
2269 static const char __pyx_k_numpy[] =
"numpy";
2270 static const char __pyx_k_print[] =
"print";
2271 static const char __pyx_k_range[] =
"range";
2272 static const char __pyx_k_shape[] =
"shape";
2273 static const char __pyx_k_sky_z[] =
"sky_z";
2274 static const char __pyx_k_tLast[] =
"tLast";
2275 static const char __pyx_k_throw[] =
"throw";
2276 static const char __pyx_k_value[] =
"value";
2277 static const char __pyx_k_write[] =
"write";
2278 static const char __pyx_k_zeros[] =
"zeros";
2279 static const char __pyx_k_domain[] =
"domain";
2280 static const char __pyx_k_format[] =
"format";
2281 static const char __pyx_k_import[] =
"__import__";
2282 static const char __pyx_k_logDir[] =
"logDir";
2283 static const char __pyx_k_module[] =
"__module__";
2284 static const char __pyx_k_mpi4py[] =
"mpi4py";
2285 static const char __pyx_k_nMinus[] =
"nMinus";
2286 static const char __pyx_k_nZeros[] =
"nZeros";
2287 static const char __pyx_k_normal[] =
"normal";
2288 static const char __pyx_k_string[] =
"string";
2289 static const char __pyx_k_values[] =
"values";
2290 static const char __pyx_k_wall_y[] =
"wall_y";
2291 static const char __pyx_k_AV_base[] =
"AV_base";
2292 static const char __pyx_k_barrier[] =
"barrier";
2293 static const char __pyx_k_field_i[] =
"field_i";
2294 static const char __pyx_k_flatten[] =
"flatten";
2295 static const char __pyx_k_floor_z[] =
"floor_z";
2296 static const char __pyx_k_genexpr[] =
"genexpr";
2297 static const char __pyx_k_light_x[] =
"light_x";
2298 static const char __pyx_k_light_y[] =
"light_y";
2299 static const char __pyx_k_light_z[] =
"light_z";
2300 static const char __pyx_k_look_at[] =
"look_at";
2301 static const char __pyx_k_nFrames[] =
"nFrames";
2302 static const char __pyx_k_normals[] =
"normals";
2303 static const char __pyx_k_prepare[] =
"__prepare__";
2304 static const char __pyx_k_product[] =
"product";
2305 static const char __pyx_k_proteus[] =
"proteus";
2306 static const char __pyx_k_FemField[] =
"FemField";
2307 static const char __pyx_k_Template[] =
"Template";
2308 static const char __pyx_k_elements[] =
"elements";
2309 static const char __pyx_k_filename[] =
"filename";
2310 static const char __pyx_k_get_node[] =
"get_node";
2311 static const char __pyx_k_isMaster[] =
"isMaster";
2312 static const char __pyx_k_light_dx[] =
"light_dx";
2313 static const char __pyx_k_light_dy[] =
"light_dy";
2314 static const char __pyx_k_logEvent[] =
"logEvent";
2315 static const char __pyx_k_nN_start[] =
"nN_start";
2316 static const char __pyx_k_petsc4py[] =
"petsc4py";
2317 static const char __pyx_k_povScene[] =
"povScene";
2318 static const char __pyx_k_qualname[] =
"__qualname__";
2319 static const char __pyx_k_Profiling[] =
"Profiling";
2320 static const char __pyx_k_calculate[] =
"calculate";
2321 static const char __pyx_k_checkTime[] =
"checkTime";
2322 static const char __pyx_k_enumerate[] =
"enumerate";
2323 static const char __pyx_k_fine_grid[] =
"fine_grid";
2324 static const char __pyx_k_itertools[] =
"itertools";
2325 static const char __pyx_k_look_at_x[] =
"look_at_x";
2326 static const char __pyx_k_look_at_y[] =
"look_at_y";
2327 static const char __pyx_k_look_at_z[] =
"look_at_z";
2328 static const char __pyx_k_metaclass[] =
"__metaclass__";
2329 static const char __pyx_k_nodeArray[] =
"nodeArray";
2330 static const char __pyx_k_Isosurface[] =
"Isosurface";
2331 static const char __pyx_k_activeTime[] =
"activeTime";
2332 static const char __pyx_k_attachHDF5[] =
"attachHDF5";
2333 static const char __pyx_k_fieldNames[] =
"fieldNames";
2334 static const char __pyx_k_fileprefix[] =
"fileprefix";
2335 static const char __pyx_k_isosurface[] =
"isosurface";
2336 static const char __pyx_k_namedtuple[] =
"namedtuple";
2337 static const char __pyx_k_sampleRate[] =
"sampleRate";
2338 static const char __pyx_k_substitute[] =
"substitute";
2339 static const char __pyx_k_0_d_1_d_2_d[] =
"<{0:d},{1:d},{2:d}>,\n";
2340 static const char __pyx_k_0_f_1_f_2_f[] =
"<{0:f}, {1:f}, {2:f}>,\n";
2341 static const char __pyx_k_ImportError[] =
"ImportError";
2342 static const char __pyx_k_OrderedDict[] =
"OrderedDict";
2343 static const char __pyx_k_attachModel[] =
"attachModel";
2344 static const char __pyx_k_collections[] =
"collections";
2345 static const char __pyx_k_defaultdict[] =
"defaultdict";
2346 static const char __pyx_k_isosurfaces[] =
"isosurfaces";
2347 static const char __pyx_k_next_output[] =
"next_output";
2348 static const char __pyx_k_proteus_inc[] =
"proteus.inc";
2349 static const char __pyx_k_coefficients[] =
"coefficients";
2350 static const char __pyx_k_domain_fur_x[] =
"domain_fur_x";
2351 static const char __pyx_k_domain_fur_y[] =
"domain_fur_y";
2352 static const char __pyx_k_domain_fur_z[] =
"domain_fur_z";
2353 static const char __pyx_k_domain_nll_x[] =
"domain_nll_x";
2354 static const char __pyx_k_domain_nll_y[] =
"domain_nll_y";
2355 static const char __pyx_k_domain_nll_z[] =
"domain_nll_z";
2356 static const char __pyx_k_face_indices[] =
"face_indices {\n ";
2357 static const char __pyx_k_numpy_linalg[] =
"numpy.linalg";
2358 static const char __pyx_k_pov_filename[] =
"pov_filename";
2359 static const char __pyx_k_0_d_1_d_2_d_2[] =
"<{0:d}, {1:d}, {2:d}>,\n";
2360 static const char __pyx_k_boundaryNodes[] =
"boundaryNodes";
2361 static const char __pyx_k_count_nonzero[] =
"count_nonzero";
2362 static const char __pyx_k_endSequential[] =
"endSequential";
2363 static const char __pyx_k_variableNames[] =
"variableNames";
2364 static const char __pyx_k_writeBoundary[] =
"writeBoundary";
2365 static const char __pyx_k_create_dataset[] =
"create_dataset";
2366 static const char __pyx_k_face_indices_2[] =
" }\n face_indices {\n ";
2367 static const char __pyx_k_levelModelList[] =
"levelModelList";
2368 static const char __pyx_k_normal_indices[] =
"normal_indices";
2369 static const char __pyx_k_normal_vectors[] =
" }\n normal_vectors {\n ";
2370 static const char __pyx_k_beginSequential[] =
"beginSequential";
2371 static const char __pyx_k_timeIntegration[] =
"timeIntegration";
2372 static const char __pyx_k_nElements_global[] =
"nElements_global";
2373 static const char __pyx_k_normal_indices_2[] =
" }\n normal_indices {\n ";
2374 static const char __pyx_k_povSceneTemplate[] =
"povSceneTemplate";
2375 static const char __pyx_k_writeSceneHeader[] =
"writeSceneHeader";
2376 static const char __pyx_k_ATTACHING_TO_HDF5[] =
"ATTACHING TO HDF5 !!";
2377 static const char __pyx_k_Isosurface___init[] =
"Isosurface.__init__";
2378 static const char __pyx_k_Writing_pov_frame[] =
"Writing pov frame ";
2379 static const char __pyx_k_elementNodesArray[] =
"elementNodesArray";
2380 static const char __pyx_k_AuxiliaryVariables[] =
"AuxiliaryVariables";
2381 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2382 static const char __pyx_k_num_owned_elements[] =
"num_owned_elements";
2383 static const char __pyx_k_Extract_isosurfaces[] =
"Extract isosurfaces";
2384 static const char __pyx_k_NotImplementedError[] =
"NotImplementedError";
2385 static const char __pyx_k_nodesSpatial_Domain[] =
"/nodesSpatial_Domain";
2386 static const char __pyx_k_writeIsosurfaceMesh[] =
"writeIsosurfaceMesh";
2387 static const char __pyx_k_Isosurface_calculate[] =
"Isosurface.calculate";
2388 static const char __pyx_k_mesh2_vertex_vectors[] =
"mesh2 {\nvertex_vectors {";
2389 static const char __pyx_k_Isosurface_attachHDF5[] =
"Isosurface.attachHDF5";
2390 static const char __pyx_k_inside_vector_on_mesh[] =
"//inside_vector on\n}//mesh\n";
2391 static const char __pyx_k_triangulateIsosurface[] =
"triangulateIsosurface";
2392 static const char __pyx_k_Isosurface_attachModel[] =
"Isosurface.attachModel";
2393 static const char __pyx_k_elementsSpatial_Domain[] =
"/elementsSpatial_Domain";
2394 static const char __pyx_k_proteus_Isosurface_pyx[] =
"proteus/Isosurface.pyx";
2395 static const char __pyx_k_writeIsosurfaceMesh_h5[] =
"writeIsosurfaceMesh_h5";
2396 static const char __pyx_k_Calculate_called_at_time[] =
"Calculate called at time ";
2397 static const char __pyx_k_elementBoundaryNodesArray[] =
"elementBoundaryNodesArray";
2398 static const char __pyx_k_writeIsosurfaceMesh_povray[] =
"writeIsosurfaceMesh_povray";
2399 static const char __pyx_k_Isosurface_writeSceneHeader[] =
"Isosurface.writeSceneHeader";
2400 static const char __pyx_k_elementBoundaryMaterialTypes[] =
"elementBoundaryMaterialTypes";
2401 static const char __pyx_k_Isosurface_writeIsosurfaceMesh[] =
"Isosurface.writeIsosurfaceMesh";
2402 static const char __pyx_k_exteriorElementBoundariesArray[] =
"exteriorElementBoundariesArray";
2403 static const char __pyx_k_AuxiliaryVariables_subclasses_f[] =
"\nAuxiliaryVariables subclasses for extracting isosurfaces and contours\n";
2404 static const char __pyx_k_Only_zero_isocontour_extraction[] =
"Only zero isocontour extraction";
2405 static const char __pyx_k_field_s___value_f___frame_04d_p[] =
"{field:s}_{value:f}_{frame:04d}.pov";
2406 static const char __pyx_k_include_colors_inc_include_text[] =
"#include \"colors.inc\"\n#include \"textures.inc\"\n#include \"glass.inc\"\n#include \"metals.inc\"\n#include \"golds.inc\"\n#include \"stones.inc\"\n#include \"woods.inc\"\n#include \"shapes.inc\"\n#include \"shapes2.inc\"\n#include \"functions.inc\"\n#include \"math.inc\"\n#include \"transforms.inc\"\n\nglobal_settings {\n ambient_light color rgb <1.0, 1.0, 1.0>\n assumed_gamma 2\n}\n\nbackground { color rgb <0.319997, 0.340002, 0.429999>}\n\ncamera {\n perspective\n location <$cam_x,$cam_y,$cam_z>\n sky <0.0, 0.0, 5.0>\n up <0, 0, 1>\n right <1.33, 0, 0>\n angle 45.000000\n look_at <$look_at_x,$look_at_y,$look_at_z>\n}\n\nlight_source {<$light_x,$light_y,$light_z> color White}\n\nlight_source {\n <$light_x+$light_dx,$light_y+$light_dy,$light_z>\n color <0.99980, 0.999800, 0.999800>*2.250000\n spotlight\n point_at <0.5,0.5,0.0>\n}\n\nlight_source {\n <$light_x+$light_dx,$light_y-$light_dy,$light_z>\n color <0.99980, 0.999800, 0.999800>*2.250000\n spotlight\n point_at <0.5,0.5,0.0>\n}\n\nlight_source {\n <$light_x-$light_dx,$light_y-$light_dy,$light_z>\n color <0.99980, 0.999800, 0.999800>*2.250000\n spotlight\n point_at <0.5,0.5,0.0>\n}\n\nlight_source {\n <$light_x-$light_dx,+$light_y,$light_z>\n color <0.99980, 0.999800, 0.999800>*2.250000\n spotlight\n point_at <0.5,0.5,0.0>\n}\n\n// ground -----------------------------------------------------------------\n//---------------------------------<<< settings of squared plane dimensions\n#declare RasterScale = 0.10;\n#declare RasterHalfLine = 0.0125;\n#declare RasterHalfLineZ = 0.0125;\n//-------------------------------------------------------------------------\n#macro Raster(RScale, HLine)\n pigment{ gradient x scale RScale\n color_map{[0.000 color rgbt<1,1,1,0>*0.8]\n [0+HLine color rgbt<1,1,1,0"">*0.8]\n [0+HLine color rgbt<1,1,1,1>]\n [1-HLine color rgbt<1,1,1,1>]\n [1-HLine color rgbt<1,1,1,0>*0.8]\n [1.000 color rgbt<1,1,1,0>*0.8]} }\n #end// of Raster(RScale, HLine)-macro\n//-------------------------------------------------------------------------\n\n// squared plane XY\nplane { <0,0,1>, $floor_z // plane with layered textures\n texture { pigment{checker color White, color Black}\n scale $light_dy*0.5}\n }\nplane { <0,-1,0>, $wall_y // plane with layered textures\n texture { pigment{color White}\n }\n rotate<0,0,0>\n }\nplane { <0,0,-1>, $sky_z // plane with layered textures\n texture { pigment{color Blue}\n }\n rotate<0,0,0>\n }\n//------------------------------------------------ end of squared plane XZ\n#macro tank_material()\nmaterial{\n texture{\n pigment{ rgbf<.98,.98,.98,0.85>*1}\n finish { ambient 0.0\n diffuse 0.15\n reflection 0.2\n specular 0.6\n roughness 0.005\n // phong 1\n // phong_size 400\n reflection { 0.03, 1.0 fresnel on }\n // conserve_energy\n }\n } // end of texture\n\n interior{ ior 1.5\n fade_power 1001\n fade_distance 0.5\n fade_color <0.8,0.8,0.8>\n } // end of interior\n\n\n} // end of material\n#end\n\n#macro isosurface_material()\nmaterial{\n texture{\n pigment{ rgbf<.98,.98,.98,0.9>*0.95}\n finish { ambient 0.0\n diffuse 0.15\n specular 0.6\n roughness 0.005\n //phong 1\n //phong_size 400\n reflection { 0.2, 1.0 fresnel on }\n conserve_energy\n }\n } // end of texture\n\n interior{ ior 1.33\n fade_power 1001\n fade_distance 0.5\n fade_color <0.8,0.8,0.8>\n } // end of inte""rior\n} // end of material\n#end\n";
2407 static const char __pyx_k_matrix_1_000000_0_000000_0_0000[] =
" }\n matrix < 1.000000, 0.000000, 0.000000,\n 0.000000, 1.000000, 0.000000,\n 0.000000, 0.000000, 1.000000,\n 0.000000, 0.000000, 0.000000 >\n isosurface_material()\n }\n";
2408 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2409 static const char __pyx_k_object_difference_box_nll_x_nll[] =
"\nobject\n{\ndifference\n{\nbox {\n <$nll_x,$nll_y,$nll_z>, // Near lower left corner\n <$fur_x,$fur_y,$fur_z> // Far upper right corner\n }\nbox {\n <$domain_nll_x,$domain_nll_y,$domain_nll_z>, // Near lower left corner\n <$domain_fur_x,$domain_fur_y,$domain_fur_z> // Far upper right corner\n }\n}//difference of perturbed bounding box and boundary\n matrix < 1.000000, 0.000000, 0.000000,\n 0.000000, 1.000000, 0.000000,\n 0.000000, 0.000000, 1.000000,\n 0.000000, 0.000000, 0.000000 >\n tank_material()\n}//object\n";
2410 static const char __pyx_k_union_of_meshes_difference_of_p[] =
"}//union of meshes\n//}//difference of perturbed bounding box and boundary\n matrix < 1.000000, 0.000000, 0.000000,\n 0.000000, 1.000000, 0.000000,\n 0.000000, 0.000000, 1.000000,\n 0.000000, 0.000000, 0.000000 >\n tank_material()\n}//object\n";
2411 static const char __pyx_k_version_3_7_include_proteus_inc[] =
"#version 3.7;\n#include \"proteus.inc\"\n";
2412 static const char __pyx_k_Elements_have_0_d_vertices_but_a[] =
"Elements have {0:d} vertices but algorithm is for tets";
2413 static const char __pyx_k_Isosurface_attachModel_locals_ge[] =
"Isosurface.attachModel.<locals>.genexpr";
2414 static const char __pyx_k_Isosurface_file_format_not_recog[] =
"Isosurface file format not recognized";
2415 static const char __pyx_k_Isosurface_triangulateIsosurface[] =
"Isosurface.triangulateIsosurface";
2416 static const char __pyx_k_Isosurface_writeIsosurfaceMesh_h[] =
"Isosurface.writeIsosurfaceMesh_h5";
2417 static const char __pyx_k_Isosurface_writeIsosurfaceMesh_p[] =
"Isosurface.writeIsosurfaceMesh_povray";
2418 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2419 static const char __pyx_k_only_implemented_for_0_isosurfac[] =
"only implemented for 0 isosurface in 3D for now";
2420 static const char __pyx_k_object_difference_box_nll_x_nll_2[] =
"\nobject\n{\n//difference\n//{\n// box {\n// <$nll_x,$nll_y,$nll_z>, // Near lower left corner\n// <$fur_x,$fur_y,$fur_z> // Far upper right corner\n// }\nunion\n{\n";
2421 static PyObject *__pyx_kp_s_0_d;
2422 static PyObject *__pyx_kp_s_0_d_1_d_2_d;
2423 static PyObject *__pyx_kp_s_0_d_1_d_2_d_2;
2424 static PyObject *__pyx_kp_s_0_f_1_f_2_f;
2425 static PyObject *__pyx_kp_s_ATTACHING_TO_HDF5;
2426 static PyObject *__pyx_n_s_AV_base;
2427 static PyObject *__pyx_n_s_AuxiliaryVariables;
2428 static PyObject *__pyx_kp_s_Calculate_called_at_time;
2429 static PyObject *__pyx_n_s_Comm;
2430 static PyObject *__pyx_kp_s_Elements_have_0_d_vertices_but_a;
2431 static PyObject *__pyx_kp_s_Extract_isosurfaces;
2432 static PyObject *__pyx_n_s_FemField;
2433 static PyObject *__pyx_n_s_File;
2434 static PyObject *__pyx_n_s_I;
2435 static PyObject *__pyx_n_s_ImportError;
2436 static PyObject *__pyx_n_s_Isosurface;
2437 static PyObject *__pyx_n_s_Isosurface___init;
2438 static PyObject *__pyx_n_s_Isosurface_attachHDF5;
2439 static PyObject *__pyx_n_s_Isosurface_attachModel;
2440 static PyObject *__pyx_n_s_Isosurface_attachModel_locals_ge;
2441 static PyObject *__pyx_n_s_Isosurface_calculate;
2442 static PyObject *__pyx_kp_s_Isosurface_file_format_not_recog;
2443 static PyObject *__pyx_n_s_Isosurface_triangulateIsosurface;
2444 static PyObject *__pyx_n_s_Isosurface_writeIsosurfaceMesh;
2445 static PyObject *__pyx_n_s_Isosurface_writeIsosurfaceMesh_h;
2446 static PyObject *__pyx_n_s_Isosurface_writeIsosurfaceMesh_p;
2447 static PyObject *__pyx_n_s_Isosurface_writeSceneHeader;
2448 static PyObject *__pyx_n_s_J;
2449 static PyObject *__pyx_n_s_L;
2450 static PyObject *__pyx_n_s_MPI;
2451 static PyObject *__pyx_n_s_NotImplementedError;
2452 static PyObject *__pyx_kp_s_Only_zero_isocontour_extraction;
2453 static PyObject *__pyx_n_s_OrderedDict;
2454 static PyObject *__pyx_n_s_PETSc;
2455 static PyObject *__pyx_n_s_Profiling;
2456 static PyObject *__pyx_n_s_Template;
2457 static PyObject *__pyx_kp_s_Writing_pov_frame;
2458 static PyObject *__pyx_n_s__10;
2459 static PyObject *__pyx_kp_s__4;
2460 static PyObject *__pyx_kp_s__6;
2461 static PyObject *__pyx_n_s_a;
2462 static PyObject *__pyx_n_s_activeTime;
2463 static PyObject *__pyx_n_s_ar;
2464 static PyObject *__pyx_n_s_args;
2465 static PyObject *__pyx_n_s_array;
2466 static PyObject *__pyx_n_s_attachHDF5;
2467 static PyObject *__pyx_n_s_attachModel;
2468 static PyObject *__pyx_n_s_barrier;
2469 static PyObject *__pyx_n_s_beginSequential;
2470 static PyObject *__pyx_n_s_bnt;
2471 static PyObject *__pyx_n_s_boundaryNodes;
2472 static PyObject *__pyx_n_s_calculate;
2473 static PyObject *__pyx_n_s_cam;
2474 static PyObject *__pyx_n_s_cam_x;
2475 static PyObject *__pyx_n_s_cam_y;
2476 static PyObject *__pyx_n_s_cam_z;
2477 static PyObject *__pyx_n_s_checkTime;
2478 static PyObject *__pyx_n_s_cline_in_traceback;
2479 static PyObject *__pyx_n_s_close;
2480 static PyObject *__pyx_n_s_coefficients;
2481 static PyObject *__pyx_n_s_collections;
2482 static PyObject *__pyx_n_s_comm;
2483 static PyObject *__pyx_n_s_count_nonzero;
2484 static PyObject *__pyx_n_s_create_dataset;
2485 static PyObject *__pyx_n_s_d;
2486 static PyObject *__pyx_n_s_data;
2487 static PyObject *__pyx_n_s_defaultdict;
2488 static PyObject *__pyx_n_s_doc;
2489 static PyObject *__pyx_n_s_dof;
2490 static PyObject *__pyx_n_s_domain;
2491 static PyObject *__pyx_n_s_domain_fur_x;
2492 static PyObject *__pyx_n_s_domain_fur_y;
2493 static PyObject *__pyx_n_s_domain_fur_z;
2494 static PyObject *__pyx_n_s_domain_nll_x;
2495 static PyObject *__pyx_n_s_domain_nll_y;
2496 static PyObject *__pyx_n_s_domain_nll_z;
2497 static PyObject *__pyx_n_s_dset;
2498 static PyObject *__pyx_n_s_dx;
2499 static PyObject *__pyx_n_s_e;
2500 static PyObject *__pyx_n_s_eN;
2501 static PyObject *__pyx_n_s_ebN;
2502 static PyObject *__pyx_n_s_elementBoundaryMaterialTypes;
2503 static PyObject *__pyx_n_s_elementBoundaryNodesArray;
2504 static PyObject *__pyx_n_s_elementNodesArray;
2505 static PyObject *__pyx_n_s_elements;
2506 static PyObject *__pyx_kp_s_elementsSpatial_Domain;
2507 static PyObject *__pyx_n_s_elems;
2508 static PyObject *__pyx_n_s_end;
2509 static PyObject *__pyx_n_s_endSequential;
2510 static PyObject *__pyx_n_s_enumerate;
2511 static PyObject *__pyx_n_s_eps;
2512 static PyObject *__pyx_n_s_exteriorElementBoundariesArray;
2513 static PyObject *__pyx_n_s_f;
2514 static PyObject *__pyx_kp_s_face_indices;
2515 static PyObject *__pyx_kp_s_face_indices_2;
2516 static PyObject *__pyx_n_s_field;
2517 static PyObject *__pyx_n_s_fieldNames;
2518 static PyObject *__pyx_n_s_field_i;
2519 static PyObject *__pyx_kp_s_field_s___value_f___frame_04d_p;
2520 static PyObject *__pyx_n_s_file;
2521 static PyObject *__pyx_n_s_filename;
2522 static PyObject *__pyx_n_s_fileprefix;
2523 static PyObject *__pyx_n_s_fine_grid;
2524 static PyObject *__pyx_n_s_flatten;
2525 static PyObject *__pyx_n_s_floor_z;
2526 static PyObject *__pyx_n_s_flush;
2527 static PyObject *__pyx_n_s_format;
2528 static PyObject *__pyx_n_s_frame;
2529 static PyObject *__pyx_n_s_fur;
2530 static PyObject *__pyx_n_s_fur_x;
2531 static PyObject *__pyx_n_s_fur_y;
2532 static PyObject *__pyx_n_s_fur_z;
2533 static PyObject *__pyx_n_s_g2b;
2534 static PyObject *__pyx_n_s_genexpr;
2535 static PyObject *__pyx_n_s_get;
2536 static PyObject *__pyx_n_s_get_node;
2537 static PyObject *__pyx_n_s_h5;
2538 static PyObject *__pyx_kp_s_h5_2;
2539 static PyObject *__pyx_n_s_h5py;
2540 static PyObject *__pyx_n_s_i;
2541 static PyObject *__pyx_n_s_import;
2542 static PyObject *__pyx_kp_s_include_colors_inc_include_text;
2543 static PyObject *__pyx_n_s_index;
2544 static PyObject *__pyx_n_s_init;
2545 static PyObject *__pyx_kp_s_inside_vector_on_mesh;
2546 static PyObject *__pyx_n_s_isMaster;
2547 static PyObject *__pyx_n_s_isosurface;
2548 static PyObject *__pyx_n_s_isosurfaces;
2549 static PyObject *__pyx_n_s_itertools;
2550 static PyObject *__pyx_n_s_j;
2551 static PyObject *__pyx_n_s_join;
2552 static PyObject *__pyx_n_s_levelModelList;
2553 static PyObject *__pyx_n_s_light;
2554 static PyObject *__pyx_n_s_light_dx;
2555 static PyObject *__pyx_n_s_light_dy;
2556 static PyObject *__pyx_n_s_light_x;
2557 static PyObject *__pyx_n_s_light_y;
2558 static PyObject *__pyx_n_s_light_z;
2559 static PyObject *__pyx_n_s_log;
2560 static PyObject *__pyx_n_s_logDir;
2561 static PyObject *__pyx_n_s_logEvent;
2562 static PyObject *__pyx_n_s_look_at;
2563 static PyObject *__pyx_n_s_look_at_x;
2564 static PyObject *__pyx_n_s_look_at_y;
2565 static PyObject *__pyx_n_s_look_at_z;
2566 static PyObject *__pyx_n_s_main;
2567 static PyObject *__pyx_kp_s_matrix_1_000000_0_000000_0_0000;
2568 static PyObject *__pyx_n_s_mesh;
2569 static PyObject *__pyx_kp_s_mesh2_vertex_vectors;
2570 static PyObject *__pyx_n_s_metaclass;
2571 static PyObject *__pyx_n_s_minus;
2572 static PyObject *__pyx_n_s_model;
2573 static PyObject *__pyx_n_s_module;
2574 static PyObject *__pyx_n_s_mpi4py;
2575 static PyObject *__pyx_n_s_n;
2576 static PyObject *__pyx_n_s_nElements_global;
2577 static PyObject *__pyx_n_s_nFrames;
2578 static PyObject *__pyx_n_s_nMinus;
2579 static PyObject *__pyx_n_s_nN_start;
2580 static PyObject *__pyx_n_s_nPlus;
2581 static PyObject *__pyx_n_s_nZeros;
2582 static PyObject *__pyx_n_s_name;
2583 static PyObject *__pyx_n_s_namedtuple;
2584 static PyObject *__pyx_n_s_next_output;
2585 static PyObject *__pyx_n_s_ni;
2586 static PyObject *__pyx_n_s_nll;
2587 static PyObject *__pyx_n_s_nll_x;
2588 static PyObject *__pyx_n_s_nll_y;
2589 static PyObject *__pyx_n_s_nll_z;
2590 static PyObject *__pyx_n_s_nodeArray;
2591 static PyObject *__pyx_n_s_nodes;
2592 static PyObject *__pyx_kp_s_nodesSpatial_Domain;
2593 static PyObject *__pyx_n_s_norm;
2594 static PyObject *__pyx_n_s_normal;
2595 static PyObject *__pyx_n_s_normal_indices;
2596 static PyObject *__pyx_kp_s_normal_indices_2;
2597 static PyObject *__pyx_kp_s_normal_vectors;
2598 static PyObject *__pyx_n_s_normals;
2599 static PyObject *__pyx_n_s_np;
2600 static PyObject *__pyx_n_s_num_owned_elements;
2601 static PyObject *__pyx_n_s_numpy;
2602 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2603 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2604 static PyObject *__pyx_n_s_numpy_linalg;
2605 static PyObject *__pyx_kp_s_object_difference_box_nll_x_nll;
2606 static PyObject *__pyx_kp_s_object_difference_box_nll_x_nll_2;
2607 static PyObject *__pyx_kp_s_only_implemented_for_0_isosurfac;
2608 static PyObject *__pyx_n_s_open;
2609 static PyObject *__pyx_n_s_os;
2610 static PyObject *__pyx_n_s_path;
2611 static PyObject *__pyx_n_s_petsc4py;
2612 static PyObject *__pyx_n_s_phi;
2613 static PyObject *__pyx_n_s_plus;
2614 static PyObject *__pyx_n_s_pov;
2615 static PyObject *__pyx_n_s_povScene;
2616 static PyObject *__pyx_n_s_povSceneTemplate;
2617 static PyObject *__pyx_n_s_pov_filename;
2618 static PyObject *__pyx_n_s_prepare;
2619 static PyObject *__pyx_n_s_print;
2620 static PyObject *__pyx_n_s_product;
2621 static PyObject *__pyx_n_s_proteus;
2622 static PyObject *__pyx_kp_s_proteus_Isosurface_pyx;
2623 static PyObject *__pyx_kp_s_proteus_inc;
2624 static PyObject *__pyx_n_s_qualname;
2625 static PyObject *__pyx_n_s_range;
2626 static PyObject *__pyx_n_s_rank;
2627 static PyObject *__pyx_n_s_s;
2628 static PyObject *__pyx_n_s_sampleRate;
2629 static PyObject *__pyx_n_s_self;
2630 static PyObject *__pyx_n_s_send;
2631 static PyObject *__pyx_n_s_shape;
2632 static PyObject *__pyx_n_s_sky_z;
2633 static PyObject *__pyx_n_s_step;
2634 static PyObject *__pyx_n_s_string;
2635 static PyObject *__pyx_n_s_substitute;
2636 static PyObject *__pyx_n_s_tLast;
2637 static PyObject *__pyx_n_s_test;
2638 static PyObject *__pyx_n_s_throw;
2639 static PyObject *__pyx_n_s_time;
2640 static PyObject *__pyx_n_s_timeIntegration;
2641 static PyObject *__pyx_n_s_triangulateIsosurface;
2642 static PyObject *__pyx_n_s_u;
2643 static PyObject *__pyx_kp_s_union_of_meshes_difference_of_p;
2644 static PyObject *__pyx_n_s_v;
2645 static PyObject *__pyx_n_s_value;
2646 static PyObject *__pyx_n_s_values;
2647 static PyObject *__pyx_n_s_variableNames;
2648 static PyObject *__pyx_kp_s_version_3_7_include_proteus_inc;
2649 static PyObject *__pyx_n_s_w;
2650 static PyObject *__pyx_n_s_wall_y;
2651 static PyObject *__pyx_n_s_write;
2652 static PyObject *__pyx_n_s_writeBoundary;
2653 static PyObject *__pyx_n_s_writeIsosurfaceMesh;
2654 static PyObject *__pyx_n_s_writeIsosurfaceMesh_h5;
2655 static PyObject *__pyx_n_s_writeIsosurfaceMesh_povray;
2656 static PyObject *__pyx_n_s_writeSceneHeader;
2657 static PyObject *__pyx_n_s_x;
2658 static PyObject *__pyx_n_s_zeros;
2659 static PyObject *__pyx_n_s_zip;
2660 static PyObject *__pyx_pf_10Isosurface_10Isosurface___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_isosurfaces, PyObject *__pyx_v_domain, PyObject *__pyx_v_activeTime, PyObject *__pyx_v_sampleRate, PyObject *__pyx_v_format, PyObject *__pyx_v_writeBoundary);
2661 static PyObject *__pyx_pf_10Isosurface_10Isosurface_11attachModel_genexpr(PyObject *__pyx_self);
2662 static PyObject *__pyx_pf_10Isosurface_10Isosurface_2attachModel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_model, CYTHON_UNUSED PyObject *__pyx_v_ar);
2663 static PyObject *__pyx_pf_10Isosurface_10Isosurface_4attachHDF5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_h5, PyObject *__pyx_v_step, PyObject *__pyx_v_cam);
2664 static PyObject *__pyx_pf_10Isosurface_10Isosurface_6triangulateIsosurface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value);
2665 static PyObject *__pyx_pf_10Isosurface_10Isosurface_8writeIsosurfaceMesh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value, PyObject *__pyx_v_frame);
2666 static PyObject *__pyx_pf_10Isosurface_10Isosurface_10writeIsosurfaceMesh_h5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_frame);
2667 static PyObject *__pyx_pf_10Isosurface_10Isosurface_12writeIsosurfaceMesh_povray(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_frame);
2668 static PyObject *__pyx_pf_10Isosurface_10Isosurface_14calculate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_checkTime);
2669 static PyObject *__pyx_pf_10Isosurface_10Isosurface_16writeSceneHeader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cam);
2670 static PyObject *__pyx_tp_new_10Isosurface___pyx_scope_struct__attachModel(PyTypeObject *t, PyObject *a, PyObject *k);
2671 static PyObject *__pyx_tp_new_10Isosurface___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k);
2672 static PyObject *__pyx_float_0_0;
2673 static PyObject *__pyx_float_0_5;
2674 static PyObject *__pyx_float_2_0;
2675 static PyObject *__pyx_float_0_01;
2676 static PyObject *__pyx_float_0_02;
2677 static PyObject *__pyx_float_0_85;
2678 static PyObject *__pyx_int_0;
2679 static PyObject *__pyx_int_1;
2680 static PyObject *__pyx_int_2;
2681 static PyObject *__pyx_int_3;
2682 static PyObject *__pyx_int_4;
2683 static PyObject *__pyx_int_5;
2684 static PyObject *__pyx_int_10;
2685 static PyObject *__pyx_tuple_;
2686 static PyObject *__pyx_slice__3;
2687 static PyObject *__pyx_tuple__2;
2688 static PyObject *__pyx_tuple__5;
2689 static PyObject *__pyx_tuple__7;
2690 static PyObject *__pyx_tuple__8;
2691 static PyObject *__pyx_tuple__9;
2692 static PyObject *__pyx_tuple__11;
2693 static PyObject *__pyx_tuple__13;
2694 static PyObject *__pyx_tuple__14;
2695 static PyObject *__pyx_tuple__16;
2696 static PyObject *__pyx_tuple__18;
2697 static PyObject *__pyx_tuple__19;
2698 static PyObject *__pyx_tuple__21;
2699 static PyObject *__pyx_tuple__23;
2700 static PyObject *__pyx_tuple__25;
2701 static PyObject *__pyx_tuple__27;
2702 static PyObject *__pyx_tuple__29;
2703 static PyObject *__pyx_tuple__30;
2704 static PyObject *__pyx_tuple__32;
2705 static PyObject *__pyx_codeobj__12;
2706 static PyObject *__pyx_codeobj__15;
2707 static PyObject *__pyx_codeobj__17;
2708 static PyObject *__pyx_codeobj__20;
2709 static PyObject *__pyx_codeobj__22;
2710 static PyObject *__pyx_codeobj__24;
2711 static PyObject *__pyx_codeobj__26;
2712 static PyObject *__pyx_codeobj__28;
2713 static PyObject *__pyx_codeobj__31;
2724 static PyArrayObject *__pyx_f_10Isosurface_EVec(
struct __pyx_opt_args_10Isosurface_EVec *__pyx_optional_args) {
2725 double __pyx_v_x = ((double)0.0);
2726 double __pyx_v_y = ((double)0.0);
2727 double __pyx_v_z = ((double)0.0);
2728 PyArrayObject *__pyx_v_v = 0;
2729 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
2730 __Pyx_Buffer __pyx_pybuffer_v;
2731 PyArrayObject *__pyx_r = NULL;
2732 __Pyx_RefNannyDeclarations
2733 PyObject *__pyx_t_1 = NULL;
2734 PyObject *__pyx_t_2 = NULL;
2735 PyArrayObject *__pyx_t_3 = NULL;
2736 Py_ssize_t __pyx_t_4;
2738 int __pyx_lineno = 0;
2739 const char *__pyx_filename = NULL;
2740 int __pyx_clineno = 0;
2741 __Pyx_RefNannySetupContext(
"EVec", 0);
2742 if (__pyx_optional_args) {
2743 if (__pyx_optional_args->__pyx_n > 0) {
2744 __pyx_v_x = __pyx_optional_args->x;
2745 if (__pyx_optional_args->__pyx_n > 1) {
2746 __pyx_v_y = __pyx_optional_args->y;
2747 if (__pyx_optional_args->__pyx_n > 2) {
2748 __pyx_v_z = __pyx_optional_args->z;
2753 __pyx_pybuffer_v.pybuffer.buf = NULL;
2754 __pyx_pybuffer_v.refcount = 0;
2755 __pyx_pybuffernd_v.data = NULL;
2756 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
2765 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
2766 __Pyx_GOTREF(__pyx_t_1);
2767 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
2768 __Pyx_GOTREF(__pyx_t_2);
2769 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2770 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
2771 __Pyx_GOTREF(__pyx_t_1);
2772 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2773 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 29, __pyx_L1_error)
2774 __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
2776 __Pyx_BufFmt_StackElem __pyx_stack[1];
2777 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
2778 __pyx_v_v = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_v.rcbuffer->pybuffer.buf = NULL;
2779 __PYX_ERR(0, 29, __pyx_L1_error)
2780 }
else {__pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
2784 __pyx_v_v = ((PyArrayObject *)__pyx_t_1);
2796 if (__pyx_t_4 < 0) {
2797 __pyx_t_4 += __pyx_pybuffernd_v.diminfo[0].shape;
2798 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2799 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_5 = 0;
2800 if (unlikely(__pyx_t_5 != -1)) {
2801 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2802 __PYX_ERR(0, 30, __pyx_L1_error)
2804 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_v_x;
2815 if (__pyx_t_4 < 0) {
2816 __pyx_t_4 += __pyx_pybuffernd_v.diminfo[0].shape;
2817 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2818 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_5 = 0;
2819 if (unlikely(__pyx_t_5 != -1)) {
2820 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2821 __PYX_ERR(0, 31, __pyx_L1_error)
2823 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_v_y;
2834 if (__pyx_t_4 < 0) {
2835 __pyx_t_4 += __pyx_pybuffernd_v.diminfo[0].shape;
2836 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2837 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_5 = 0;
2838 if (unlikely(__pyx_t_5 != -1)) {
2839 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2840 __PYX_ERR(0, 32, __pyx_L1_error)
2842 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_v_z;
2851 __Pyx_XDECREF(((PyObject *)__pyx_r));
2852 __Pyx_INCREF(((PyObject *)__pyx_v_v));
2853 __pyx_r = ((PyArrayObject *)__pyx_v_v);
2866 __Pyx_XDECREF(__pyx_t_1);
2867 __Pyx_XDECREF(__pyx_t_2);
2868 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2869 __Pyx_PyThreadState_declare
2870 __Pyx_PyThreadState_assign
2871 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2872 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
2873 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2874 __Pyx_AddTraceback(
"Isosurface.EVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
2878 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
2880 __Pyx_XDECREF((PyObject *)__pyx_v_v);
2881 __Pyx_XGIVEREF((PyObject *)__pyx_r);
2882 __Pyx_RefNannyFinishContext();
2894 static double __pyx_f_10Isosurface_enorm(PyArrayObject *__pyx_v_v) {
2895 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
2896 __Pyx_Buffer __pyx_pybuffer_v;
2898 __Pyx_RefNannyDeclarations
2899 Py_ssize_t __pyx_t_1;
2901 Py_ssize_t __pyx_t_3;
2902 Py_ssize_t __pyx_t_4;
2903 int __pyx_lineno = 0;
2904 const char *__pyx_filename = NULL;
2905 int __pyx_clineno = 0;
2906 __Pyx_RefNannySetupContext(
"enorm", 0);
2907 __pyx_pybuffer_v.pybuffer.buf = NULL;
2908 __pyx_pybuffer_v.refcount = 0;
2909 __pyx_pybuffernd_v.data = NULL;
2910 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
2912 __Pyx_BufFmt_StackElem __pyx_stack[1];
2913 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 35, __pyx_L1_error)
2915 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
2926 if (__pyx_t_1 < 0) {
2927 __pyx_t_1 += __pyx_pybuffernd_v.diminfo[0].shape;
2928 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
2929 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_2 = 0;
2930 if (unlikely(__pyx_t_2 != -1)) {
2931 __Pyx_RaiseBufferIndexError(__pyx_t_2);
2932 __PYX_ERR(0, 36, __pyx_L1_error)
2936 if (__pyx_t_3 < 0) {
2937 __pyx_t_3 += __pyx_pybuffernd_v.diminfo[0].shape;
2938 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
2939 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_2 = 0;
2940 if (unlikely(__pyx_t_2 != -1)) {
2941 __Pyx_RaiseBufferIndexError(__pyx_t_2);
2942 __PYX_ERR(0, 36, __pyx_L1_error)
2946 if (__pyx_t_4 < 0) {
2947 __pyx_t_4 += __pyx_pybuffernd_v.diminfo[0].shape;
2948 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
2949 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_2 = 0;
2950 if (unlikely(__pyx_t_2 != -1)) {
2951 __Pyx_RaiseBufferIndexError(__pyx_t_2);
2952 __PYX_ERR(0, 36, __pyx_L1_error)
2954 __pyx_r = sqrt(((pow((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_v.diminfo[0].strides)), 2.0) + pow((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_v.diminfo[0].strides)), 2.0)) + pow((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_v.diminfo[0].strides)), 2.0)));
2967 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2968 __Pyx_PyThreadState_declare
2969 __Pyx_PyThreadState_assign
2970 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2971 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
2972 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2973 __Pyx_WriteUnraisable(
"Isosurface.enorm", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2977 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
2979 __Pyx_RefNannyFinishContext();
2991 static double __pyx_f_10Isosurface_edot(PyArrayObject *__pyx_v_v0, PyArrayObject *__pyx_v_v1) {
2992 __Pyx_LocalBuf_ND __pyx_pybuffernd_v0;
2993 __Pyx_Buffer __pyx_pybuffer_v0;
2994 __Pyx_LocalBuf_ND __pyx_pybuffernd_v1;
2995 __Pyx_Buffer __pyx_pybuffer_v1;
2997 __Pyx_RefNannyDeclarations
2998 Py_ssize_t __pyx_t_1;
3000 Py_ssize_t __pyx_t_3;
3001 Py_ssize_t __pyx_t_4;
3002 Py_ssize_t __pyx_t_5;
3003 Py_ssize_t __pyx_t_6;
3004 Py_ssize_t __pyx_t_7;
3005 int __pyx_lineno = 0;
3006 const char *__pyx_filename = NULL;
3007 int __pyx_clineno = 0;
3008 __Pyx_RefNannySetupContext(
"edot", 0);
3009 __pyx_pybuffer_v0.pybuffer.buf = NULL;
3010 __pyx_pybuffer_v0.refcount = 0;
3011 __pyx_pybuffernd_v0.data = NULL;
3012 __pyx_pybuffernd_v0.rcbuffer = &__pyx_pybuffer_v0;
3013 __pyx_pybuffer_v1.pybuffer.buf = NULL;
3014 __pyx_pybuffer_v1.refcount = 0;
3015 __pyx_pybuffernd_v1.data = NULL;
3016 __pyx_pybuffernd_v1.rcbuffer = &__pyx_pybuffer_v1;
3018 __Pyx_BufFmt_StackElem __pyx_stack[1];
3019 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v0.rcbuffer->pybuffer, (PyObject*)__pyx_v_v0, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 38, __pyx_L1_error)
3021 __pyx_pybuffernd_v0.diminfo[0].strides = __pyx_pybuffernd_v0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v0.diminfo[0].shape = __pyx_pybuffernd_v0.rcbuffer->pybuffer.shape[0];
3023 __Pyx_BufFmt_StackElem __pyx_stack[1];
3024 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 38, __pyx_L1_error)
3026 __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
3037 if (__pyx_t_1 < 0) {
3038 __pyx_t_1 += __pyx_pybuffernd_v0.diminfo[0].shape;
3039 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
3040 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3041 if (unlikely(__pyx_t_2 != -1)) {
3042 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3043 __PYX_ERR(0, 39, __pyx_L1_error)
3047 if (__pyx_t_3 < 0) {
3048 __pyx_t_3 += __pyx_pybuffernd_v1.diminfo[0].shape;
3049 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
3050 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3051 if (unlikely(__pyx_t_2 != -1)) {
3052 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3053 __PYX_ERR(0, 39, __pyx_L1_error)
3057 if (__pyx_t_4 < 0) {
3058 __pyx_t_4 += __pyx_pybuffernd_v0.diminfo[0].shape;
3059 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
3060 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3061 if (unlikely(__pyx_t_2 != -1)) {
3062 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3063 __PYX_ERR(0, 39, __pyx_L1_error)
3067 if (__pyx_t_5 < 0) {
3068 __pyx_t_5 += __pyx_pybuffernd_v1.diminfo[0].shape;
3069 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
3070 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3071 if (unlikely(__pyx_t_2 != -1)) {
3072 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3073 __PYX_ERR(0, 39, __pyx_L1_error)
3077 if (__pyx_t_6 < 0) {
3078 __pyx_t_6 += __pyx_pybuffernd_v0.diminfo[0].shape;
3079 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
3080 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3081 if (unlikely(__pyx_t_2 != -1)) {
3082 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3083 __PYX_ERR(0, 39, __pyx_L1_error)
3087 if (__pyx_t_7 < 0) {
3088 __pyx_t_7 += __pyx_pybuffernd_v1.diminfo[0].shape;
3089 if (unlikely(__pyx_t_7 < 0)) __pyx_t_2 = 0;
3090 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3091 if (unlikely(__pyx_t_2 != -1)) {
3092 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3093 __PYX_ERR(0, 39, __pyx_L1_error)
3095 __pyx_r = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_v1.diminfo[0].strides))) + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_v1.diminfo[0].strides)))) + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_v1.diminfo[0].strides))));
3108 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3109 __Pyx_PyThreadState_declare
3110 __Pyx_PyThreadState_assign
3111 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3112 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
3113 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
3114 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3115 __Pyx_WriteUnraisable(
"Isosurface.edot", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3119 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
3120 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
3122 __Pyx_RefNannyFinishContext();
3134 static PyArrayObject *__pyx_f_10Isosurface_ecross(PyArrayObject *__pyx_v_v0, PyArrayObject *__pyx_v_v1) {
3135 __Pyx_LocalBuf_ND __pyx_pybuffernd_v0;
3136 __Pyx_Buffer __pyx_pybuffer_v0;
3137 __Pyx_LocalBuf_ND __pyx_pybuffernd_v1;
3138 __Pyx_Buffer __pyx_pybuffer_v1;
3139 PyArrayObject *__pyx_r = NULL;
3140 __Pyx_RefNannyDeclarations
3141 Py_ssize_t __pyx_t_1;
3143 Py_ssize_t __pyx_t_3;
3144 Py_ssize_t __pyx_t_4;
3145 Py_ssize_t __pyx_t_5;
3146 Py_ssize_t __pyx_t_6;
3147 Py_ssize_t __pyx_t_7;
3148 Py_ssize_t __pyx_t_8;
3149 Py_ssize_t __pyx_t_9;
3150 Py_ssize_t __pyx_t_10;
3151 Py_ssize_t __pyx_t_11;
3152 Py_ssize_t __pyx_t_12;
3153 Py_ssize_t __pyx_t_13;
3154 PyObject *__pyx_t_14 = NULL;
3155 struct __pyx_opt_args_10Isosurface_EVec __pyx_t_15;
3156 int __pyx_lineno = 0;
3157 const char *__pyx_filename = NULL;
3158 int __pyx_clineno = 0;
3159 __Pyx_RefNannySetupContext(
"ecross", 0);
3160 __pyx_pybuffer_v0.pybuffer.buf = NULL;
3161 __pyx_pybuffer_v0.refcount = 0;
3162 __pyx_pybuffernd_v0.data = NULL;
3163 __pyx_pybuffernd_v0.rcbuffer = &__pyx_pybuffer_v0;
3164 __pyx_pybuffer_v1.pybuffer.buf = NULL;
3165 __pyx_pybuffer_v1.refcount = 0;
3166 __pyx_pybuffernd_v1.data = NULL;
3167 __pyx_pybuffernd_v1.rcbuffer = &__pyx_pybuffer_v1;
3169 __Pyx_BufFmt_StackElem __pyx_stack[1];
3170 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v0.rcbuffer->pybuffer, (PyObject*)__pyx_v_v0, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 41, __pyx_L1_error)
3172 __pyx_pybuffernd_v0.diminfo[0].strides = __pyx_pybuffernd_v0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v0.diminfo[0].shape = __pyx_pybuffernd_v0.rcbuffer->pybuffer.shape[0];
3174 __Pyx_BufFmt_StackElem __pyx_stack[1];
3175 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 41, __pyx_L1_error)
3177 __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
3186 __Pyx_XDECREF(((PyObject *)__pyx_r));
3189 if (__pyx_t_1 < 0) {
3190 __pyx_t_1 += __pyx_pybuffernd_v0.diminfo[0].shape;
3191 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
3192 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3193 if (unlikely(__pyx_t_2 != -1)) {
3194 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3195 __PYX_ERR(0, 42, __pyx_L1_error)
3199 if (__pyx_t_3 < 0) {
3200 __pyx_t_3 += __pyx_pybuffernd_v1.diminfo[0].shape;
3201 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
3202 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3203 if (unlikely(__pyx_t_2 != -1)) {
3204 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3205 __PYX_ERR(0, 42, __pyx_L1_error)
3209 if (__pyx_t_4 < 0) {
3210 __pyx_t_4 += __pyx_pybuffernd_v0.diminfo[0].shape;
3211 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
3212 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3213 if (unlikely(__pyx_t_2 != -1)) {
3214 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3215 __PYX_ERR(0, 42, __pyx_L1_error)
3219 if (__pyx_t_5 < 0) {
3220 __pyx_t_5 += __pyx_pybuffernd_v1.diminfo[0].shape;
3221 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
3222 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3223 if (unlikely(__pyx_t_2 != -1)) {
3224 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3225 __PYX_ERR(0, 42, __pyx_L1_error)
3237 if (__pyx_t_6 < 0) {
3238 __pyx_t_6 += __pyx_pybuffernd_v0.diminfo[0].shape;
3239 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
3240 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3241 if (unlikely(__pyx_t_2 != -1)) {
3242 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3243 __PYX_ERR(0, 43, __pyx_L1_error)
3247 if (__pyx_t_7 < 0) {
3248 __pyx_t_7 += __pyx_pybuffernd_v1.diminfo[0].shape;
3249 if (unlikely(__pyx_t_7 < 0)) __pyx_t_2 = 0;
3250 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3251 if (unlikely(__pyx_t_2 != -1)) {
3252 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3253 __PYX_ERR(0, 43, __pyx_L1_error)
3257 if (__pyx_t_8 < 0) {
3258 __pyx_t_8 += __pyx_pybuffernd_v0.diminfo[0].shape;
3259 if (unlikely(__pyx_t_8 < 0)) __pyx_t_2 = 0;
3260 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3261 if (unlikely(__pyx_t_2 != -1)) {
3262 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3263 __PYX_ERR(0, 43, __pyx_L1_error)
3267 if (__pyx_t_9 < 0) {
3268 __pyx_t_9 += __pyx_pybuffernd_v1.diminfo[0].shape;
3269 if (unlikely(__pyx_t_9 < 0)) __pyx_t_2 = 0;
3270 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3271 if (unlikely(__pyx_t_2 != -1)) {
3272 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3273 __PYX_ERR(0, 43, __pyx_L1_error)
3285 if (__pyx_t_10 < 0) {
3286 __pyx_t_10 += __pyx_pybuffernd_v0.diminfo[0].shape;
3287 if (unlikely(__pyx_t_10 < 0)) __pyx_t_2 = 0;
3288 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3289 if (unlikely(__pyx_t_2 != -1)) {
3290 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3291 __PYX_ERR(0, 44, __pyx_L1_error)
3295 if (__pyx_t_11 < 0) {
3296 __pyx_t_11 += __pyx_pybuffernd_v1.diminfo[0].shape;
3297 if (unlikely(__pyx_t_11 < 0)) __pyx_t_2 = 0;
3298 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3299 if (unlikely(__pyx_t_2 != -1)) {
3300 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3301 __PYX_ERR(0, 44, __pyx_L1_error)
3305 if (__pyx_t_12 < 0) {
3306 __pyx_t_12 += __pyx_pybuffernd_v0.diminfo[0].shape;
3307 if (unlikely(__pyx_t_12 < 0)) __pyx_t_2 = 0;
3308 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3309 if (unlikely(__pyx_t_2 != -1)) {
3310 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3311 __PYX_ERR(0, 44, __pyx_L1_error)
3315 if (__pyx_t_13 < 0) {
3316 __pyx_t_13 += __pyx_pybuffernd_v1.diminfo[0].shape;
3317 if (unlikely(__pyx_t_13 < 0)) __pyx_t_2 = 0;
3318 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3319 if (unlikely(__pyx_t_2 != -1)) {
3320 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3321 __PYX_ERR(0, 44, __pyx_L1_error)
3331 __pyx_t_15.__pyx_n = 3;
3332 __pyx_t_15.x = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_v1.diminfo[0].strides))) - ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_v1.diminfo[0].strides))));
3333 __pyx_t_15.y = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_v1.diminfo[0].strides))) - ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_v1.diminfo[0].strides))));
3334 __pyx_t_15.z = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_v1.diminfo[0].strides))) - ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v1.diminfo[0].strides))));
3335 __pyx_t_14 = ((PyObject *)__pyx_f_10Isosurface_EVec(&__pyx_t_15));
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 42, __pyx_L1_error)
3336 __Pyx_GOTREF(__pyx_t_14);
3337 __pyx_r = ((PyArrayObject *)__pyx_t_14);
3351 __Pyx_XDECREF(__pyx_t_14);
3352 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3353 __Pyx_PyThreadState_declare
3354 __Pyx_PyThreadState_assign
3355 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3356 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
3357 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
3358 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3359 __Pyx_AddTraceback(
"Isosurface.ecross", __pyx_clineno, __pyx_lineno, __pyx_filename);
3363 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
3364 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
3366 __Pyx_XGIVEREF((PyObject *)__pyx_r);
3367 __Pyx_RefNannyFinishContext();
3379 static double __pyx_f_10Isosurface_etriple(PyArrayObject *__pyx_v_v0, PyArrayObject *__pyx_v_v1, PyArrayObject *__pyx_v_v2) {
3380 __Pyx_LocalBuf_ND __pyx_pybuffernd_v0;
3381 __Pyx_Buffer __pyx_pybuffer_v0;
3382 __Pyx_LocalBuf_ND __pyx_pybuffernd_v1;
3383 __Pyx_Buffer __pyx_pybuffer_v1;
3384 __Pyx_LocalBuf_ND __pyx_pybuffernd_v2;
3385 __Pyx_Buffer __pyx_pybuffer_v2;
3387 __Pyx_RefNannyDeclarations
3388 PyObject *__pyx_t_1 = NULL;
3389 int __pyx_lineno = 0;
3390 const char *__pyx_filename = NULL;
3391 int __pyx_clineno = 0;
3392 __Pyx_RefNannySetupContext(
"etriple", 0);
3393 __pyx_pybuffer_v0.pybuffer.buf = NULL;
3394 __pyx_pybuffer_v0.refcount = 0;
3395 __pyx_pybuffernd_v0.data = NULL;
3396 __pyx_pybuffernd_v0.rcbuffer = &__pyx_pybuffer_v0;
3397 __pyx_pybuffer_v1.pybuffer.buf = NULL;
3398 __pyx_pybuffer_v1.refcount = 0;
3399 __pyx_pybuffernd_v1.data = NULL;
3400 __pyx_pybuffernd_v1.rcbuffer = &__pyx_pybuffer_v1;
3401 __pyx_pybuffer_v2.pybuffer.buf = NULL;
3402 __pyx_pybuffer_v2.refcount = 0;
3403 __pyx_pybuffernd_v2.data = NULL;
3404 __pyx_pybuffernd_v2.rcbuffer = &__pyx_pybuffer_v2;
3406 __Pyx_BufFmt_StackElem __pyx_stack[1];
3407 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v0.rcbuffer->pybuffer, (PyObject*)__pyx_v_v0, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 46, __pyx_L1_error)
3409 __pyx_pybuffernd_v0.diminfo[0].strides = __pyx_pybuffernd_v0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v0.diminfo[0].shape = __pyx_pybuffernd_v0.rcbuffer->pybuffer.shape[0];
3411 __Pyx_BufFmt_StackElem __pyx_stack[1];
3412 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 46, __pyx_L1_error)
3414 __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
3416 __Pyx_BufFmt_StackElem __pyx_stack[1];
3417 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v2.rcbuffer->pybuffer, (PyObject*)__pyx_v_v2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 46, __pyx_L1_error)
3419 __pyx_pybuffernd_v2.diminfo[0].strides = __pyx_pybuffernd_v2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v2.diminfo[0].shape = __pyx_pybuffernd_v2.rcbuffer->pybuffer.shape[0];
3428 __pyx_t_1 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_v_v1), ((PyArrayObject *)__pyx_v_v2)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3429 __Pyx_GOTREF(__pyx_t_1);
3430 __pyx_r = __pyx_f_10Isosurface_edot(((PyArrayObject *)__pyx_v_v0), ((PyArrayObject *)__pyx_t_1));
3431 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3444 __Pyx_XDECREF(__pyx_t_1);
3445 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3446 __Pyx_PyThreadState_declare
3447 __Pyx_PyThreadState_assign
3448 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3449 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
3450 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
3451 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
3452 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3453 __Pyx_WriteUnraisable(
"Isosurface.etriple", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3457 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
3458 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
3459 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
3461 __Pyx_RefNannyFinishContext();
3474 static PyObject *__pyx_pw_10Isosurface_10Isosurface_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3475 static char __pyx_doc_10Isosurface_10Isosurface___init__[] =
"Isosurface.__init__(self, isosurfaces, domain, activeTime=None, sampleRate=0, format='pov', writeBoundary=True)\nCreate a set of isosurfaces that will be extracted and serialized\n\n :param isosurfaces: An iterable of \"isosurfaces\". Each isosurface is\n specified by a 2-tuple, with the first element in the tuple is a field\n from which to extract isosurfaces, and the second element is an n-tuple\n of isosurface values to extract.\n\n :param domain: a Domain object\n\n :param activeTime: If not None, a 2-tuple of start time and end time\n for which the point gauge is active.\n\n :param sampleRate: The intervals at which samples should be measured.\n Note that this is a rough lower bound, and that the gauge values could\n be computed less frequently depending on the time integrator. The\n default value of zero computes the gauge values at every time step.\n\n :param format: the file format for the isosurfaces ('pov', None).\n\n :param writeBoundary: whether to write the boundary mesh to or the\n domain bounding box\n\n Example:\n\n phi0 = (isosurfaces=('phi', (0.0,)),\n activeTime=(0, 2.5),\n sampleRate=0.2,\n fileName='water.pov')\n\n This creates an Isosurfaces object that will extract phi(x,y,z,t) = 0\n at simulation time between = 0 and 2.5 with samples taken no more\n frequently than every 0.2 seconds. Results will be saved to:\n water.pov.\n\n ";
3476 static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_1__init__ = {
"__init__", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10Isosurface_10Isosurface_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface___init__};
3477 static PyObject *__pyx_pw_10Isosurface_10Isosurface_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3478 PyObject *__pyx_v_self = 0;
3479 PyObject *__pyx_v_isosurfaces = 0;
3480 PyObject *__pyx_v_domain = 0;
3481 PyObject *__pyx_v_activeTime = 0;
3482 PyObject *__pyx_v_sampleRate = 0;
3483 PyObject *__pyx_v_format = 0;
3484 PyObject *__pyx_v_writeBoundary = 0;
3485 int __pyx_lineno = 0;
3486 const char *__pyx_filename = NULL;
3487 int __pyx_clineno = 0;
3488 PyObject *__pyx_r = 0;
3489 __Pyx_RefNannyDeclarations
3490 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
3492 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_isosurfaces,&__pyx_n_s_domain,&__pyx_n_s_activeTime,&__pyx_n_s_sampleRate,&__pyx_n_s_format,&__pyx_n_s_writeBoundary,0};
3493 PyObject* values[7] = {0,0,0,0,0,0,0};
3494 values[3] = ((PyObject *)((PyObject *)Py_None));
3495 values[4] = ((PyObject *)((PyObject *)__pyx_int_0));
3496 values[5] = ((PyObject *)((PyObject*)__pyx_n_s_pov));
3505 values[6] = ((PyObject *)((PyObject *)Py_True));
3506 if (unlikely(__pyx_kwds)) {
3508 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3510 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3512 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3514 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3516 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3518 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3520 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3522 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3525 default:
goto __pyx_L5_argtuple_error;
3527 kw_args = PyDict_Size(__pyx_kwds);
3530 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3531 else goto __pyx_L5_argtuple_error;
3534 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isosurfaces)) != 0)) kw_args--;
3536 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 3, 7, 1); __PYX_ERR(0, 54, __pyx_L3_error)
3540 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain)) != 0)) kw_args--;
3542 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 3, 7, 2); __PYX_ERR(0, 54, __pyx_L3_error)
3547 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_activeTime);
3548 if (value) { values[3] = value; kw_args--; }
3553 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sampleRate);
3554 if (value) { values[4] = value; kw_args--; }
3559 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format);
3560 if (value) { values[5] = value; kw_args--; }
3565 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writeBoundary);
3566 if (value) { values[6] = value; kw_args--; }
3569 if (unlikely(kw_args > 0)) {
3570 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 54, __pyx_L3_error)
3573 switch (PyTuple_GET_SIZE(__pyx_args)) {
3574 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3576 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3578 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3580 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3582 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3583 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3584 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3586 default:
goto __pyx_L5_argtuple_error;
3589 __pyx_v_self = values[0];
3590 __pyx_v_isosurfaces = values[1];
3591 __pyx_v_domain = values[2];
3592 __pyx_v_activeTime = values[3];
3593 __pyx_v_sampleRate = values[4];
3594 __pyx_v_format = values[5];
3595 __pyx_v_writeBoundary = values[6];
3597 goto __pyx_L4_argument_unpacking_done;
3598 __pyx_L5_argtuple_error:;
3599 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 3, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 54, __pyx_L3_error)
3601 __Pyx_AddTraceback(
"Isosurface.Isosurface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3602 __Pyx_RefNannyFinishContext();
3604 __pyx_L4_argument_unpacking_done:;
3605 __pyx_r = __pyx_pf_10Isosurface_10Isosurface___init__(__pyx_self, __pyx_v_self, __pyx_v_isosurfaces, __pyx_v_domain, __pyx_v_activeTime, __pyx_v_sampleRate, __pyx_v_format, __pyx_v_writeBoundary);
3616 __Pyx_RefNannyFinishContext();
3620 static PyObject *__pyx_pf_10Isosurface_10Isosurface___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_isosurfaces, PyObject *__pyx_v_domain, PyObject *__pyx_v_activeTime, PyObject *__pyx_v_sampleRate, PyObject *__pyx_v_format, PyObject *__pyx_v_writeBoundary) {
3621 CYTHON_UNUSED PyObject *__pyx_v_f = NULL;
3622 PyObject *__pyx_v_values = NULL;
3623 PyObject *__pyx_v_v = NULL;
3624 PyObject *__pyx_r = NULL;
3625 __Pyx_RefNannyDeclarations
3626 PyObject *__pyx_t_1 = NULL;
3627 PyObject *__pyx_t_2 = NULL;
3628 Py_ssize_t __pyx_t_3;
3629 PyObject *(*__pyx_t_4)(PyObject *);
3630 PyObject *__pyx_t_5 = NULL;
3631 PyObject *__pyx_t_6 = NULL;
3632 PyObject *__pyx_t_7 = NULL;
3633 PyObject *(*__pyx_t_8)(PyObject *);
3634 Py_ssize_t __pyx_t_9;
3635 PyObject *(*__pyx_t_10)(PyObject *);
3637 int __pyx_lineno = 0;
3638 const char *__pyx_filename = NULL;
3639 int __pyx_clineno = 0;
3640 __Pyx_RefNannySetupContext(
"__init__", 0);
3649 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_isosurfaces, __pyx_v_isosurfaces) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
3658 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_domain, __pyx_v_domain) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
3667 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
3668 __Pyx_GOTREF(__pyx_t_1);
3669 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nodes, __pyx_t_1) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
3670 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3679 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
3680 __Pyx_GOTREF(__pyx_t_1);
3681 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_elements, __pyx_t_1) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
3682 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3691 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
3692 __Pyx_GOTREF(__pyx_t_1);
3693 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_normals, __pyx_t_1) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
3694 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3703 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
3704 __Pyx_GOTREF(__pyx_t_1);
3705 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_normal_indices, __pyx_t_1) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
3706 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3715 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_isosurfaces);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
3716 __Pyx_GOTREF(__pyx_t_1);
3717 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
3718 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
3721 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
3722 __Pyx_GOTREF(__pyx_t_2);
3723 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
3725 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3727 if (likely(!__pyx_t_4)) {
3728 if (likely(PyList_CheckExact(__pyx_t_2))) {
3729 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
3730 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3731 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 97, __pyx_L1_error)
3733 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
3734 __Pyx_GOTREF(__pyx_t_1);
3737 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
3738 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3739 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 97, __pyx_L1_error)
3741 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
3742 __Pyx_GOTREF(__pyx_t_1);
3746 __pyx_t_1 = __pyx_t_4(__pyx_t_2);
3747 if (unlikely(!__pyx_t_1)) {
3748 PyObject* exc_type = PyErr_Occurred();
3750 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3751 else __PYX_ERR(0, 97, __pyx_L1_error)
3755 __Pyx_GOTREF(__pyx_t_1);
3757 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
3758 PyObject* sequence = __pyx_t_1;
3759 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3760 if (unlikely(size != 2)) {
3761 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
3762 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3763 __PYX_ERR(0, 97, __pyx_L1_error)
3765 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3766 if (likely(PyTuple_CheckExact(sequence))) {
3767 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
3768 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
3770 __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
3771 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
3773 __Pyx_INCREF(__pyx_t_5);
3774 __Pyx_INCREF(__pyx_t_6);
3776 __pyx_t_5 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
3777 __Pyx_GOTREF(__pyx_t_5);
3778 __pyx_t_6 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error)
3779 __Pyx_GOTREF(__pyx_t_6);
3781 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3783 Py_ssize_t index = -1;
3784 __pyx_t_7 = PyObject_GetIter(__pyx_t_1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error)
3785 __Pyx_GOTREF(__pyx_t_7);
3786 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3787 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
3788 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7);
if (unlikely(!__pyx_t_5))
goto __pyx_L5_unpacking_failed;
3789 __Pyx_GOTREF(__pyx_t_5);
3790 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7);
if (unlikely(!__pyx_t_6))
goto __pyx_L5_unpacking_failed;
3791 __Pyx_GOTREF(__pyx_t_6);
3792 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
3794 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3795 goto __pyx_L6_unpacking_done;
3796 __pyx_L5_unpacking_failed:;
3797 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3799 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
3800 __PYX_ERR(0, 97, __pyx_L1_error)
3801 __pyx_L6_unpacking_done:;
3803 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_5);
3805 __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_6);
3815 if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
3816 __pyx_t_1 = __pyx_v_values; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
3819 __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
3820 __Pyx_GOTREF(__pyx_t_1);
3821 __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 98, __pyx_L1_error)
3824 if (likely(!__pyx_t_10)) {
3825 if (likely(PyList_CheckExact(__pyx_t_1))) {
3826 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1))
break;
3827 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3828 __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, 98, __pyx_L1_error)
3830 __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error)
3831 __Pyx_GOTREF(__pyx_t_6);
3834 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
3835 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3836 __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, 98, __pyx_L1_error)
3838 __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error)
3839 __Pyx_GOTREF(__pyx_t_6);
3843 __pyx_t_6 = __pyx_t_10(__pyx_t_1);
3844 if (unlikely(!__pyx_t_6)) {
3845 PyObject* exc_type = PyErr_Occurred();
3847 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3848 else __PYX_ERR(0, 98, __pyx_L1_error)
3852 __Pyx_GOTREF(__pyx_t_6);
3854 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
3864 #ifndef CYTHON_WITHOUT_ASSERTIONS
3865 if (unlikely(!Py_OptimizeFlag)) {
3866 __pyx_t_6 = __Pyx_PyFloat_EqObjC(__pyx_v_v, __pyx_float_0_0, 0.0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error)
3867 __Pyx_GOTREF(__pyx_t_6);
3868 __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6);
if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 99, __pyx_L1_error)
3869 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3870 if (unlikely(!__pyx_t_11)) {
3871 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_only_implemented_for_0_isosurfac);
3872 __PYX_ERR(0, 99, __pyx_L1_error)
3885 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3895 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3904 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_activeTime, __pyx_v_activeTime) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
3913 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sampleRate, __pyx_v_sampleRate) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
3922 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_format, __pyx_v_format) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
3931 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Comm);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
3932 __Pyx_GOTREF(__pyx_t_1);
3933 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error)
3934 __Pyx_GOTREF(__pyx_t_6);
3935 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3937 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
3938 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
3939 if (likely(__pyx_t_1)) {
3940 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
3941 __Pyx_INCREF(__pyx_t_1);
3942 __Pyx_INCREF(
function);
3943 __Pyx_DECREF_SET(__pyx_t_6,
function);
3946 __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
3947 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3948 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
3949 __Pyx_GOTREF(__pyx_t_2);
3950 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3951 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_comm, __pyx_t_2) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
3952 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3961 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writeBoundary, __pyx_v_writeBoundary) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
3970 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_fileprefix, __pyx_n_s_isosurface) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
3981 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3984 __Pyx_XDECREF(__pyx_t_1);
3985 __Pyx_XDECREF(__pyx_t_2);
3986 __Pyx_XDECREF(__pyx_t_5);
3987 __Pyx_XDECREF(__pyx_t_6);
3988 __Pyx_XDECREF(__pyx_t_7);
3989 __Pyx_AddTraceback(
"Isosurface.Isosurface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3992 __Pyx_XDECREF(__pyx_v_f);
3993 __Pyx_XDECREF(__pyx_v_values);
3994 __Pyx_XDECREF(__pyx_v_v);
3995 __Pyx_XGIVEREF(__pyx_r);
3996 __Pyx_RefNannyFinishContext();
4009 static PyObject *__pyx_pw_10Isosurface_10Isosurface_3attachModel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4010 static char __pyx_doc_10Isosurface_10Isosurface_2attachModel[] =
"Isosurface.attachModel(self, model, ar)\n Attach this isosurface to the given simulation model.\n ";
4011 static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_3attachModel = {
"attachModel", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10Isosurface_10Isosurface_3attachModel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_2attachModel};
4012 static PyObject *__pyx_pw_10Isosurface_10Isosurface_3attachModel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4013 PyObject *__pyx_v_self = 0;
4014 PyObject *__pyx_v_model = 0;
4015 CYTHON_UNUSED PyObject *__pyx_v_ar = 0;
4016 int __pyx_lineno = 0;
4017 const char *__pyx_filename = NULL;
4018 int __pyx_clineno = 0;
4019 PyObject *__pyx_r = 0;
4020 __Pyx_RefNannyDeclarations
4021 __Pyx_RefNannySetupContext(
"attachModel (wrapper)", 0);
4023 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_model,&__pyx_n_s_ar,0};
4024 PyObject* values[3] = {0,0,0};
4025 if (unlikely(__pyx_kwds)) {
4027 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4029 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4031 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4033 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4036 default:
goto __pyx_L5_argtuple_error;
4038 kw_args = PyDict_Size(__pyx_kwds);
4041 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
4042 else goto __pyx_L5_argtuple_error;
4045 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_model)) != 0)) kw_args--;
4047 __Pyx_RaiseArgtupleInvalid(
"attachModel", 1, 3, 3, 1); __PYX_ERR(0, 108, __pyx_L3_error)
4051 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ar)) != 0)) kw_args--;
4053 __Pyx_RaiseArgtupleInvalid(
"attachModel", 1, 3, 3, 2); __PYX_ERR(0, 108, __pyx_L3_error)
4056 if (unlikely(kw_args > 0)) {
4057 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"attachModel") < 0)) __PYX_ERR(0, 108, __pyx_L3_error)
4059 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4060 goto __pyx_L5_argtuple_error;
4062 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4063 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4064 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4066 __pyx_v_self = values[0];
4067 __pyx_v_model = values[1];
4068 __pyx_v_ar = values[2];
4070 goto __pyx_L4_argument_unpacking_done;
4071 __pyx_L5_argtuple_error:;
4072 __Pyx_RaiseArgtupleInvalid(
"attachModel", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 108, __pyx_L3_error)
4074 __Pyx_AddTraceback(
"Isosurface.Isosurface.attachModel", __pyx_clineno, __pyx_lineno, __pyx_filename);
4075 __Pyx_RefNannyFinishContext();
4077 __pyx_L4_argument_unpacking_done:;
4078 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_2attachModel(__pyx_self, __pyx_v_self, __pyx_v_model, __pyx_v_ar);
4081 __Pyx_RefNannyFinishContext();
4084 static PyObject *__pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
4094 static PyObject *__pyx_pf_10Isosurface_10Isosurface_11attachModel_genexpr(PyObject *__pyx_self) {
4095 struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
4096 PyObject *__pyx_r = NULL;
4097 __Pyx_RefNannyDeclarations
4098 int __pyx_lineno = 0;
4099 const char *__pyx_filename = NULL;
4100 int __pyx_clineno = 0;
4101 __Pyx_RefNannySetupContext(
"genexpr", 0);
4102 __pyx_cur_scope = (
struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *)__pyx_tp_new_10Isosurface___pyx_scope_struct_1_genexpr(__pyx_ptype_10Isosurface___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
4103 if (unlikely(!__pyx_cur_scope)) {
4104 __pyx_cur_scope = ((
struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *)Py_None);
4105 __Pyx_INCREF(Py_None);
4106 __PYX_ERR(0, 125, __pyx_L1_error)
4108 __Pyx_GOTREF(__pyx_cur_scope);
4110 __pyx_cur_scope->__pyx_outer_scope = (
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *) __pyx_self;
4111 __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
4112 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
4114 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Isosurface_attachModel_locals_ge, __pyx_n_s_Isosurface);
if (unlikely(!gen)) __PYX_ERR(0, 125, __pyx_L1_error)
4115 __Pyx_DECREF(__pyx_cur_scope);
4116 __Pyx_RefNannyFinishContext();
4117 return (PyObject *) gen;
4122 __Pyx_AddTraceback(
"Isosurface.Isosurface.attachModel.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4124 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4125 __Pyx_XGIVEREF(__pyx_r);
4126 __Pyx_RefNannyFinishContext();
4130 static PyObject *__pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
4132 struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((
struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
4133 PyObject *__pyx_r = NULL;
4134 PyObject *__pyx_t_1 = NULL;
4135 PyObject *__pyx_t_2 = NULL;
4136 PyObject *__pyx_t_3 = NULL;
4137 Py_ssize_t __pyx_t_4;
4138 PyObject *(*__pyx_t_5)(PyObject *);
4139 int __pyx_lineno = 0;
4140 const char *__pyx_filename = NULL;
4141 int __pyx_clineno = 0;
4142 __Pyx_RefNannyDeclarations
4143 __Pyx_RefNannySetupContext(
"genexpr", 0);
4144 switch (__pyx_generator->resume_label) {
4145 case 0:
goto __pyx_L3_first_run;
4147 __Pyx_RefNannyFinishContext();
4150 __pyx_L3_first_run:;
4151 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 125, __pyx_L1_error)
4152 __pyx_r = PyDict_New();
if (unlikely(!__pyx_r)) __PYX_ERR(0, 125, __pyx_L1_error)
4153 __Pyx_GOTREF(__pyx_r);
4154 __Pyx_INCREF(__pyx_int_0);
4155 __pyx_t_1 = __pyx_int_0;
4156 if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError(
"self"); __PYX_ERR(0, 125, __pyx_L1_error) }
4157 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_boundaryNodes);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
4158 __Pyx_GOTREF(__pyx_t_2);
4159 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
4160 __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
4163 __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
4164 __Pyx_GOTREF(__pyx_t_3);
4165 __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error)
4167 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4169 if (likely(!__pyx_t_5)) {
4170 if (likely(PyList_CheckExact(__pyx_t_3))) {
4171 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3))
break;
4172 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4173 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
if (unlikely(0 < 0)) __PYX_ERR(0, 125, __pyx_L1_error)
4175 __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
4176 __Pyx_GOTREF(__pyx_t_2);
4179 if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
4180 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4181 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
if (unlikely(0 < 0)) __PYX_ERR(0, 125, __pyx_L1_error)
4183 __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
4184 __Pyx_GOTREF(__pyx_t_2);
4188 __pyx_t_2 = __pyx_t_5(__pyx_t_3);
4189 if (unlikely(!__pyx_t_2)) {
4190 PyObject* exc_type = PyErr_Occurred();
4192 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4193 else __PYX_ERR(0, 125, __pyx_L1_error)
4197 __Pyx_GOTREF(__pyx_t_2);
4199 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_gn);
4200 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_gn, __pyx_t_2);
4201 __Pyx_GIVEREF(__pyx_t_2);
4203 __Pyx_INCREF(__pyx_t_1);
4204 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_bn);
4205 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_bn, __pyx_t_1);
4206 __Pyx_GIVEREF(__pyx_t_1);
4207 __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
4208 __Pyx_GOTREF(__pyx_t_2);
4209 __Pyx_DECREF(__pyx_t_1);
4210 __pyx_t_1 = __pyx_t_2;
4212 if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_gn, (PyObject*)__pyx_cur_scope->__pyx_v_bn))) __PYX_ERR(0, 125, __pyx_L1_error)
4214 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4215 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4216 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4221 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4222 __Pyx_XDECREF(__pyx_t_1);
4223 __Pyx_XDECREF(__pyx_t_2);
4224 __Pyx_XDECREF(__pyx_t_3);
4225 __Pyx_AddTraceback(
"genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4227 __Pyx_XGIVEREF(__pyx_r);
4228 #if !CYTHON_USE_EXC_INFO_STACK
4229 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4231 __pyx_generator->resume_label = -1;
4232 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4233 __Pyx_RefNannyFinishContext();
4245 static PyObject *__pyx_pf_10Isosurface_10Isosurface_2attachModel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_model, CYTHON_UNUSED PyObject *__pyx_v_ar) {
4246 struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *__pyx_cur_scope;
4247 PyObject *__pyx_v_fine_grid = NULL;
4248 PyObject *__pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator = 0;
4249 PyObject *__pyx_r = NULL;
4250 __Pyx_RefNannyDeclarations
4251 PyObject *__pyx_t_1 = NULL;
4252 PyObject *__pyx_t_2 = NULL;
4253 PyObject *__pyx_t_3 = NULL;
4254 PyObject *__pyx_t_4 = NULL;
4255 int __pyx_lineno = 0;
4256 const char *__pyx_filename = NULL;
4257 int __pyx_clineno = 0;
4258 __Pyx_RefNannySetupContext(
"attachModel", 0);
4259 __pyx_cur_scope = (
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *)__pyx_tp_new_10Isosurface___pyx_scope_struct__attachModel(__pyx_ptype_10Isosurface___pyx_scope_struct__attachModel, __pyx_empty_tuple, NULL);
4260 if (unlikely(!__pyx_cur_scope)) {
4261 __pyx_cur_scope = ((
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *)Py_None);
4262 __Pyx_INCREF(Py_None);
4263 __PYX_ERR(0, 108, __pyx_L1_error)
4265 __Pyx_GOTREF(__pyx_cur_scope);
4267 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4268 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
4269 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
4278 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_model, __pyx_v_model) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
4287 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_model, __pyx_n_s_levelModelList);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
4288 __Pyx_GOTREF(__pyx_t_1);
4289 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, -1
L,
long, 1, __Pyx_PyInt_From_long, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
4290 __Pyx_GOTREF(__pyx_t_2);
4291 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4292 __pyx_v_fine_grid = __pyx_t_2;
4302 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_coefficients);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
4303 __Pyx_GOTREF(__pyx_t_2);
4304 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_variableNames);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
4305 __Pyx_GOTREF(__pyx_t_1);
4306 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4307 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_fieldNames, __pyx_t_1) < 0) __PYX_ERR(0, 113, __pyx_L1_error)
4308 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4317 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
4318 __Pyx_GOTREF(__pyx_t_1);
4319 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_elementNodesArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
4320 __Pyx_GOTREF(__pyx_t_2);
4321 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4322 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_elementNodesArray, __pyx_t_2) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
4323 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4332 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
4333 __Pyx_GOTREF(__pyx_t_2);
4334 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exteriorElementBoundariesArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
4335 __Pyx_GOTREF(__pyx_t_1);
4336 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4345 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_exteriorElementBoundariesArray, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
4346 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4355 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
4356 __Pyx_GOTREF(__pyx_t_1);
4357 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_elementBoundaryNodesArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
4358 __Pyx_GOTREF(__pyx_t_2);
4359 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4368 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_elementBoundaryNodesArray, __pyx_t_2) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
4369 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4378 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
4379 __Pyx_GOTREF(__pyx_t_2);
4380 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_elementBoundaryMaterialTypes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
4381 __Pyx_GOTREF(__pyx_t_1);
4382 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4391 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_elementBoundaryMaterialTypes, __pyx_t_1) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
4392 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4401 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_elementBoundaryNodesArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
4402 __Pyx_GOTREF(__pyx_t_2);
4411 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_exteriorElementBoundariesArray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
4412 __Pyx_GOTREF(__pyx_t_3);
4421 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
4422 __Pyx_GOTREF(__pyx_t_4);
4423 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4424 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4433 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flatten);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
4434 __Pyx_GOTREF(__pyx_t_3);
4435 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4437 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4438 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4439 if (likely(__pyx_t_4)) {
4440 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4441 __Pyx_INCREF(__pyx_t_4);
4442 __Pyx_INCREF(
function);
4443 __Pyx_DECREF_SET(__pyx_t_3,
function);
4446 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4447 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4448 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
4449 __Pyx_GOTREF(__pyx_t_1);
4450 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4459 __pyx_t_3 = PySet_New(__pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
4460 __Pyx_GOTREF(__pyx_t_3);
4461 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4462 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_boundaryNodes, __pyx_t_3) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
4463 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4472 __pyx_t_3 = __pyx_pf_10Isosurface_10Isosurface_11attachModel_genexpr(((PyObject*)__pyx_cur_scope));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
4473 __Pyx_GOTREF(__pyx_t_3);
4474 __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
4475 __Pyx_GOTREF(__pyx_t_1);
4476 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4477 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_g2b, __pyx_t_1) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
4478 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4487 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
4488 __Pyx_GOTREF(__pyx_t_1);
4489 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
4490 __Pyx_GOTREF(__pyx_t_3);
4491 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4492 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_nodeArray, __pyx_t_3) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
4493 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4502 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
4503 __Pyx_GOTREF(__pyx_t_3);
4504 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nElements_global);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
4505 __Pyx_GOTREF(__pyx_t_1);
4506 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4507 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_num_owned_elements, __pyx_t_1) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
4508 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4517 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_u);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
4518 __Pyx_GOTREF(__pyx_t_1);
4519 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_u, __pyx_t_1) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
4520 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4529 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_timeIntegration);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
4530 __Pyx_GOTREF(__pyx_t_1);
4531 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_timeIntegration, __pyx_t_1) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
4532 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4541 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_nFrames, __pyx_int_0) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
4550 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_next_output, __pyx_int_0) < 0) __PYX_ERR(0, 131, __pyx_L1_error)
4559 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_writeSceneHeader);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error)
4560 __Pyx_GOTREF(__pyx_t_3);
4562 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4563 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4564 if (likely(__pyx_t_4)) {
4565 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4566 __Pyx_INCREF(__pyx_t_4);
4567 __Pyx_INCREF(
function);
4568 __Pyx_DECREF_SET(__pyx_t_3,
function);
4571 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4572 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4573 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
4574 __Pyx_GOTREF(__pyx_t_1);
4575 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4576 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4585 __Pyx_XDECREF(__pyx_r);
4586 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
4587 __pyx_r = __pyx_cur_scope->__pyx_v_self;
4600 __Pyx_XDECREF(__pyx_t_1);
4601 __Pyx_XDECREF(__pyx_t_2);
4602 __Pyx_XDECREF(__pyx_t_3);
4603 __Pyx_XDECREF(__pyx_t_4);
4604 __Pyx_AddTraceback(
"Isosurface.Isosurface.attachModel", __pyx_clineno, __pyx_lineno, __pyx_filename);
4607 __Pyx_XDECREF(__pyx_v_fine_grid);
4608 __Pyx_XDECREF(__pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator);
4609 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4610 __Pyx_XGIVEREF(__pyx_r);
4611 __Pyx_RefNannyFinishContext();
4624 static PyObject *__pyx_pw_10Isosurface_10Isosurface_5attachHDF5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4625 static char __pyx_doc_10Isosurface_10Isosurface_4attachHDF5[] =
"Isosurface.attachHDF5(self, h5, step, cam=None)\n\n Attach this isosurface to and HDF5 archive\n ";
4626 static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_5attachHDF5 = {
"attachHDF5", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10Isosurface_10Isosurface_5attachHDF5, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_4attachHDF5};
4627 static PyObject *__pyx_pw_10Isosurface_10Isosurface_5attachHDF5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4628 PyObject *__pyx_v_self = 0;
4629 PyObject *__pyx_v_h5 = 0;
4630 PyObject *__pyx_v_step = 0;
4631 PyObject *__pyx_v_cam = 0;
4632 int __pyx_lineno = 0;
4633 const char *__pyx_filename = NULL;
4634 int __pyx_clineno = 0;
4635 PyObject *__pyx_r = 0;
4636 __Pyx_RefNannyDeclarations
4637 __Pyx_RefNannySetupContext(
"attachHDF5 (wrapper)", 0);
4639 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_h5,&__pyx_n_s_step,&__pyx_n_s_cam,0};
4640 PyObject* values[4] = {0,0,0,0};
4641 values[3] = ((PyObject *)((PyObject *)Py_None));
4642 if (unlikely(__pyx_kwds)) {
4644 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4646 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4648 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4650 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4652 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4655 default:
goto __pyx_L5_argtuple_error;
4657 kw_args = PyDict_Size(__pyx_kwds);
4660 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
4661 else goto __pyx_L5_argtuple_error;
4664 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h5)) != 0)) kw_args--;
4666 __Pyx_RaiseArgtupleInvalid(
"attachHDF5", 0, 3, 4, 1); __PYX_ERR(0, 135, __pyx_L3_error)
4670 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
4672 __Pyx_RaiseArgtupleInvalid(
"attachHDF5", 0, 3, 4, 2); __PYX_ERR(0, 135, __pyx_L3_error)
4677 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cam);
4678 if (value) { values[3] = value; kw_args--; }
4681 if (unlikely(kw_args > 0)) {
4682 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"attachHDF5") < 0)) __PYX_ERR(0, 135, __pyx_L3_error)
4685 switch (PyTuple_GET_SIZE(__pyx_args)) {
4686 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4688 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4689 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4690 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4692 default:
goto __pyx_L5_argtuple_error;
4695 __pyx_v_self = values[0];
4696 __pyx_v_h5 = values[1];
4697 __pyx_v_step = values[2];
4698 __pyx_v_cam = values[3];
4700 goto __pyx_L4_argument_unpacking_done;
4701 __pyx_L5_argtuple_error:;
4702 __Pyx_RaiseArgtupleInvalid(
"attachHDF5", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 135, __pyx_L3_error)
4704 __Pyx_AddTraceback(
"Isosurface.Isosurface.attachHDF5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4705 __Pyx_RefNannyFinishContext();
4707 __pyx_L4_argument_unpacking_done:;
4708 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_4attachHDF5(__pyx_self, __pyx_v_self, __pyx_v_h5, __pyx_v_step, __pyx_v_cam);
4711 __Pyx_RefNannyFinishContext();
4715 static PyObject *__pyx_pf_10Isosurface_10Isosurface_4attachHDF5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_h5, PyObject *__pyx_v_step, PyObject *__pyx_v_cam) {
4716 PyObject *__pyx_v_namedtuple = NULL;
4717 PyObject *__pyx_v_FemField = NULL;
4718 PyObject *__pyx_v_field_i = NULL;
4719 CYTHON_UNUSED PyObject *__pyx_v_field = NULL;
4720 PyObject *__pyx_v_isosurface = NULL;
4721 PyObject *__pyx_r = NULL;
4722 __Pyx_RefNannyDeclarations
4723 PyObject *__pyx_t_1 = NULL;
4724 PyObject *__pyx_t_2 = NULL;
4725 PyObject *__pyx_t_3 = NULL;
4726 Py_ssize_t __pyx_t_4;
4727 PyObject *(*__pyx_t_5)(PyObject *);
4728 PyObject *__pyx_t_6 = NULL;
4730 PyObject *__pyx_t_8 = NULL;
4731 PyObject *__pyx_t_9 = NULL;
4732 PyObject *__pyx_t_10 = NULL;
4733 PyObject *__pyx_t_11 = NULL;
4735 int __pyx_lineno = 0;
4736 const char *__pyx_filename = NULL;
4737 int __pyx_clineno = 0;
4738 __Pyx_RefNannySetupContext(
"attachHDF5", 0);
4747 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
4748 __Pyx_GOTREF(__pyx_t_1);
4749 __Pyx_INCREF(__pyx_n_s_namedtuple);
4750 __Pyx_GIVEREF(__pyx_n_s_namedtuple);
4751 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_namedtuple);
4752 __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
4753 __Pyx_GOTREF(__pyx_t_2);
4754 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4755 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_namedtuple);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
4756 __Pyx_GOTREF(__pyx_t_1);
4757 __Pyx_INCREF(__pyx_t_1);
4758 __pyx_v_namedtuple = __pyx_t_1;
4759 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4760 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4769 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
4770 __Pyx_GOTREF(__pyx_t_2);
4771 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_isosurfaces);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
4772 __Pyx_GOTREF(__pyx_t_1);
4773 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
4774 __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
4777 __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error)
4778 __Pyx_GOTREF(__pyx_t_3);
4779 __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error)
4781 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4783 if (likely(!__pyx_t_5)) {
4784 if (likely(PyList_CheckExact(__pyx_t_3))) {
4785 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3))
break;
4786 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4787 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
if (unlikely(0 < 0)) __PYX_ERR(0, 140, __pyx_L1_error)
4789 __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
4790 __Pyx_GOTREF(__pyx_t_1);
4793 if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
4794 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4795 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
if (unlikely(0 < 0)) __PYX_ERR(0, 140, __pyx_L1_error)
4797 __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
4798 __Pyx_GOTREF(__pyx_t_1);
4802 __pyx_t_1 = __pyx_t_5(__pyx_t_3);
4803 if (unlikely(!__pyx_t_1)) {
4804 PyObject* exc_type = PyErr_Occurred();
4806 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4807 else __PYX_ERR(0, 140, __pyx_L1_error)
4811 __Pyx_GOTREF(__pyx_t_1);
4813 __Pyx_XDECREF_SET(__pyx_v_isosurface, __pyx_t_1);
4815 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_isosurface, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
4816 __Pyx_GOTREF(__pyx_t_1);
4817 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 140, __pyx_L1_error)
4818 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4820 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4821 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_fieldNames, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
4822 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4831 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fieldNames);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
4832 __Pyx_GOTREF(__pyx_t_2);
4833 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
4834 __Pyx_GOTREF(__pyx_t_3);
4835 __Pyx_INCREF(__pyx_kp_s_ATTACHING_TO_HDF5);
4836 __Pyx_GIVEREF(__pyx_kp_s_ATTACHING_TO_HDF5);
4837 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_ATTACHING_TO_HDF5);
4838 __Pyx_GIVEREF(__pyx_t_2);
4839 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
4841 if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
4842 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4851 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_h5, __pyx_n_s_get_node);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
4852 __Pyx_GOTREF(__pyx_t_2);
4861 __pyx_t_1 = PyObject_Repr(__pyx_v_step);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
4862 __Pyx_GOTREF(__pyx_t_1);
4871 __pyx_t_6 = PyNumber_Add(__pyx_kp_s_elementsSpatial_Domain, __pyx_t_1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error)
4872 __Pyx_GOTREF(__pyx_t_6);
4873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4875 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4876 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
4877 if (likely(__pyx_t_1)) {
4878 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4879 __Pyx_INCREF(__pyx_t_1);
4880 __Pyx_INCREF(
function);
4881 __Pyx_DECREF_SET(__pyx_t_2,
function);
4884 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
4885 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4886 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4887 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
4888 __Pyx_GOTREF(__pyx_t_3);
4889 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4898 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 0, NULL, NULL, &__pyx_slice__3, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
4899 __Pyx_GOTREF(__pyx_t_2);
4900 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4909 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_elementNodesArray, __pyx_t_2) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
4910 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4919 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_h5, __pyx_n_s_get_node);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
4920 __Pyx_GOTREF(__pyx_t_3);
4921 __pyx_t_6 = PyObject_Repr(__pyx_v_step);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error)
4922 __Pyx_GOTREF(__pyx_t_6);
4923 __pyx_t_1 = PyNumber_Add(__pyx_kp_s_nodesSpatial_Domain, __pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
4924 __Pyx_GOTREF(__pyx_t_1);
4925 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4927 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4928 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
4929 if (likely(__pyx_t_6)) {
4930 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4931 __Pyx_INCREF(__pyx_t_6);
4932 __Pyx_INCREF(
function);
4933 __Pyx_DECREF_SET(__pyx_t_3,
function);
4936 __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
4937 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4938 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4939 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
4940 __Pyx_GOTREF(__pyx_t_2);
4941 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4942 __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice__3, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
4943 __Pyx_GOTREF(__pyx_t_3);
4944 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4945 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray, __pyx_t_3) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
4946 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4955 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elementNodesArray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
4956 __Pyx_GOTREF(__pyx_t_3);
4957 __pyx_t_4 = PyObject_Length(__pyx_t_3);
if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 145, __pyx_L1_error)
4958 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4959 __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
4960 __Pyx_GOTREF(__pyx_t_3);
4961 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_owned_elements, __pyx_t_3) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
4962 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4971 __pyx_t_3 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
4972 __Pyx_GOTREF(__pyx_t_3);
4973 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_u, __pyx_t_3) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
4974 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4983 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
4984 __Pyx_GOTREF(__pyx_t_2);
4985 __Pyx_INCREF(__pyx_n_s_dof);
4986 __Pyx_GIVEREF(__pyx_n_s_dof);
4987 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_dof);
4988 __Pyx_INCREF(__pyx_v_namedtuple);
4989 __pyx_t_1 = __pyx_v_namedtuple; __pyx_t_6 = NULL;
4991 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
4992 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
4993 if (likely(__pyx_t_6)) {
4994 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
4995 __Pyx_INCREF(__pyx_t_6);
4996 __Pyx_INCREF(
function);
4997 __Pyx_DECREF_SET(__pyx_t_1,
function);
5001 #if CYTHON_FAST_PYCALL
5002 if (PyFunction_Check(__pyx_t_1)) {
5003 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_s_FemField, __pyx_t_2};
5004 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
5005 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5006 __Pyx_GOTREF(__pyx_t_3);
5007 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5010 #if CYTHON_FAST_PYCCALL
5011 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
5012 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_s_FemField, __pyx_t_2};
5013 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
5014 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5015 __Pyx_GOTREF(__pyx_t_3);
5016 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5020 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 147, __pyx_L1_error)
5021 __Pyx_GOTREF(__pyx_t_8);
5023 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
5025 __Pyx_INCREF(__pyx_n_s_FemField);
5026 __Pyx_GIVEREF(__pyx_n_s_FemField);
5027 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_n_s_FemField);
5028 __Pyx_GIVEREF(__pyx_t_2);
5029 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_2);
5031 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
5032 __Pyx_GOTREF(__pyx_t_3);
5033 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5035 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5036 __pyx_v_FemField = __pyx_t_3;
5046 __Pyx_INCREF(__pyx_int_0);
5047 __pyx_t_3 = __pyx_int_0;
5048 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fieldNames);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
5049 __Pyx_GOTREF(__pyx_t_1);
5050 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
5051 __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0;
5054 __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 148, __pyx_L1_error)
5055 __Pyx_GOTREF(__pyx_t_8);
5056 __pyx_t_5 = Py_TYPE(__pyx_t_8)->tp_iternext;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
5058 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5060 if (likely(!__pyx_t_5)) {
5061 if (likely(PyList_CheckExact(__pyx_t_8))) {
5062 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_8))
break;
5063 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5064 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error)
5066 __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
5067 __Pyx_GOTREF(__pyx_t_1);
5070 if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_8))
break;
5071 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5072 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error)
5074 __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
5075 __Pyx_GOTREF(__pyx_t_1);
5079 __pyx_t_1 = __pyx_t_5(__pyx_t_8);
5080 if (unlikely(!__pyx_t_1)) {
5081 PyObject* exc_type = PyErr_Occurred();
5083 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5084 else __PYX_ERR(0, 148, __pyx_L1_error)
5088 __Pyx_GOTREF(__pyx_t_1);
5090 __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_1);
5092 __Pyx_INCREF(__pyx_t_3);
5093 __Pyx_XDECREF_SET(__pyx_v_field_i, __pyx_t_3);
5094 __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
5095 __Pyx_GOTREF(__pyx_t_1);
5096 __Pyx_DECREF(__pyx_t_3);
5097 __pyx_t_3 = __pyx_t_1;
5107 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
5108 __Pyx_GOTREF(__pyx_t_1);
5109 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_h5, __pyx_n_s_get_node);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
5110 __Pyx_GOTREF(__pyx_t_6);
5119 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_isosurfaces);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error)
5120 __Pyx_GOTREF(__pyx_t_9);
5121 __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_9, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 150, __pyx_L1_error)
5122 __Pyx_GOTREF(__pyx_t_10);
5123 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5124 __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_10, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error)
5125 __Pyx_GOTREF(__pyx_t_9);
5126 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5135 __pyx_t_10 = PyNumber_Add(__pyx_kp_s__4, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 149, __pyx_L1_error)
5136 __Pyx_GOTREF(__pyx_t_10);
5137 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5146 __pyx_t_9 = PyObject_Repr(__pyx_v_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 151, __pyx_L1_error)
5147 __Pyx_GOTREF(__pyx_t_9);
5156 __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_9);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 150, __pyx_L1_error)
5157 __Pyx_GOTREF(__pyx_t_11);
5158 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5159 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5161 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
5162 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
5163 if (likely(__pyx_t_9)) {
5164 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
5165 __Pyx_INCREF(__pyx_t_9);
5166 __Pyx_INCREF(
function);
5167 __Pyx_DECREF_SET(__pyx_t_6,
function);
5170 __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_11);
5171 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5172 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5173 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
5174 __Pyx_GOTREF(__pyx_t_2);
5175 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5184 __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice__3, 0, 0, 1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 151, __pyx_L1_error)
5185 __Pyx_GOTREF(__pyx_t_6);
5186 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5187 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dof, __pyx_t_6) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
5188 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5197 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_FemField, __pyx_empty_tuple, __pyx_t_1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
5198 __Pyx_GOTREF(__pyx_t_6);
5199 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5200 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_u);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
5201 __Pyx_GOTREF(__pyx_t_1);
5202 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_field_i, __pyx_t_6) < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
5203 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5204 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5214 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5215 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5224 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nFrames, __pyx_v_step) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
5233 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_next_output, __pyx_int_0) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
5242 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_step, __pyx_int_0, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error)
5243 __Pyx_GOTREF(__pyx_t_3);
5244 __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 154, __pyx_L1_error)
5245 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5255 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writeSceneHeader);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error)
5256 __Pyx_GOTREF(__pyx_t_8);
5258 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
5259 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
5260 if (likely(__pyx_t_6)) {
5261 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
5262 __Pyx_INCREF(__pyx_t_6);
5263 __Pyx_INCREF(
function);
5264 __Pyx_DECREF_SET(__pyx_t_8,
function);
5267 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_v_cam) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_cam);
5268 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5269 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
5270 __Pyx_GOTREF(__pyx_t_3);
5271 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5272 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5290 __Pyx_XDECREF(__pyx_r);
5291 __Pyx_INCREF(__pyx_v_self);
5292 __pyx_r = __pyx_v_self;
5305 __Pyx_XDECREF(__pyx_t_1);
5306 __Pyx_XDECREF(__pyx_t_2);
5307 __Pyx_XDECREF(__pyx_t_3);
5308 __Pyx_XDECREF(__pyx_t_6);
5309 __Pyx_XDECREF(__pyx_t_8);
5310 __Pyx_XDECREF(__pyx_t_9);
5311 __Pyx_XDECREF(__pyx_t_10);
5312 __Pyx_XDECREF(__pyx_t_11);
5313 __Pyx_AddTraceback(
"Isosurface.Isosurface.attachHDF5", __pyx_clineno, __pyx_lineno, __pyx_filename);
5316 __Pyx_XDECREF(__pyx_v_namedtuple);
5317 __Pyx_XDECREF(__pyx_v_FemField);
5318 __Pyx_XDECREF(__pyx_v_field_i);
5319 __Pyx_XDECREF(__pyx_v_field);
5320 __Pyx_XDECREF(__pyx_v_isosurface);
5321 __Pyx_XGIVEREF(__pyx_r);
5322 __Pyx_RefNannyFinishContext();
5335 static PyObject *__pyx_pw_10Isosurface_10Isosurface_7triangulateIsosurface(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5336 static char __pyx_doc_10Isosurface_10Isosurface_6triangulateIsosurface[] =
"Isosurface.triangulateIsosurface(self, field, value)\n\n Build a triangular mesh of the isosurface\n ";
5337 static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_7triangulateIsosurface = {
"triangulateIsosurface", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10Isosurface_10Isosurface_7triangulateIsosurface, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_6triangulateIsosurface};
5338 static PyObject *__pyx_pw_10Isosurface_10Isosurface_7triangulateIsosurface(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5339 PyObject *__pyx_v_self = 0;
5340 PyObject *__pyx_v_field = 0;
5341 PyObject *__pyx_v_value = 0;
5342 int __pyx_lineno = 0;
5343 const char *__pyx_filename = NULL;
5344 int __pyx_clineno = 0;
5345 PyObject *__pyx_r = 0;
5346 __Pyx_RefNannyDeclarations
5347 __Pyx_RefNannySetupContext(
"triangulateIsosurface (wrapper)", 0);
5349 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_field,&__pyx_n_s_value,0};
5350 PyObject* values[3] = {0,0,0};
5351 if (unlikely(__pyx_kwds)) {
5353 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5355 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5357 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5359 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5362 default:
goto __pyx_L5_argtuple_error;
5364 kw_args = PyDict_Size(__pyx_kwds);
5367 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
5368 else goto __pyx_L5_argtuple_error;
5371 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
5373 __Pyx_RaiseArgtupleInvalid(
"triangulateIsosurface", 1, 3, 3, 1); __PYX_ERR(0, 158, __pyx_L3_error)
5377 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
5379 __Pyx_RaiseArgtupleInvalid(
"triangulateIsosurface", 1, 3, 3, 2); __PYX_ERR(0, 158, __pyx_L3_error)
5382 if (unlikely(kw_args > 0)) {
5383 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"triangulateIsosurface") < 0)) __PYX_ERR(0, 158, __pyx_L3_error)
5385 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5386 goto __pyx_L5_argtuple_error;
5388 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5389 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5390 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5392 __pyx_v_self = values[0];
5393 __pyx_v_field = values[1];
5394 __pyx_v_value = values[2];
5396 goto __pyx_L4_argument_unpacking_done;
5397 __pyx_L5_argtuple_error:;
5398 __Pyx_RaiseArgtupleInvalid(
"triangulateIsosurface", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 158, __pyx_L3_error)
5400 __Pyx_AddTraceback(
"Isosurface.Isosurface.triangulateIsosurface", __pyx_clineno, __pyx_lineno, __pyx_filename);
5401 __Pyx_RefNannyFinishContext();
5403 __pyx_L4_argument_unpacking_done:;
5404 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_6triangulateIsosurface(__pyx_self, __pyx_v_self, __pyx_v_field, __pyx_v_value);
5407 __Pyx_RefNannyFinishContext();
5411 static PyObject *__pyx_pf_10Isosurface_10Isosurface_6triangulateIsosurface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
5419 int __pyx_v_nN_start;
5422 PyArrayObject *__pyx_v_x = 0;
5423 PyArrayObject *__pyx_v_normal = 0;
5424 PyObject *__pyx_v_nodes = NULL;
5425 PyObject *__pyx_v_elements = NULL;
5426 PyObject *__pyx_v_normals = NULL;
5427 PyObject *__pyx_v_normal_indices = NULL;
5428 PyObject *__pyx_v_phi = NULL;
5429 PyObject *__pyx_v_plus = NULL;
5430 PyObject *__pyx_v_minus = NULL;
5431 PyObject *__pyx_v_zeros = NULL;
5432 PyObject *__pyx_v_j = NULL;
5433 __Pyx_LocalBuf_ND __pyx_pybuffernd_normal;
5434 __Pyx_Buffer __pyx_pybuffer_normal;
5435 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5436 __Pyx_Buffer __pyx_pybuffer_x;
5437 PyObject *__pyx_r = NULL;
5438 __Pyx_RefNannyDeclarations
5439 PyObject *__pyx_t_1 = NULL;
5440 PyObject *__pyx_t_2 = NULL;
5441 PyObject *__pyx_t_3 = NULL;
5443 PyObject *__pyx_t_5 = NULL;
5450 Py_ssize_t __pyx_t_12;
5452 Py_ssize_t __pyx_t_14;
5453 PyObject *__pyx_t_15 = NULL;
5454 PyObject *__pyx_t_16 = NULL;
5456 PyArrayObject *__pyx_t_18 = NULL;
5457 PyObject *__pyx_t_19 = NULL;
5458 PyObject *__pyx_t_20 = NULL;
5459 PyObject *__pyx_t_21 = NULL;
5461 int __pyx_lineno = 0;
5462 const char *__pyx_filename = NULL;
5463 int __pyx_clineno = 0;
5464 __Pyx_RefNannySetupContext(
"triangulateIsosurface", 0);
5465 __pyx_pybuffer_x.pybuffer.buf = NULL;
5466 __pyx_pybuffer_x.refcount = 0;
5467 __pyx_pybuffernd_x.data = NULL;
5468 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5469 __pyx_pybuffer_normal.pybuffer.buf = NULL;
5470 __pyx_pybuffer_normal.refcount = 0;
5471 __pyx_pybuffernd_normal.data = NULL;
5472 __pyx_pybuffernd_normal.rcbuffer = &__pyx_pybuffer_normal;
5481 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
5482 __Pyx_GOTREF(__pyx_t_1);
5483 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodes);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
5484 __Pyx_GOTREF(__pyx_t_2);
5485 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
5486 __Pyx_GOTREF(__pyx_t_3);
5487 __Pyx_INCREF(__pyx_v_field);
5488 __Pyx_GIVEREF(__pyx_v_field);
5489 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_field);
5490 __Pyx_INCREF(__pyx_v_value);
5491 __Pyx_GIVEREF(__pyx_v_value);
5492 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
5493 if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
5494 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5495 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5496 __Pyx_INCREF(__pyx_t_1);
5497 __pyx_v_nodes = __pyx_t_1;
5498 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5507 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
5508 __Pyx_GOTREF(__pyx_t_1);
5509 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elements);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
5510 __Pyx_GOTREF(__pyx_t_3);
5511 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
5512 __Pyx_GOTREF(__pyx_t_2);
5513 __Pyx_INCREF(__pyx_v_field);
5514 __Pyx_GIVEREF(__pyx_v_field);
5515 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field);
5516 __Pyx_INCREF(__pyx_v_value);
5517 __Pyx_GIVEREF(__pyx_v_value);
5518 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
5519 if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 166, __pyx_L1_error)
5520 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5521 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5522 __Pyx_INCREF(__pyx_t_1);
5523 __pyx_v_elements = __pyx_t_1;
5524 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5533 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
5534 __Pyx_GOTREF(__pyx_t_1);
5535 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_normals);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
5536 __Pyx_GOTREF(__pyx_t_2);
5537 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
5538 __Pyx_GOTREF(__pyx_t_3);
5539 __Pyx_INCREF(__pyx_v_field);
5540 __Pyx_GIVEREF(__pyx_v_field);
5541 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_field);
5542 __Pyx_INCREF(__pyx_v_value);
5543 __Pyx_GIVEREF(__pyx_v_value);
5544 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
5545 if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(0, 167, __pyx_L1_error)
5546 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5547 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5548 __Pyx_INCREF(__pyx_t_1);
5549 __pyx_v_normals = __pyx_t_1;
5550 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5559 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
5560 __Pyx_GOTREF(__pyx_t_1);
5561 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_normal_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error)
5562 __Pyx_GOTREF(__pyx_t_3);
5563 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
5564 __Pyx_GOTREF(__pyx_t_2);
5565 __Pyx_INCREF(__pyx_v_field);
5566 __Pyx_GIVEREF(__pyx_v_field);
5567 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field);
5568 __Pyx_INCREF(__pyx_v_value);
5569 __Pyx_GIVEREF(__pyx_v_value);
5570 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
5571 if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
5572 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5573 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5574 __Pyx_INCREF(__pyx_t_1);
5575 __pyx_v_normal_indices = __pyx_t_1;
5576 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5585 __pyx_t_1 = __Pyx_PyFloat_NeObjC(__pyx_v_value, __pyx_float_0_0, 0.0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
5586 __Pyx_GOTREF(__pyx_t_1);
5587 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
5588 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5589 if (unlikely(__pyx_t_4)) {
5598 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
5599 __Pyx_GOTREF(__pyx_t_1);
5600 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5601 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5602 __PYX_ERR(0, 170, __pyx_L1_error)
5620 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_u);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
5621 __Pyx_GOTREF(__pyx_t_1);
5622 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fieldNames);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
5623 __Pyx_GOTREF(__pyx_t_3);
5624 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_index);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
5625 __Pyx_GOTREF(__pyx_t_5);
5626 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5628 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
5629 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
5630 if (likely(__pyx_t_3)) {
5631 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
5632 __Pyx_INCREF(__pyx_t_3);
5633 __Pyx_INCREF(
function);
5634 __Pyx_DECREF_SET(__pyx_t_5,
function);
5637 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_field) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_field);
5638 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5639 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
5640 __Pyx_GOTREF(__pyx_t_2);
5641 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5642 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
5643 __Pyx_GOTREF(__pyx_t_5);
5644 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5645 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5646 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dof);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
5647 __Pyx_GOTREF(__pyx_t_2);
5648 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5649 __pyx_v_phi = __pyx_t_2;
5659 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_owned_elements);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
5660 __Pyx_GOTREF(__pyx_t_2);
5661 __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_2);
if (unlikely((__pyx_t_6 == (
long)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error)
5662 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5663 __pyx_t_7 = __pyx_t_6;
5664 for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
5665 __pyx_v_eN = __pyx_t_8;
5674 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
5675 __Pyx_GOTREF(__pyx_t_2);
5676 __Pyx_XDECREF_SET(__pyx_v_plus, ((PyObject*)__pyx_t_2));
5686 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
5687 __Pyx_GOTREF(__pyx_t_2);
5688 __Pyx_XDECREF_SET(__pyx_v_minus, ((PyObject*)__pyx_t_2));
5698 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
5699 __Pyx_GOTREF(__pyx_t_2);
5700 __Pyx_XDECREF_SET(__pyx_v_zeros, ((PyObject*)__pyx_t_2));
5710 __pyx_v_eps = 1.0e-8;
5719 for (__pyx_t_9 = 0; __pyx_t_9 < 4; __pyx_t_9+=1) {
5720 __pyx_v_i = __pyx_t_9;
5729 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elementNodesArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
5730 __Pyx_GOTREF(__pyx_t_2);
5731 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error)
5732 __Pyx_GOTREF(__pyx_t_5);
5733 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
5734 __Pyx_GOTREF(__pyx_t_1);
5735 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
5736 __Pyx_GOTREF(__pyx_t_3);
5737 __Pyx_GIVEREF(__pyx_t_5);
5738 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
5739 __Pyx_GIVEREF(__pyx_t_1);
5740 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
5743 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
5744 __Pyx_GOTREF(__pyx_t_1);
5745 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5746 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5747 __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_10 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
5748 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5749 __pyx_v_I = __pyx_t_10;
5758 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
5759 __Pyx_GOTREF(__pyx_t_1);
5760 __pyx_t_3 = PyFloat_FromDouble(__pyx_v_eps);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
5761 __Pyx_GOTREF(__pyx_t_3);
5762 __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
5763 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5764 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5765 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 179, __pyx_L1_error)
5766 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5776 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
5777 __Pyx_GOTREF(__pyx_t_2);
5778 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_plus, __pyx_t_2);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 180, __pyx_L1_error)
5779 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5798 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
5799 __Pyx_GOTREF(__pyx_t_2);
5800 __pyx_t_3 = PyFloat_FromDouble((-__pyx_v_eps));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
5801 __Pyx_GOTREF(__pyx_t_3);
5802 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
5803 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5804 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5805 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 181, __pyx_L1_error)
5806 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5816 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
5817 __Pyx_GOTREF(__pyx_t_1);
5818 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_minus, __pyx_t_1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 182, __pyx_L1_error)
5819 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5839 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
5840 __Pyx_GOTREF(__pyx_t_1);
5841 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_zeros, __pyx_t_1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 184, __pyx_L1_error)
5842 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5854 __pyx_t_12 = PyList_GET_SIZE(__pyx_v_zeros);
if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 185, __pyx_L1_error)
5855 __pyx_v_nZeros = __pyx_t_12;
5864 __pyx_t_12 = PyList_GET_SIZE(__pyx_v_minus);
if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 186, __pyx_L1_error)
5865 __pyx_v_nMinus = __pyx_t_12;
5874 __pyx_t_12 = PyList_GET_SIZE(__pyx_v_plus);
if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 187, __pyx_L1_error)
5875 __pyx_v_nPlus = __pyx_t_12;
5884 #ifndef CYTHON_WITHOUT_ASSERTIONS
5885 if (unlikely(!Py_OptimizeFlag)) {
5886 if (unlikely(!((((__pyx_v_nZeros + __pyx_v_nMinus) + __pyx_v_nPlus) == 4) != 0))) {
5887 PyErr_SetNone(PyExc_AssertionError);
5888 __PYX_ERR(0, 188, __pyx_L1_error)
5900 __pyx_t_12 = PyList_GET_SIZE(__pyx_v_nodes);
if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 189, __pyx_L1_error)
5901 __pyx_v_nN_start = __pyx_t_12;
5910 __pyx_t_13 = ((__pyx_v_nMinus == 2) != 0);
5913 __pyx_t_4 = __pyx_t_13;
5914 goto __pyx_L10_bool_binop_done;
5916 __pyx_t_13 = ((__pyx_v_nPlus == 2) != 0);
5917 __pyx_t_4 = __pyx_t_13;
5918 __pyx_L10_bool_binop_done:;
5928 __pyx_t_1 = __pyx_v_minus; __Pyx_INCREF(__pyx_t_1); __pyx_t_12 = 0;
5930 if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_1))
break;
5931 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5932 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++;
if (unlikely(0 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
5934 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
5935 __Pyx_GOTREF(__pyx_t_3);
5937 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L1_error)
5938 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5939 __pyx_v_J = __pyx_t_9;
5948 __pyx_t_3 = __pyx_v_plus; __Pyx_INCREF(__pyx_t_3); __pyx_t_14 = 0;
5950 if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_3))
break;
5951 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5952 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_2); __pyx_t_14++;
if (unlikely(0 < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
5954 __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
5955 __Pyx_GOTREF(__pyx_t_2);
5957 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L1_error)
5958 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5959 __pyx_v_I = __pyx_t_9;
5968 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
5969 __Pyx_GOTREF(__pyx_t_2);
5970 __pyx_t_5 = PyNumber_Negative(__pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error)
5971 __Pyx_GOTREF(__pyx_t_5);
5972 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5973 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_J,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
5974 __Pyx_GOTREF(__pyx_t_2);
5975 __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 193, __pyx_L1_error)
5976 __Pyx_GOTREF(__pyx_t_15);
5977 __pyx_t_16 = PyNumber_Subtract(__pyx_t_2, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 193, __pyx_L1_error)
5978 __Pyx_GOTREF(__pyx_t_16);
5979 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5980 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5981 __pyx_t_15 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 193, __pyx_L1_error)
5982 __Pyx_GOTREF(__pyx_t_15);
5983 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5984 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5985 __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_15);
if (unlikely((__pyx_t_17 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L1_error)
5986 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5987 __pyx_v_s = __pyx_t_17;
5996 __pyx_t_15 = PyFloat_FromDouble(__pyx_v_s);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 194, __pyx_L1_error)
5997 __Pyx_GOTREF(__pyx_t_15);
5998 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 194, __pyx_L1_error)
5999 __Pyx_GOTREF(__pyx_t_16);
6000 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_16, __pyx_v_J,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error)
6001 __Pyx_GOTREF(__pyx_t_5);
6002 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6003 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 194, __pyx_L1_error)
6004 __Pyx_GOTREF(__pyx_t_16);
6005 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_16, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
6006 __Pyx_GOTREF(__pyx_t_2);
6007 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6008 __pyx_t_16 = PyNumber_Subtract(__pyx_t_5, __pyx_t_2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 194, __pyx_L1_error)
6009 __Pyx_GOTREF(__pyx_t_16);
6010 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6011 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6012 __pyx_t_2 = PyNumber_Multiply(__pyx_t_15, __pyx_t_16);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
6013 __Pyx_GOTREF(__pyx_t_2);
6014 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6015 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6024 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 195, __pyx_L1_error)
6025 __Pyx_GOTREF(__pyx_t_16);
6026 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_16, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 195, __pyx_L1_error)
6027 __Pyx_GOTREF(__pyx_t_15);
6028 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6029 __pyx_t_16 = PyNumber_Add(__pyx_t_2, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 195, __pyx_L1_error)
6030 __Pyx_GOTREF(__pyx_t_16);
6031 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6032 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6033 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 195, __pyx_L1_error)
6034 __pyx_t_18 = ((PyArrayObject *)__pyx_t_16);
6036 __Pyx_BufFmt_StackElem __pyx_stack[1];
6037 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6038 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
6039 if (unlikely(__pyx_t_9 < 0)) {
6040 PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
6041 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
6042 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
6043 __Pyx_RaiseBufferFallbackError();
6045 PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
6047 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
6049 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0];
6050 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 194, __pyx_L1_error)
6053 __Pyx_XDECREF_SET(__pyx_v_x, ((PyArrayObject *)__pyx_t_16));
6063 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_nodes, ((PyObject *)__pyx_v_x));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 196, __pyx_L1_error)
6073 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6083 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6092 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error)
6093 __Pyx_GOTREF(__pyx_t_1);
6094 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
6095 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_22);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
6096 __Pyx_GOTREF(__pyx_t_3);
6097 __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3);
6099 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nN_start);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
6100 __Pyx_GOTREF(__pyx_t_3);
6101 __pyx_t_16 = PyNumber_Add(__pyx_t_3, __pyx_v_j);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 197, __pyx_L1_error)
6102 __Pyx_GOTREF(__pyx_t_16);
6103 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6104 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_16))) __PYX_ERR(0, 197, __pyx_L1_error)
6105 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6107 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 197, __pyx_L1_error)
6108 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6117 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
6118 __Pyx_GOTREF(__pyx_t_1);
6119 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
6120 __pyx_t_16 = __Pyx_PyInt_From_long(__pyx_t_22);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 198, __pyx_L1_error)
6121 __Pyx_GOTREF(__pyx_t_16);
6122 __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_16);
6124 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_nN_start);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 198, __pyx_L1_error)
6125 __Pyx_GOTREF(__pyx_t_16);
6126 __pyx_t_3 = PyNumber_Add(__pyx_t_16, __pyx_v_j);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
6127 __Pyx_GOTREF(__pyx_t_3);
6128 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6129 __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 198, __pyx_L1_error)
6130 __Pyx_GOTREF(__pyx_t_16);
6131 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6132 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_16))) __PYX_ERR(0, 198, __pyx_L1_error)
6133 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6135 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 198, __pyx_L1_error)
6136 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6145 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
6146 __Pyx_GOTREF(__pyx_t_1);
6147 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_plus, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 199, __pyx_L1_error)
6148 __Pyx_GOTREF(__pyx_t_16);
6149 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_16);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error)
6150 __Pyx_GOTREF(__pyx_t_3);
6151 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6152 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6153 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -4
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 199, __pyx_L1_error)
6154 __Pyx_GOTREF(__pyx_t_16);
6155 __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_16);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
6156 __Pyx_GOTREF(__pyx_t_1);
6157 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6158 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6159 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 199, __pyx_L1_error)
6168 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 200, __pyx_L1_error)
6169 __Pyx_GOTREF(__pyx_t_16);
6170 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -4
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error)
6171 __Pyx_GOTREF(__pyx_t_3);
6172 __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_t_3);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 200, __pyx_L1_error)
6173 __Pyx_GOTREF(__pyx_t_15);
6174 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6175 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6176 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 200, __pyx_L1_error)
6185 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
6186 __Pyx_GOTREF(__pyx_t_3);
6187 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -4
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 201, __pyx_L1_error)
6188 __Pyx_GOTREF(__pyx_t_16);
6189 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_16);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
6190 __Pyx_GOTREF(__pyx_t_2);
6191 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6192 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6193 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 201, __pyx_L1_error)
6202 __pyx_t_4 = ((__pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_15), ((PyArrayObject *)__pyx_t_2)) < 0.0) != 0);
6203 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6204 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6205 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6215 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
6216 __Pyx_GOTREF(__pyx_t_2);
6217 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 202, __pyx_L1_error)
6218 __Pyx_GOTREF(__pyx_t_15);
6219 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6228 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
6229 __Pyx_GOTREF(__pyx_t_2);
6230 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
6231 __Pyx_GOTREF(__pyx_t_1);
6232 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6241 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
6242 __Pyx_GOTREF(__pyx_t_2);
6243 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L1_error)
6244 __Pyx_GOTREF(__pyx_t_16);
6245 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6254 __pyx_t_2 = PyList_New(3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
6255 __Pyx_GOTREF(__pyx_t_2);
6256 __Pyx_GIVEREF(__pyx_t_15);
6257 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_15);
6258 __Pyx_GIVEREF(__pyx_t_1);
6259 PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
6260 __Pyx_GIVEREF(__pyx_t_16);
6261 PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_16);
6265 if (unlikely(__Pyx_SetItemInt(__pyx_v_elements, -2
L, __pyx_t_2,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 202, __pyx_L1_error)
6266 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6284 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
6285 __Pyx_GOTREF(__pyx_t_2);
6286 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_plus, 1,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 205, __pyx_L1_error)
6287 __Pyx_GOTREF(__pyx_t_16);
6288 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_16);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
6289 __Pyx_GOTREF(__pyx_t_1);
6290 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6291 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6292 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 205, __pyx_L1_error)
6293 __Pyx_GOTREF(__pyx_t_16);
6294 __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_16);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
6295 __Pyx_GOTREF(__pyx_t_2);
6296 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6297 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6298 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 205, __pyx_L1_error)
6307 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 206, __pyx_L1_error)
6308 __Pyx_GOTREF(__pyx_t_16);
6309 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
6310 __Pyx_GOTREF(__pyx_t_1);
6311 __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_t_1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 206, __pyx_L1_error)
6312 __Pyx_GOTREF(__pyx_t_15);
6313 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6314 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6315 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 206, __pyx_L1_error)
6324 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
6325 __Pyx_GOTREF(__pyx_t_1);
6326 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 207, __pyx_L1_error)
6327 __Pyx_GOTREF(__pyx_t_16);
6328 __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_16);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
6329 __Pyx_GOTREF(__pyx_t_3);
6330 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6331 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6332 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 207, __pyx_L1_error)
6341 __pyx_t_4 = ((__pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_15), ((PyArrayObject *)__pyx_t_3)) < 0.0) != 0);
6342 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6343 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6344 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6354 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
6355 __Pyx_GOTREF(__pyx_t_3);
6356 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 208, __pyx_L1_error)
6357 __Pyx_GOTREF(__pyx_t_15);
6358 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6367 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
6368 __Pyx_GOTREF(__pyx_t_3);
6369 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
6370 __Pyx_GOTREF(__pyx_t_2);
6371 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6380 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
6381 __Pyx_GOTREF(__pyx_t_3);
6382 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_3, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 210, __pyx_L1_error)
6383 __Pyx_GOTREF(__pyx_t_16);
6384 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6393 __pyx_t_3 = PyList_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
6394 __Pyx_GOTREF(__pyx_t_3);
6395 __Pyx_GIVEREF(__pyx_t_15);
6396 PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_15);
6397 __Pyx_GIVEREF(__pyx_t_2);
6398 PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
6399 __Pyx_GIVEREF(__pyx_t_16);
6400 PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_16);
6404 if (unlikely(__Pyx_SetItemInt(__pyx_v_elements, -1
L, __pyx_t_3,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 208, __pyx_L1_error)
6405 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6423 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
6424 __Pyx_GOTREF(__pyx_t_3);
6425 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_3, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 212, __pyx_L1_error)
6426 __Pyx_GOTREF(__pyx_t_16);
6427 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6428 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_16);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
6429 __Pyx_GOTREF(__pyx_t_3);
6430 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6431 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 212, __pyx_L1_error)
6432 __Pyx_GOTREF(__pyx_t_16);
6433 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_16, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
6434 __Pyx_GOTREF(__pyx_t_2);
6435 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6436 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 212, __pyx_L1_error)
6437 __Pyx_GOTREF(__pyx_t_16);
6438 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6439 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_16);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
6440 __Pyx_GOTREF(__pyx_t_2);
6441 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6442 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6443 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 212, __pyx_L1_error)
6452 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 213, __pyx_L1_error)
6453 __Pyx_GOTREF(__pyx_t_16);
6454 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_16, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
6455 __Pyx_GOTREF(__pyx_t_3);
6456 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6457 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_3);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 213, __pyx_L1_error)
6458 __Pyx_GOTREF(__pyx_t_16);
6459 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6460 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
6461 __Pyx_GOTREF(__pyx_t_3);
6462 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 213, __pyx_L1_error)
6463 __Pyx_GOTREF(__pyx_t_15);
6464 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6465 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_15);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
6466 __Pyx_GOTREF(__pyx_t_3);
6467 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6468 __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_t_3);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 213, __pyx_L1_error)
6469 __Pyx_GOTREF(__pyx_t_15);
6470 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6471 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6472 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 213, __pyx_L1_error)